Tighten actor cache loading flow

- Clarify client loading status text
- Document server-side actor hydration and snapshot recovery
- Stop hot reads from forcing repository initialization
This commit is contained in:
Jacob Schmidt 2026-04-05 21:57:45 -05:00
parent cd3e937cdc
commit 3599f802c8
3 changed files with 5 additions and 6 deletions

View File

@ -33,7 +33,7 @@ GVAR(ActorRepositoryBaseClass) = compileFinal createHashMapFromArray [
[SRPC(actor,requestInitActor), [_uid]] call CFUNC(serverEvent);
_self set ["lastSave", time];
systemChat format ["Actor loaded for %1", name player];
systemChat format ["Loading actor for %1", name player];
diag_log "[FORGE:Client:Actor] Actor Repository Initialized!";
}],
["save", compileFinal {

View File

@ -4,8 +4,6 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
// private _category = [QUOTE(MOD_NAME), LLSTRING(displayName)];
[QGVAR(requestInitActor), {
params [["_uid", "", [""]]];

View File

@ -154,6 +154,8 @@ GVAR(ActorBaseStore) = compileFinal createHashMapFromArray [
if (_uid isEqualTo "") exitWith { createHashMap };
if (_initialize) then {
// Missing actors should be created explicitly from a server snapshot
// before the hot cache is initialized.
private _ensureResult = _self call ["ensurePersistentActor", [_uid]];
if !(_ensureResult isEqualType true && { _ensureResult }) exitWith { createHashMap };
};
@ -207,6 +209,8 @@ GVAR(ActorBaseStore) = compileFinal createHashMapFromArray [
createHashMap
};
// Hot actor reads can still surface older partial records. Repair them
// from the live player snapshot when possible and persist the result.
private _hydratedActor = GVAR(ActorModel) call ["migrate", [+_actor]];
private _defaults = GVAR(ActorModel) call ["defaults", []];
private _player = [_uid] call EFUNC(common,getPlayer);
@ -338,9 +342,6 @@ GVAR(ActorBaseStore) = compileFinal createHashMapFromArray [
params [["_uid", "", [""]], ["_field", "", [""]]];
private _actor = _self call ["loadHotActor", [_uid, false]];
if (_actor isEqualTo createHashMap) then {
_actor = _self call ["loadHotActor", [_uid, true]];
};
if (_field isEqualTo "") exitWith { _actor };
_actor getOrDefault [_field, nil]