feat(headless): share immutable gameplay content
This commit is contained in:
parent
12b500d383
commit
9569dadb57
25 changed files with 1031 additions and 429 deletions
|
|
@ -123,6 +123,7 @@ internal sealed class HeadlessSessionHost : IDisposable
|
|||
private long _reconnectDeadline;
|
||||
private bool _reconnectPending;
|
||||
private ulong _stoppedGeneration;
|
||||
private string _accountName = string.Empty;
|
||||
private bool _disposed;
|
||||
|
||||
internal HeadlessSessionHost(
|
||||
|
|
@ -172,7 +173,15 @@ internal sealed class HeadlessSessionHost : IDisposable
|
|||
CombatTime: () =>
|
||||
runtimeRef?.Clock.SimulationTimeSeconds ?? 0d));
|
||||
runtimeRef = runtime;
|
||||
gameplay.Bind(runtime);
|
||||
if (contentLease is { } content)
|
||||
{
|
||||
runtime.CharacterOwner.InstallSpellMetadata(
|
||||
content.MagicCatalog.SpellTable);
|
||||
}
|
||||
gameplay.Bind(
|
||||
runtime,
|
||||
contentLease?.MagicCatalog,
|
||||
() => _accountName);
|
||||
|
||||
var bridge = new SessionCommandBridge();
|
||||
var commands = new DirectGameRuntimeCommandAdapter(
|
||||
|
|
@ -448,6 +457,8 @@ internal sealed class HeadlessSessionHost : IDisposable
|
|||
password,
|
||||
MapCharacterSelector(_descriptor.Character));
|
||||
LiveSessionStartResult result = _liveSession.Start(options);
|
||||
if (result.Selection is { } selection)
|
||||
_accountName = selection.AccountName;
|
||||
RuntimeSessionStartResult converted = Convert(result);
|
||||
if (converted.Error is { } error)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue