feat(headless): complete portable single-session host
This commit is contained in:
parent
fbebb91848
commit
f8cb840fb1
30 changed files with 3571 additions and 32 deletions
173
tests/AcDream.Headless.Tests/HeadlessCredentialResolverTests.cs
Normal file
173
tests/AcDream.Headless.Tests/HeadlessCredentialResolverTests.cs
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
using AcDream.Headless.Configuration;
|
||||
using AcDream.Headless.Credentials;
|
||||
|
||||
namespace AcDream.Headless.Tests;
|
||||
|
||||
public sealed class HeadlessCredentialResolverTests
|
||||
{
|
||||
[Fact]
|
||||
public void EnvironmentSecretIsRedactedAndErasable()
|
||||
{
|
||||
const string secretValue = "test-secret-value";
|
||||
var environment = new FixtureCredentialEnvironment(
|
||||
isLinux: false,
|
||||
new Dictionary<string, string>
|
||||
{
|
||||
["BOT_PASSWORD"] = secretValue,
|
||||
});
|
||||
var resolver = new HeadlessCredentialResolver(
|
||||
TextReader.Null,
|
||||
Environment.CurrentDirectory,
|
||||
environment);
|
||||
|
||||
HeadlessCredentialSecret secret = resolver.Resolve(
|
||||
"bot",
|
||||
new HeadlessCredentialReference
|
||||
{
|
||||
Provider = HeadlessCredentialProviderKind.Environment,
|
||||
Reference = "BOT_PASSWORD",
|
||||
});
|
||||
|
||||
Assert.Equal(secretValue, secret.Reveal());
|
||||
Assert.DoesNotContain(secretValue, secret.ToString());
|
||||
secret.Dispose();
|
||||
Assert.True(secret.IsDisposed);
|
||||
Assert.Throws<ObjectDisposedException>(secret.Reveal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StandardInputConsumesOneSecretWithoutEchoingIt()
|
||||
{
|
||||
const string secretValue = "stdin-secret";
|
||||
var resolver = new HeadlessCredentialResolver(
|
||||
new StringReader(secretValue + Environment.NewLine),
|
||||
Environment.CurrentDirectory,
|
||||
new FixtureCredentialEnvironment(
|
||||
false,
|
||||
new Dictionary<string, string>()));
|
||||
|
||||
using HeadlessCredentialSecret secret = resolver.Resolve(
|
||||
"bot",
|
||||
new HeadlessCredentialReference
|
||||
{
|
||||
Provider = HeadlessCredentialProviderKind.StandardInput,
|
||||
Reference = "bot-stdin",
|
||||
});
|
||||
|
||||
Assert.Equal(secretValue, secret.Reveal());
|
||||
Assert.DoesNotContain(secretValue, secret.ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CredentialFileIsResolvedRelativeToConfiguredDirectory()
|
||||
{
|
||||
string directory = Path.Combine(
|
||||
Path.GetTempPath(),
|
||||
$"acdream-credentials-{Guid.NewGuid():N}");
|
||||
Directory.CreateDirectory(directory);
|
||||
string path = Path.Combine(directory, "bot.pass");
|
||||
File.WriteAllText(path, "file-secret" + Environment.NewLine);
|
||||
try
|
||||
{
|
||||
var resolver = new HeadlessCredentialResolver(
|
||||
TextReader.Null,
|
||||
directory,
|
||||
new FixtureCredentialEnvironment(
|
||||
false,
|
||||
new Dictionary<string, string>()));
|
||||
|
||||
using HeadlessCredentialSecret secret = resolver.Resolve(
|
||||
"bot",
|
||||
new HeadlessCredentialReference
|
||||
{
|
||||
Provider = HeadlessCredentialProviderKind.File,
|
||||
Reference = "bot.pass",
|
||||
});
|
||||
|
||||
Assert.Equal("file-secret", secret.Reveal());
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.Delete(path);
|
||||
Directory.Delete(directory);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MissingSecretErrorNeverContainsAnotherSecret()
|
||||
{
|
||||
const string unrelatedSecret = "must-not-leak";
|
||||
var resolver = new HeadlessCredentialResolver(
|
||||
new StringReader(string.Empty),
|
||||
Environment.CurrentDirectory,
|
||||
new FixtureCredentialEnvironment(
|
||||
false,
|
||||
new Dictionary<string, string>
|
||||
{
|
||||
["OTHER"] = unrelatedSecret,
|
||||
}));
|
||||
|
||||
HeadlessCredentialException error =
|
||||
Assert.Throws<HeadlessCredentialException>(() =>
|
||||
resolver.Resolve(
|
||||
"bot",
|
||||
new HeadlessCredentialReference
|
||||
{
|
||||
Provider =
|
||||
HeadlessCredentialProviderKind.Environment,
|
||||
Reference = "MISSING",
|
||||
}));
|
||||
|
||||
Assert.DoesNotContain(unrelatedSecret, error.ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LinuxRejectsGroupOrOtherCredentialPermissions()
|
||||
{
|
||||
if (!OperatingSystem.IsLinux())
|
||||
return;
|
||||
|
||||
string path = Path.Combine(
|
||||
Path.GetTempPath(),
|
||||
$"acdream-credential-{Guid.NewGuid():N}");
|
||||
File.WriteAllText(path, "linux-secret");
|
||||
File.SetUnixFileMode(
|
||||
path,
|
||||
UnixFileMode.UserRead | UnixFileMode.GroupRead);
|
||||
try
|
||||
{
|
||||
var resolver = new HeadlessCredentialResolver(
|
||||
TextReader.Null,
|
||||
Path.GetDirectoryName(path)!,
|
||||
new FixtureCredentialEnvironment(
|
||||
true,
|
||||
new Dictionary<string, string>()));
|
||||
|
||||
Assert.Throws<HeadlessCredentialException>(() =>
|
||||
resolver.Resolve(
|
||||
"bot",
|
||||
new HeadlessCredentialReference
|
||||
{
|
||||
Provider = HeadlessCredentialProviderKind.File,
|
||||
Reference = Path.GetFileName(path),
|
||||
}));
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.Delete(path);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FixtureCredentialEnvironment(
|
||||
bool isLinux,
|
||||
IReadOnlyDictionary<string, string> values)
|
||||
: IHeadlessCredentialEnvironment
|
||||
{
|
||||
public bool IsLinux { get; } = isLinux;
|
||||
|
||||
public string? GetEnvironmentVariable(string name) =>
|
||||
values.TryGetValue(name, out string? value)
|
||||
? value
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
|
@ -41,10 +41,9 @@ public sealed class HeadlessEntryPointTests
|
|||
|
||||
[Theory]
|
||||
[InlineData("""{"version":2,"sessions":[]}""", "Unsupported configuration version")]
|
||||
[InlineData("""{"version":1,"sessions":[],"password":"secret"}""", "could not be mapped")]
|
||||
[InlineData("""{"version":1,"sessions":[{"id":"bot"},{"id":"bot"}]}""", "Duplicate session id")]
|
||||
[InlineData("""{"version":1,"sessions":[],"password":"secret"}""", "JSON document is invalid")]
|
||||
[InlineData("""{"version":1,"sessions":[null]}""", "non-empty id")]
|
||||
[InlineData("""{"version":1}""", "required properties")]
|
||||
[InlineData("""{"version":1}""", "JSON document is invalid")]
|
||||
public void ValidateRejectsInvalidOrSecretShapedConfiguration(
|
||||
string json,
|
||||
string expectedError)
|
||||
|
|
@ -67,6 +66,51 @@ public sealed class HeadlessEntryPointTests
|
|||
Assert.Equal(string.Empty, output.ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ValidateAcceptsCompleteSingleSessionConfiguration()
|
||||
{
|
||||
using var file = TemporaryConfiguration.Create(
|
||||
ConfigurationWith(Session("bot", "BOT_PASSWORD")));
|
||||
using var output = new StringWriter();
|
||||
using var error = new StringWriter();
|
||||
|
||||
int exitCode = HeadlessEntryPoint.Run(
|
||||
["validate", "--config", file.Path],
|
||||
output,
|
||||
error);
|
||||
|
||||
Assert.Equal(0, exitCode);
|
||||
Assert.Contains("1 session(s)", output.ToString());
|
||||
Assert.Equal(string.Empty, error.ToString());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("duplicate-id")]
|
||||
[InlineData("duplicate-credential")]
|
||||
public void ValidateRejectsAmbiguousSessionOwnership(string scenario)
|
||||
{
|
||||
string second = scenario == "duplicate-id"
|
||||
? Session("bot", "SECOND_PASSWORD")
|
||||
: Session("second", "BOT_PASSWORD");
|
||||
string expected = scenario == "duplicate-id"
|
||||
? "Duplicate session id"
|
||||
: "already in use";
|
||||
using var file = TemporaryConfiguration.Create(
|
||||
ConfigurationWith(
|
||||
Session("bot", "BOT_PASSWORD"),
|
||||
second));
|
||||
using var output = new StringWriter();
|
||||
using var error = new StringWriter();
|
||||
|
||||
int exitCode = HeadlessEntryPoint.Run(
|
||||
["validate", "--config", file.Path],
|
||||
output,
|
||||
error);
|
||||
|
||||
Assert.Equal(3, exitCode);
|
||||
Assert.Contains(expected, error.ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UnknownCommandReturnsUsageError()
|
||||
{
|
||||
|
|
@ -83,6 +127,15 @@ public sealed class HeadlessEntryPointTests
|
|||
Assert.Equal(string.Empty, output.ToString());
|
||||
}
|
||||
|
||||
private static string ConfigurationWith(params string[] sessions) =>
|
||||
$$"""{"version":1,"sessions":[{{string.Join(",", sessions)}}]}""";
|
||||
|
||||
private static string Session(string id, string credentialReference) =>
|
||||
$"{{\"id\":\"{id}\",\"endpoint\":{{\"host\":\"127.0.0.1\",\"port\":9000}},"
|
||||
+ "\"account\":\"account\",\"character\":{\"index\":0},"
|
||||
+ "\"policy\":{\"id\":\"idle\"},\"credential\":"
|
||||
+ $"{{\"provider\":\"environment\",\"reference\":\"{credentialReference}\"}}}}";
|
||||
|
||||
private sealed class TemporaryConfiguration : IDisposable
|
||||
{
|
||||
private TemporaryConfiguration(string path)
|
||||
|
|
|
|||
129
tests/AcDream.Headless.Tests/HeadlessPathSetTests.cs
Normal file
129
tests/AcDream.Headless.Tests/HeadlessPathSetTests.cs
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
using AcDream.Headless.Configuration;
|
||||
using AcDream.Headless.Platform;
|
||||
|
||||
namespace AcDream.Headless.Tests;
|
||||
|
||||
public sealed class HeadlessPathSetTests
|
||||
{
|
||||
[Fact]
|
||||
public void LinuxUsesXdgDirectoriesWhenConfigured()
|
||||
{
|
||||
string root = Path.GetFullPath(
|
||||
Path.Combine(Path.GetTempPath(), "acdream-xdg"));
|
||||
var platform = new FixturePlatform(isWindows: false)
|
||||
{
|
||||
CurrentDirectoryValue = Path.Combine(root, "work"),
|
||||
UserProfile = Path.Combine(root, "home", "bot"),
|
||||
Variables =
|
||||
{
|
||||
["XDG_CONFIG_HOME"] = Path.Combine(root, "cfg"),
|
||||
["XDG_DATA_HOME"] = Path.Combine(root, "data"),
|
||||
["XDG_CACHE_HOME"] = Path.Combine(root, "cache"),
|
||||
},
|
||||
};
|
||||
|
||||
HeadlessPathSet paths = HeadlessPathSet.Resolve(
|
||||
new HeadlessPathOverrides(),
|
||||
platform);
|
||||
|
||||
Assert.Equal(
|
||||
Path.Combine(root, "cfg", "acdream"),
|
||||
paths.ConfigDirectory);
|
||||
Assert.Equal(
|
||||
Path.Combine(root, "data", "acdream"),
|
||||
paths.DataDirectory);
|
||||
Assert.Equal(
|
||||
Path.Combine(root, "cache", "acdream"),
|
||||
paths.CacheDirectory);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LinuxFallsBackToHomeAndNormalizesOverrides()
|
||||
{
|
||||
var platform = new FixturePlatform(isWindows: false)
|
||||
{
|
||||
CurrentDirectoryValue = Path.GetFullPath(
|
||||
Path.Combine(Path.GetTempPath(), "acdream work")),
|
||||
UserProfile = Path.GetFullPath(
|
||||
Path.Combine(Path.GetTempPath(), "bot home")),
|
||||
};
|
||||
|
||||
HeadlessPathSet paths = HeadlessPathSet.Resolve(
|
||||
new HeadlessPathOverrides(
|
||||
ConfigDirectory: "relative cfg",
|
||||
DataDirectory: "dåta",
|
||||
CacheDirectory: "cache"),
|
||||
platform);
|
||||
|
||||
Assert.Equal(
|
||||
Path.GetFullPath("relative cfg", platform.CurrentDirectoryValue),
|
||||
paths.ConfigDirectory);
|
||||
Assert.Equal(
|
||||
Path.GetFullPath("dåta", platform.CurrentDirectoryValue),
|
||||
paths.DataDirectory);
|
||||
Assert.Equal(
|
||||
Path.GetFullPath("cache", platform.CurrentDirectoryValue),
|
||||
paths.CacheDirectory);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WindowsUsesRoamingForConfigAndLocalForDataAndCache()
|
||||
{
|
||||
string root = Path.GetFullPath(
|
||||
Path.Combine(Path.GetTempPath(), "acdream-windows"));
|
||||
var platform = new FixturePlatform(isWindows: true)
|
||||
{
|
||||
CurrentDirectoryValue = Path.Combine(root, "work"),
|
||||
ApplicationData = Path.Combine(root, "AppData", "Roaming"),
|
||||
LocalApplicationData = Path.Combine(root, "AppData", "Local"),
|
||||
UserProfile = Path.Combine(root, "Users", "bot"),
|
||||
};
|
||||
|
||||
HeadlessPathSet paths = HeadlessPathSet.Resolve(
|
||||
new HeadlessPathOverrides(),
|
||||
platform);
|
||||
|
||||
Assert.EndsWith(
|
||||
Path.Combine("AppData", "Roaming", "acdream"),
|
||||
paths.ConfigDirectory);
|
||||
Assert.EndsWith(
|
||||
Path.Combine("AppData", "Local", "acdream"),
|
||||
paths.DataDirectory);
|
||||
Assert.EndsWith(
|
||||
Path.Combine("AppData", "Local", "acdream", "cache"),
|
||||
paths.CacheDirectory);
|
||||
}
|
||||
|
||||
private sealed class FixturePlatform(bool isWindows)
|
||||
: IHeadlessPlatformEnvironment
|
||||
{
|
||||
public bool IsWindows { get; } = isWindows;
|
||||
public string CurrentDirectoryValue { get; init; } =
|
||||
Environment.CurrentDirectory;
|
||||
public string CurrentDirectory => CurrentDirectoryValue;
|
||||
public string UserProfile { get; init; } =
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
public string ApplicationData { get; init; } =
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
||||
public string LocalApplicationData { get; init; } =
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||
public Dictionary<string, string> Variables { get; } =
|
||||
new(StringComparer.Ordinal);
|
||||
|
||||
public string? GetEnvironmentVariable(string name) =>
|
||||
Variables.TryGetValue(name, out string? value)
|
||||
? value
|
||||
: null;
|
||||
|
||||
public string GetFolderPath(Environment.SpecialFolder folder) =>
|
||||
folder switch
|
||||
{
|
||||
System.Environment.SpecialFolder.UserProfile => UserProfile,
|
||||
System.Environment.SpecialFolder.ApplicationData =>
|
||||
ApplicationData,
|
||||
System.Environment.SpecialFolder.LocalApplicationData =>
|
||||
LocalApplicationData,
|
||||
_ => string.Empty,
|
||||
};
|
||||
}
|
||||
}
|
||||
218
tests/AcDream.Headless.Tests/HeadlessSessionHostTests.cs
Normal file
218
tests/AcDream.Headless.Tests/HeadlessSessionHostTests.cs
Normal file
|
|
@ -0,0 +1,218 @@
|
|||
using System.Net;
|
||||
using AcDream.Core.Net;
|
||||
using AcDream.Core.Net.Messages;
|
||||
using AcDream.Headless.Configuration;
|
||||
using AcDream.Headless.Credentials;
|
||||
using AcDream.Headless.Diagnostics;
|
||||
using AcDream.Headless.Hosting;
|
||||
using AcDream.Headless.Platform;
|
||||
using AcDream.Runtime;
|
||||
using AcDream.Runtime.Session;
|
||||
|
||||
namespace AcDream.Headless.Tests;
|
||||
|
||||
public sealed class HeadlessSessionHostTests
|
||||
{
|
||||
[Fact]
|
||||
public void SingleSessionStartsReconnectsAndConvergesWithoutPresentation()
|
||||
{
|
||||
var operations = new FixtureSessionOperations();
|
||||
using var diagnosticsOutput = new StringWriter();
|
||||
using var credential = new HeadlessCredentialSecret(
|
||||
"fixture",
|
||||
"password");
|
||||
var host = new HeadlessSessionHost(
|
||||
Descriptor(),
|
||||
credential,
|
||||
new HeadlessDiagnosticWriter(diagnosticsOutput),
|
||||
operations);
|
||||
|
||||
RuntimeSessionStartResult first = host.Start();
|
||||
ulong firstGeneration = host.Runtime.Generation.Value;
|
||||
host.Tick(0.015d);
|
||||
RuntimeSessionStartResult second = host.Reconnect();
|
||||
|
||||
Assert.Equal(RuntimeSessionStartStatus.Connected, first.Status);
|
||||
Assert.Equal(RuntimeSessionStartStatus.Connected, second.Status);
|
||||
Assert.Equal(0x50000002u, first.CharacterId);
|
||||
Assert.Equal("Headless", host.ActiveCharacterName);
|
||||
Assert.True(host.Runtime.Session.IsInWorld);
|
||||
Assert.True(host.Runtime.Generation.Value > firstGeneration);
|
||||
Assert.Equal(2, operations.CreatedSessionCount);
|
||||
Assert.Equal(1, operations.DisposedSessionCount);
|
||||
|
||||
host.Dispose();
|
||||
|
||||
Assert.Equal(2, operations.DisposedSessionCount);
|
||||
Assert.True(host.Runtime.CaptureOwnership().IsConverged);
|
||||
Assert.True(credential.IsDisposed);
|
||||
string diagnostics = diagnosticsOutput.ToString();
|
||||
Assert.Contains("\"state\":\"start-result\"", diagnostics);
|
||||
Assert.DoesNotContain("password", diagnostics);
|
||||
Assert.DoesNotContain("AcDream.App", diagnostics);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ProcessHostRunsUntilCancellationAndReturnsStableExitCode()
|
||||
{
|
||||
var configuration = new HeadlessConfiguration
|
||||
{
|
||||
Version = 1,
|
||||
Sessions =
|
||||
[
|
||||
Descriptor(
|
||||
HeadlessCredentialProviderKind.StandardInput,
|
||||
"stdin-bot"),
|
||||
],
|
||||
};
|
||||
HeadlessPathSet paths = HeadlessPathSet.Resolve(
|
||||
new HeadlessPathOverrides());
|
||||
using var diagnostics = new StringWriter();
|
||||
var operations = new FixtureSessionOperations();
|
||||
using var host = new HeadlessProcessHost(
|
||||
configuration,
|
||||
paths,
|
||||
new StringReader("process-password" + Environment.NewLine),
|
||||
diagnostics,
|
||||
operations);
|
||||
using var cancellation = new CancellationTokenSource();
|
||||
cancellation.Cancel();
|
||||
|
||||
HeadlessExitCode result =
|
||||
await host.RunAsync(cancellation.Token);
|
||||
|
||||
Assert.Equal(HeadlessExitCode.Success, result);
|
||||
Assert.True(host.Session.Runtime.Session.IsInWorld);
|
||||
Assert.DoesNotContain(
|
||||
"process-password",
|
||||
diagnostics.ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TeardownRetriesOnlyTheUnfinishedSuffix()
|
||||
{
|
||||
var operations = new FixtureSessionOperations();
|
||||
var writer = new FailOnceTextWriter();
|
||||
using var credential = new HeadlessCredentialSecret(
|
||||
"fixture",
|
||||
"password");
|
||||
var host = new HeadlessSessionHost(
|
||||
Descriptor(),
|
||||
credential,
|
||||
new HeadlessDiagnosticWriter(writer),
|
||||
operations);
|
||||
Assert.Equal(
|
||||
RuntimeSessionStartStatus.Connected,
|
||||
host.Start().Status);
|
||||
writer.FailNextWrite = true;
|
||||
|
||||
Assert.Throws<IOException>(host.Dispose);
|
||||
Assert.Equal(1, operations.DisposedSessionCount);
|
||||
|
||||
host.Dispose();
|
||||
|
||||
Assert.Equal(1, operations.DisposedSessionCount);
|
||||
Assert.True(host.Runtime.CaptureOwnership().IsConverged);
|
||||
}
|
||||
|
||||
private static HeadlessSessionDescriptor Descriptor(
|
||||
HeadlessCredentialProviderKind provider =
|
||||
HeadlessCredentialProviderKind.Environment,
|
||||
string credentialReference = "BOT_PASSWORD") => new()
|
||||
{
|
||||
Id = "bot",
|
||||
Endpoint = new HeadlessEndpointDescriptor
|
||||
{
|
||||
Host = "127.0.0.1",
|
||||
Port = 9000,
|
||||
},
|
||||
Account = "account",
|
||||
Character = new HeadlessCharacterSelector
|
||||
{
|
||||
Name = "headless",
|
||||
},
|
||||
Policy = new HeadlessBotPolicyDescriptor
|
||||
{
|
||||
Id = "idle",
|
||||
},
|
||||
Credential = new HeadlessCredentialReference
|
||||
{
|
||||
Provider = provider,
|
||||
Reference = credentialReference,
|
||||
},
|
||||
};
|
||||
|
||||
private sealed class FixtureSessionOperations : ILiveSessionOperations
|
||||
{
|
||||
public int CreatedSessionCount { get; private set; }
|
||||
public int DisposedSessionCount { get; private set; }
|
||||
|
||||
public IPEndPoint ResolveEndpoint(string host, int port) =>
|
||||
new(IPAddress.Loopback, port);
|
||||
|
||||
public WorldSession CreateSession(IPEndPoint endpoint)
|
||||
{
|
||||
CreatedSessionCount++;
|
||||
return new WorldSession(endpoint);
|
||||
}
|
||||
|
||||
public void Connect(
|
||||
WorldSession session,
|
||||
string user,
|
||||
string password)
|
||||
{
|
||||
}
|
||||
|
||||
public CharacterList.Parsed GetCharacters(
|
||||
WorldSession session) =>
|
||||
new(
|
||||
0u,
|
||||
[
|
||||
new CharacterList.Character(
|
||||
0x50000001u,
|
||||
"Other",
|
||||
0u),
|
||||
new CharacterList.Character(
|
||||
0x50000002u,
|
||||
"Headless",
|
||||
0u),
|
||||
],
|
||||
[],
|
||||
11,
|
||||
"account",
|
||||
true,
|
||||
true);
|
||||
|
||||
public void EnterWorld(
|
||||
WorldSession session,
|
||||
int activeCharacterIndex)
|
||||
{
|
||||
}
|
||||
|
||||
public void Tick(WorldSession session)
|
||||
{
|
||||
}
|
||||
|
||||
public void DisposeSession(WorldSession session)
|
||||
{
|
||||
DisposedSessionCount++;
|
||||
session.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FailOnceTextWriter : StringWriter
|
||||
{
|
||||
public bool FailNextWrite { get; set; }
|
||||
|
||||
public override void WriteLine(string? value)
|
||||
{
|
||||
if (FailNextWrite)
|
||||
{
|
||||
FailNextWrite = false;
|
||||
throw new IOException("fixture write failure");
|
||||
}
|
||||
base.WriteLine(value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,296 @@
|
|||
using System.Net;
|
||||
using AcDream.Core.Combat;
|
||||
using AcDream.Core.Items;
|
||||
using AcDream.Core.Net;
|
||||
using AcDream.Core.Net.Messages;
|
||||
using AcDream.Core.Spells;
|
||||
using AcDream.Runtime.Entities;
|
||||
using AcDream.Runtime.Gameplay;
|
||||
using AcDream.Runtime.Session;
|
||||
|
||||
namespace AcDream.Runtime.Tests.Session;
|
||||
|
||||
public sealed class DirectGameRuntimeCommandAdapterTests
|
||||
{
|
||||
[Fact]
|
||||
public void DirectRouteSendsTypedChatAndPortalAndRejectsOldGeneration()
|
||||
{
|
||||
var operations = new FixtureSessionOperations();
|
||||
var gameplay = new FixtureGameplayOperations();
|
||||
using var runtime = new GameRuntime(new GameRuntimeDependencies(
|
||||
gameplay,
|
||||
gameplay,
|
||||
gameplay,
|
||||
gameplay,
|
||||
SessionOperations: operations));
|
||||
gameplay.Bind(runtime);
|
||||
var resetHost = new FixtureResetHost();
|
||||
DirectGameRuntimeCommandAdapter? adapter = null;
|
||||
LiveSessionConnectOptions options = new(
|
||||
true,
|
||||
"127.0.0.1",
|
||||
9000,
|
||||
"account",
|
||||
"password");
|
||||
var live = new LiveSessionHost(
|
||||
runtime.Session,
|
||||
new LiveSessionHostBindings(
|
||||
new LiveSessionRoutingFactories(
|
||||
_ => new FixtureEventRoute(),
|
||||
session => adapter!.CreateRoute(session)),
|
||||
generation => runtime.ResetGeneration(
|
||||
generation,
|
||||
resetHost),
|
||||
new LiveSessionSelectionBindings(
|
||||
id => runtime.PlayerIdentity.ServerGuid = id,
|
||||
_ => { },
|
||||
runtime.CommunicationOwner.Chat.SetLocalPlayerGuid,
|
||||
_ => { },
|
||||
_ => { },
|
||||
runtime.ActionOwner.Combat.Clear),
|
||||
new LiveSessionEnteredWorldBindings(
|
||||
_ => { },
|
||||
() => { },
|
||||
() => { },
|
||||
_ => { },
|
||||
() => { }),
|
||||
(_, _, _) => { },
|
||||
() => { }),
|
||||
options);
|
||||
adapter = new DirectGameRuntimeCommandAdapter(runtime, live);
|
||||
var trace = new RuntimeTraceRecorder();
|
||||
using IDisposable subscription = runtime.Subscribe(trace);
|
||||
|
||||
RuntimeSessionStartResult started =
|
||||
adapter.Session.Start(runtime.Generation);
|
||||
RuntimeGenerationToken firstGeneration = runtime.Generation;
|
||||
var gameActions = new List<byte[]>();
|
||||
operations.Sessions[^1].GameActionCapture =
|
||||
body => gameActions.Add(body);
|
||||
|
||||
RuntimeCommandResult chat = adapter.Chat.Execute(
|
||||
runtime.Generation,
|
||||
new RuntimeChatCommand(
|
||||
RuntimeChatChannel.Say,
|
||||
"hello"));
|
||||
RuntimeCommandResult portal = adapter.Portal.Execute(
|
||||
runtime.Generation,
|
||||
RuntimePortalCommand.RecallLifestone);
|
||||
RuntimeCommandResult unsupported = adapter.Movement.Execute(
|
||||
runtime.Generation,
|
||||
RuntimeMovementCommand.Stop);
|
||||
|
||||
RuntimeSessionStartResult reconnected =
|
||||
adapter.Session.Reconnect(runtime.Generation);
|
||||
RuntimeCommandResult stale = adapter.Chat.Execute(
|
||||
firstGeneration,
|
||||
new RuntimeChatCommand(
|
||||
RuntimeChatChannel.Say,
|
||||
"stale"));
|
||||
|
||||
Assert.Equal(RuntimeSessionStartStatus.Connected, started.Status);
|
||||
Assert.Equal(
|
||||
RuntimeSessionStartStatus.Connected,
|
||||
reconnected.Status);
|
||||
Assert.True(chat.Accepted);
|
||||
Assert.True(portal.Accepted);
|
||||
Assert.Equal(
|
||||
RuntimeCommandStatus.Unsupported,
|
||||
unsupported.Status);
|
||||
Assert.Equal(
|
||||
RuntimeCommandStatus.StaleGeneration,
|
||||
stale.Status);
|
||||
Assert.Equal(2, gameActions.Count);
|
||||
Assert.Contains(
|
||||
trace.Entries,
|
||||
entry => entry.Kind == RuntimeTraceKind.Command
|
||||
&& (entry.Code >> 16)
|
||||
== (int)RuntimeCommandDomain.Chat
|
||||
&& entry.Text == "hello");
|
||||
Assert.Contains(
|
||||
trace.Entries,
|
||||
entry => entry.Kind == RuntimeTraceKind.Command
|
||||
&& (entry.Code >> 16)
|
||||
== (int)RuntimeCommandDomain.Portal);
|
||||
|
||||
RuntimeTeardownAcknowledgement stopped =
|
||||
adapter.Session.Stop(runtime.Generation);
|
||||
Assert.True(stopped.IsComplete);
|
||||
Assert.False(runtime.Session.IsInWorld);
|
||||
}
|
||||
|
||||
private sealed class FixtureSessionOperations : ILiveSessionOperations
|
||||
{
|
||||
public List<WorldSession> Sessions { get; } = [];
|
||||
|
||||
public IPEndPoint ResolveEndpoint(string host, int port) =>
|
||||
new(IPAddress.Loopback, port);
|
||||
|
||||
public WorldSession CreateSession(IPEndPoint endpoint)
|
||||
{
|
||||
var session = new WorldSession(
|
||||
endpoint,
|
||||
new FixtureTransport());
|
||||
Sessions.Add(session);
|
||||
return session;
|
||||
}
|
||||
|
||||
public void Connect(
|
||||
WorldSession session,
|
||||
string user,
|
||||
string password)
|
||||
{
|
||||
}
|
||||
|
||||
public CharacterList.Parsed GetCharacters(WorldSession session) =>
|
||||
new(
|
||||
0u,
|
||||
[
|
||||
new CharacterList.Character(
|
||||
0x50000001u,
|
||||
"Direct",
|
||||
0u),
|
||||
],
|
||||
[],
|
||||
11,
|
||||
"account",
|
||||
true,
|
||||
true);
|
||||
|
||||
public void EnterWorld(
|
||||
WorldSession session,
|
||||
int activeCharacterIndex)
|
||||
{
|
||||
}
|
||||
|
||||
public void Tick(WorldSession session)
|
||||
{
|
||||
}
|
||||
|
||||
public void DisposeSession(WorldSession session) =>
|
||||
session.Dispose();
|
||||
}
|
||||
|
||||
private sealed class FixtureEventRoute : ILiveSessionEventRouting
|
||||
{
|
||||
public void Attach()
|
||||
{
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FixtureResetHost : IRuntimeGenerationResetHost
|
||||
{
|
||||
public void RetireEntityProjection(RuntimeEntityRecord entity)
|
||||
{
|
||||
}
|
||||
|
||||
public void DrainEntityProjectionBoundary()
|
||||
{
|
||||
}
|
||||
|
||||
public void CompleteEntityProjectionRetirement()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FixtureTransport : IWorldSessionTransport
|
||||
{
|
||||
public void Send(ReadOnlySpan<byte> datagram)
|
||||
{
|
||||
}
|
||||
|
||||
public void Send(
|
||||
IPEndPoint remote,
|
||||
ReadOnlySpan<byte> datagram)
|
||||
{
|
||||
}
|
||||
|
||||
public int Receive(
|
||||
Span<byte> destination,
|
||||
TimeSpan timeout,
|
||||
out IPEndPoint? from)
|
||||
{
|
||||
from = null;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public ValueTask<NetReceiveResult> ReceiveAsync(
|
||||
Memory<byte> destination,
|
||||
CancellationToken cancellationToken) =>
|
||||
ValueTask.FromException<NetReceiveResult>(
|
||||
new OperationCanceledException(cancellationToken));
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FixtureGameplayOperations
|
||||
: IRuntimeCombatAttackOperations,
|
||||
IRuntimeCombatTargetOperations,
|
||||
IRuntimeCombatModeOperations,
|
||||
IRuntimeSpellCastOperations
|
||||
{
|
||||
private GameRuntime? _runtime;
|
||||
|
||||
public void Bind(GameRuntime runtime) => _runtime = runtime;
|
||||
public bool CanStartAttack() => false;
|
||||
public void PrepareAttackRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public bool SendAttack(AttackHeight height, float power) => false;
|
||||
public void SendCancelAttack()
|
||||
{
|
||||
}
|
||||
|
||||
public bool IsDualWield => false;
|
||||
public bool PlayerReadyForAttack => false;
|
||||
public bool AutoRepeatAttack => false;
|
||||
public bool AutoTarget => false;
|
||||
public uint? SelectClosestTarget() => null;
|
||||
public bool IsInWorld => _runtime?.Session.IsInWorld == true;
|
||||
public IReadOnlyList<ClientObject> GetOrderedEquipment() => [];
|
||||
public void NotifyExplicitCombatModeRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public void SendChangeCombatMode(CombatMode mode)
|
||||
{
|
||||
}
|
||||
|
||||
public uint LocalPlayerId =>
|
||||
_runtime?.PlayerIdentity.ServerGuid ?? 0u;
|
||||
public bool CanSend => false;
|
||||
public bool HasRequiredComponents(uint spellId) => false;
|
||||
|
||||
public bool IsTargetCompatible(
|
||||
uint targetId,
|
||||
SpellMetadata spell,
|
||||
bool showMessage) => false;
|
||||
|
||||
public void StopCompletely()
|
||||
{
|
||||
}
|
||||
|
||||
public void SendUntargeted(uint spellId)
|
||||
{
|
||||
}
|
||||
|
||||
public void SendTargeted(uint targetId, uint spellId)
|
||||
{
|
||||
}
|
||||
|
||||
public void DisplayMessage(string message)
|
||||
{
|
||||
}
|
||||
|
||||
public void IncrementBusy()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -351,6 +351,53 @@ public sealed class LiveSessionControllerTests
|
|||
Assert.Equal(1, operations.DisposeCounts[operations.Sessions[0]]);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("index")]
|
||||
[InlineData("id")]
|
||||
[InlineData("name")]
|
||||
public void Start_SelectsConfiguredAvailableCharacter(string selectorKind)
|
||||
{
|
||||
var calls = new List<string>();
|
||||
var operations = new TestOperations(calls);
|
||||
var host = new TestHost(calls);
|
||||
var controller = new LiveSessionController(operations);
|
||||
LiveSessionCharacterSelector selector = selectorKind switch
|
||||
{
|
||||
"index" => new(ActiveIndex: 1),
|
||||
"id" => new(CharacterId: 0x50000002u),
|
||||
"name" => new(CharacterName: "ready"),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(selectorKind)),
|
||||
};
|
||||
|
||||
LiveSessionStartResult result = controller.Start(
|
||||
LiveOptions(selector: selector),
|
||||
host);
|
||||
|
||||
Assert.Equal(LiveSessionStartStatus.Connected, result.Status);
|
||||
Assert.Equal(0x50000002u, result.Selection!.CharacterId);
|
||||
Assert.Contains("enter:1", calls);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Start_UnavailableConfiguredCharacterConvergesOffline()
|
||||
{
|
||||
var calls = new List<string>();
|
||||
var operations = new TestOperations(calls);
|
||||
var host = new TestHost(calls);
|
||||
var controller = new LiveSessionController(operations);
|
||||
|
||||
LiveSessionStartResult result = controller.Start(
|
||||
LiveOptions(
|
||||
selector: new LiveSessionCharacterSelector(
|
||||
CharacterId: 0x50000001u)),
|
||||
host);
|
||||
|
||||
Assert.Equal(LiveSessionStartStatus.NoCharacters, result.Status);
|
||||
Assert.False(controller.IsInWorld);
|
||||
Assert.Null(controller.CurrentSession);
|
||||
Assert.Equal(1, operations.DisposeCounts[operations.Sessions[0]]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Start_ConnectFailureConvergesOffline()
|
||||
{
|
||||
|
|
@ -926,13 +973,15 @@ public sealed class LiveSessionControllerTests
|
|||
|
||||
private static LiveSessionConnectOptions LiveOptions(
|
||||
bool live = true,
|
||||
string? user = "user") =>
|
||||
string? user = "user",
|
||||
LiveSessionCharacterSelector? selector = null) =>
|
||||
new(
|
||||
live,
|
||||
"127.0.0.1",
|
||||
9000,
|
||||
user ?? string.Empty,
|
||||
"password");
|
||||
"password",
|
||||
selector);
|
||||
|
||||
private static CharacterList.Parsed AvailableCharacters() => new(
|
||||
0u,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,278 @@
|
|||
using System.Net;
|
||||
using AcDream.Core.Combat;
|
||||
using AcDream.Core.Items;
|
||||
using AcDream.Core.Net;
|
||||
using AcDream.Core.Net.Messages;
|
||||
using AcDream.Core.Physics;
|
||||
using AcDream.Core.Spells;
|
||||
using AcDream.Runtime.Entities;
|
||||
using AcDream.Runtime.Gameplay;
|
||||
using AcDream.Runtime.Session;
|
||||
|
||||
namespace AcDream.Runtime.Tests.Session;
|
||||
|
||||
public sealed class RuntimeLiveEntitySessionControllerTests
|
||||
{
|
||||
[Fact]
|
||||
public void DirectSinkOwnsCanonicalCreateUpdateDeleteWithoutProjection()
|
||||
{
|
||||
using GameRuntime runtime = CreateRuntime();
|
||||
using var session = new WorldSession(
|
||||
new IPEndPoint(IPAddress.Loopback, 9000),
|
||||
new FixtureTransport());
|
||||
var controller = new RuntimeLiveEntitySessionController(
|
||||
runtime,
|
||||
session);
|
||||
LiveEntitySessionSink sink = controller.CreateSink();
|
||||
WorldSession.EntitySpawn spawn =
|
||||
Spawn(0x70000001u, incarnation: 1);
|
||||
|
||||
sink.Spawned(spawn);
|
||||
sink.PositionUpdated(new WorldSession.EntityPositionUpdate(
|
||||
spawn.Guid,
|
||||
spawn.Position!.Value with
|
||||
{
|
||||
PositionX = 20f,
|
||||
},
|
||||
Velocity: null,
|
||||
PlacementId: null,
|
||||
IsGrounded: true,
|
||||
InstanceSequence: 1,
|
||||
PositionSequence: 2,
|
||||
TeleportSequence: 0,
|
||||
ForcePositionSequence: 0));
|
||||
|
||||
Assert.Equal(1, runtime.Entities.Count);
|
||||
Assert.Equal(1, runtime.Inventory.ObjectCount);
|
||||
Assert.True(
|
||||
runtime.EntityObjects.Entities.TryGetActive(
|
||||
spawn.Guid,
|
||||
out RuntimeEntityRecord canonical));
|
||||
Assert.Equal(
|
||||
20f,
|
||||
canonical.Snapshot.Position!.Value.PositionX);
|
||||
|
||||
sink.Deleted(new DeleteObject.Parsed(spawn.Guid, 1));
|
||||
|
||||
Assert.Equal(0, runtime.Entities.Count);
|
||||
Assert.Equal(0, runtime.Inventory.ObjectCount);
|
||||
Assert.Equal(
|
||||
0,
|
||||
runtime.EntityObjects.Entities.PendingTeardownCount);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DirectSinkCompletesExactPortalAndSendsLoginComplete()
|
||||
{
|
||||
using GameRuntime runtime = CreateRuntime();
|
||||
const uint playerGuid = 0x50000001u;
|
||||
runtime.PlayerIdentity.ServerGuid = playerGuid;
|
||||
using var session = new WorldSession(
|
||||
new IPEndPoint(IPAddress.Loopback, 9000),
|
||||
new FixtureTransport());
|
||||
var gameActions = new List<byte[]>();
|
||||
session.GameActionCapture = body => gameActions.Add(body);
|
||||
var controller = new RuntimeLiveEntitySessionController(
|
||||
runtime,
|
||||
session);
|
||||
LiveEntitySessionSink sink = controller.CreateSink();
|
||||
WorldSession.EntitySpawn spawn =
|
||||
Spawn(playerGuid, incarnation: 1);
|
||||
sink.Spawned(spawn);
|
||||
|
||||
sink.TeleportStarted(1u);
|
||||
sink.PositionUpdated(new WorldSession.EntityPositionUpdate(
|
||||
playerGuid,
|
||||
spawn.Position!.Value with
|
||||
{
|
||||
LandblockId = 0x01020001u,
|
||||
PositionX = 30f,
|
||||
},
|
||||
Velocity: null,
|
||||
PlacementId: null,
|
||||
IsGrounded: true,
|
||||
InstanceSequence: 1,
|
||||
PositionSequence: 2,
|
||||
TeleportSequence: 1,
|
||||
ForcePositionSequence: 0));
|
||||
|
||||
Assert.Single(gameActions);
|
||||
Assert.True(runtime.TransitOwner.CaptureOwnership().IsSessionIdle);
|
||||
Assert.True(runtime.Portal.Snapshot.Completed);
|
||||
Assert.Equal(0x01020001u, runtime.Portal.Snapshot.DestinationCell);
|
||||
}
|
||||
|
||||
private static GameRuntime CreateRuntime()
|
||||
{
|
||||
var operations = new FixtureGameplayOperations();
|
||||
var runtime = new GameRuntime(new GameRuntimeDependencies(
|
||||
operations,
|
||||
operations,
|
||||
operations,
|
||||
operations));
|
||||
operations.Bind(runtime);
|
||||
return runtime;
|
||||
}
|
||||
|
||||
private static WorldSession.EntitySpawn Spawn(
|
||||
uint guid,
|
||||
ushort incarnation)
|
||||
{
|
||||
var position = new CreateObject.ServerPosition(
|
||||
0x01010001u,
|
||||
10f,
|
||||
10f,
|
||||
5f,
|
||||
1f,
|
||||
0f,
|
||||
0f,
|
||||
0f);
|
||||
var timestamps = new PhysicsTimestamps(
|
||||
Position: 1,
|
||||
Movement: 1,
|
||||
State: 1,
|
||||
Vector: 1,
|
||||
Teleport: 0,
|
||||
ServerControlledMove: 1,
|
||||
ForcePosition: 0,
|
||||
ObjDesc: 1,
|
||||
Instance: incarnation);
|
||||
var physics = new PhysicsSpawnData(
|
||||
RawState: (uint)PhysicsStateFlags.ReportCollisions,
|
||||
Position: position,
|
||||
Movement: null,
|
||||
AnimationFrame: null,
|
||||
SetupTableId: 0x02000001u,
|
||||
MotionTableId: null,
|
||||
SoundTableId: null,
|
||||
PhysicsScriptTableId: null,
|
||||
Parent: null,
|
||||
Children: null,
|
||||
Scale: null,
|
||||
Friction: null,
|
||||
Elasticity: null,
|
||||
Translucency: null,
|
||||
Velocity: null,
|
||||
Acceleration: null,
|
||||
AngularVelocity: null,
|
||||
DefaultScriptType: null,
|
||||
DefaultScriptIntensity: null,
|
||||
Timestamps: timestamps);
|
||||
return new WorldSession.EntitySpawn(
|
||||
guid,
|
||||
position,
|
||||
0x02000001u,
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
null,
|
||||
null,
|
||||
"direct entity",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
PhysicsState: physics.RawState,
|
||||
InstanceSequence: incarnation,
|
||||
MovementSequence: 1,
|
||||
ServerControlSequence: 1,
|
||||
PositionSequence: 1,
|
||||
Physics: physics);
|
||||
}
|
||||
|
||||
private sealed class FixtureTransport : IWorldSessionTransport
|
||||
{
|
||||
public void Send(ReadOnlySpan<byte> datagram)
|
||||
{
|
||||
}
|
||||
|
||||
public void Send(
|
||||
IPEndPoint remote,
|
||||
ReadOnlySpan<byte> datagram)
|
||||
{
|
||||
}
|
||||
|
||||
public int Receive(
|
||||
Span<byte> destination,
|
||||
TimeSpan timeout,
|
||||
out IPEndPoint? from)
|
||||
{
|
||||
from = null;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public ValueTask<NetReceiveResult> ReceiveAsync(
|
||||
Memory<byte> destination,
|
||||
CancellationToken cancellationToken) =>
|
||||
ValueTask.FromException<NetReceiveResult>(
|
||||
new OperationCanceledException(cancellationToken));
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FixtureGameplayOperations
|
||||
: IRuntimeCombatAttackOperations,
|
||||
IRuntimeCombatTargetOperations,
|
||||
IRuntimeCombatModeOperations,
|
||||
IRuntimeSpellCastOperations
|
||||
{
|
||||
private GameRuntime? _runtime;
|
||||
|
||||
public void Bind(GameRuntime runtime) => _runtime = runtime;
|
||||
public bool CanStartAttack() => false;
|
||||
public void PrepareAttackRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public bool SendAttack(AttackHeight height, float power) => false;
|
||||
public void SendCancelAttack()
|
||||
{
|
||||
}
|
||||
|
||||
public bool IsDualWield => false;
|
||||
public bool PlayerReadyForAttack => false;
|
||||
public bool AutoRepeatAttack => false;
|
||||
public bool AutoTarget => false;
|
||||
public uint? SelectClosestTarget() => null;
|
||||
public bool IsInWorld => _runtime?.Session.IsInWorld == true;
|
||||
public IReadOnlyList<ClientObject> GetOrderedEquipment() => [];
|
||||
public void NotifyExplicitCombatModeRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public void SendChangeCombatMode(CombatMode mode)
|
||||
{
|
||||
}
|
||||
|
||||
public uint LocalPlayerId =>
|
||||
_runtime?.PlayerIdentity.ServerGuid ?? 0u;
|
||||
public bool CanSend => false;
|
||||
public bool HasRequiredComponents(uint spellId) => false;
|
||||
|
||||
public bool IsTargetCompatible(
|
||||
uint targetId,
|
||||
SpellMetadata spell,
|
||||
bool showMessage) => false;
|
||||
|
||||
public void StopCompletely()
|
||||
{
|
||||
}
|
||||
|
||||
public void SendUntargeted(uint spellId)
|
||||
{
|
||||
}
|
||||
|
||||
public void SendTargeted(uint targetId, uint spellId)
|
||||
{
|
||||
}
|
||||
|
||||
public void DisplayMessage(string message)
|
||||
{
|
||||
}
|
||||
|
||||
public void IncrementBusy()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue