refactor(runtime): expose canonical gameplay state
Move character options and movement skills into the Runtime-owned character graph, expose borrowed inventory, character, and social views, and route retained UI state commands through generation-gated typed Runtime contracts. Preserve the existing synchronous wire path while deleting the App-owned option and skill mirrors and extending normalized parity checkpoints. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
9d0d9b07e0
commit
dcb61efb5a
34 changed files with 2076 additions and 103 deletions
|
|
@ -36,9 +36,7 @@ namespace AcDream.App.Net;
|
|||
internal sealed record LiveSessionPlayerRuntime(
|
||||
LocalPlayerIdentityState Identity,
|
||||
LocalPlayerControllerSlot Controller,
|
||||
LocalPlayerSkillState Skills,
|
||||
LiveWorldOriginState WorldOrigin,
|
||||
PlayerCharacterOptionsState CharacterOptions);
|
||||
LiveWorldOriginState WorldOrigin);
|
||||
|
||||
internal sealed record LiveSessionDomainRuntime(
|
||||
RuntimeEntityObjectLifetime EntityObjects,
|
||||
|
|
@ -215,8 +213,8 @@ internal sealed class LiveSessionRuntimeFactory
|
|||
_domain.Communication.ResetChatIdentity();
|
||||
EntityVanishProbe.PlayerGuid = 0u;
|
||||
_interaction.Settings.ResetActiveCharacterKey();
|
||||
_player.CharacterOptions.Reset();
|
||||
_player.Skills.ResetSession();
|
||||
_domain.Character.Options.ResetSession();
|
||||
_domain.Character.MovementSkills.ResetSession();
|
||||
_world.NetworkUpdates.ResetSessionState();
|
||||
_world.Hydration.ResetSessionState();
|
||||
_domain.Inventory.ResetPlayerSnapshots();
|
||||
|
|
@ -282,27 +280,22 @@ internal sealed class LiveSessionRuntimeFactory
|
|||
ResolveSkillFormulaBonus: skillCreditResolver.Resolve,
|
||||
OnSkillsUpdated: (runSkill, jumpSkill) =>
|
||||
{
|
||||
_player.Skills.Update(
|
||||
runSkill,
|
||||
jumpSkill,
|
||||
_player.Controller.Controller);
|
||||
if (_player.Skills.IsComplete
|
||||
&& _player.Controller.Controller is not null)
|
||||
if (LocalPlayerSkillProjection.ApplyTo(
|
||||
_domain.Character.MovementSkills,
|
||||
_player.Controller.Controller))
|
||||
{
|
||||
RuntimeMovementSkillSnapshot snapshot =
|
||||
_domain.Character.MovementSkills.Snapshot;
|
||||
_log(
|
||||
$"player: applied server skills " +
|
||||
$"run={_player.Skills.RunSkill} " +
|
||||
$"jump={_player.Skills.JumpSkill}");
|
||||
$"run={snapshot.RunSkill} " +
|
||||
$"jump={snapshot.JumpSkill}");
|
||||
}
|
||||
},
|
||||
OnConfirmationRequest: request =>
|
||||
_ui.RetailUi?.HandleConfirmationRequest(request),
|
||||
OnConfirmationDone: done =>
|
||||
_ui.RetailUi?.HandleConfirmationDone(done),
|
||||
OnCharacterOptions: (options1, _) =>
|
||||
_player.CharacterOptions.Options =
|
||||
(Core.Net.Messages.PlayerDescriptionParser.CharacterOptions1)
|
||||
options1,
|
||||
ClientTime: ClientTimerNow);
|
||||
}
|
||||
|
||||
|
|
@ -391,6 +384,26 @@ internal sealed class LiveSessionRuntimeFactory
|
|||
senderGuid,
|
||||
text,
|
||||
cookie),
|
||||
AddShortcut: session.SendAddShortcut,
|
||||
RemoveShortcut: session.SendRemoveShortcut,
|
||||
AddFavorite: session.SendAddSpellFavorite,
|
||||
RemoveFavorite: session.SendRemoveSpellFavorite,
|
||||
SetSpellbookFilter: session.SendSpellbookFilter,
|
||||
ForgetSpell: session.SendRemoveSpell,
|
||||
SetDesiredComponent: session.SendSetDesiredComponentLevel,
|
||||
ClearDesiredComponents: session.SendClearDesiredComponents,
|
||||
RaiseAttribute: session.SendRaiseAttribute,
|
||||
RaiseVital: session.SendRaiseVital,
|
||||
RaiseSkill: session.SendRaiseSkill,
|
||||
TrainSkill: session.SendTrainSkill,
|
||||
SetCharacterOptions: session.SendSetCharacterOptions,
|
||||
AddFriend: session.SendAddFriend,
|
||||
RemoveFriend: session.SendRemoveFriend,
|
||||
ClearFriends: session.SendClearFriends,
|
||||
RequestLegacyFriends: session.SendLegacyFriendsListRequest,
|
||||
ModifyCharacterSquelch: session.SendModifyCharacterSquelch,
|
||||
ModifyAccountSquelch: session.SendModifyAccountSquelch,
|
||||
ModifyGlobalSquelch: session.SendModifyGlobalSquelch,
|
||||
Log: _log);
|
||||
|
||||
private static double ClientTimerNow() =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue