58 lines
1.9 KiB
C#
58 lines
1.9 KiB
C#
using AcDream.Launcher.Core.Launching;
|
|
using AcDream.Launcher.Core.Profiles;
|
|
using AcDream.Platform;
|
|
|
|
namespace AcDream.Tests.Fixtures.CampaignLa;
|
|
|
|
/// <summary>
|
|
/// Produces one real Launcher.Core session document that is compiled into
|
|
/// both host test suites. Keeping composition in one linked fixture makes the
|
|
/// LA1/LA3 anti-drift gate prove that App and Headless accept the identical
|
|
/// composer output rather than two hand-maintained lookalikes.
|
|
/// </summary>
|
|
internal static class LauncherCoreSessionConfigFixture
|
|
{
|
|
internal const string Password = "must-not-be-serialized";
|
|
|
|
internal static string Compose()
|
|
{
|
|
var server = new ServerProfile
|
|
{
|
|
Name = "Composer Server",
|
|
Host = "composer.example",
|
|
Port = 9010,
|
|
};
|
|
var account = new AccountProfile
|
|
{
|
|
Account = "composer-account",
|
|
Password = Password,
|
|
};
|
|
var character = new CharacterProfile
|
|
{
|
|
Name = "Composer Character",
|
|
Id = "0x50000001",
|
|
LaunchMode = LaunchMode.Headless,
|
|
Plugins = ["ComposerPlugin"],
|
|
LoginCommands = ["/composer command"],
|
|
};
|
|
var install = new LauncherInstallRecord(
|
|
"composer-dats",
|
|
"composer-dats/acdream.pak");
|
|
var paths = new ApplicationPathSet(
|
|
Path.Combine(Path.GetTempPath(), "composer-config"),
|
|
Path.Combine(Path.GetTempPath(), "composer-data"),
|
|
Path.Combine(Path.GetTempPath(), "composer-cache"),
|
|
LegacyConfigDirectory: null);
|
|
|
|
ComposedSessionConfig composed = SessionConfigComposer.Compose(
|
|
server,
|
|
account,
|
|
character,
|
|
install,
|
|
paths,
|
|
"composer-contract",
|
|
loginCommandDelayMs: 625);
|
|
|
|
return SessionConfigComposer.Serialize(composed.Document);
|
|
}
|
|
}
|