feat: MobSync#80
Open
Liparakis wants to merge 36 commits into
Open
Conversation
…ing host transfer
…, and resolve FSM variable race condition
…Ds for out-of-order and duplicate protection
…and fix FSM host promotion sequence
…s on EntityNetworkData updates
…ull for safe lookup
… fix warning comment format in ActionRegistry
…x-based for loops
…d reuse pooled data
…o prevent reference sharing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Meaningful Changes
Animation & Visual Hits (
DamageAnimationEffect.cs)Changed:
WillDamageEnemyOptionsDelegateandDamagedEnemyHealthManagerDelegate) to avoid repeated delegate allocations on hit processing paths.UnityEngine.SceneManagement.SceneManager.activeSceneChangedto clear the staticRemoteVisualHitHpBeforetracking dictionary between scenes.FixDamageEnemiesso remote attack replicas can trigger visual hit feedback while disabling lethal triggers, non-lethal side effects, and death events. The enemy HP is recorded before the remote hit and restored after the hit event completes.Why it matters:
Pause & Input Management (
PauseManager.cs)Changed:
MonoMod.RuntimeDetour.Hookinstances targetingUIManager.TogglePauseGame,HeroController.Pause,TransitionPoint.OnTriggerEnter2D, andHeroController.DieFromHazard.Time.timeScaleback to1fwhile multiplayer pause handling is active so world simulation can continue for other players.Why it matters:
Player-Player Collisions (
PlayerManager.cs)Changed:
CreateNewPlayerContainerby callingPhysics2D.IgnoreCollisionacross local and remote colliders.PlayerTargetRegistry.Why it matters:
FSM Performance & Garbage Collection (
Entity.cs,EntityFsmActions.cs)Changed:
CondAddDataandCondUpdateVars, with direct type-specific loops for floats, ints, bools, strings,Vector2, andVector3.MonoMod.RuntimeDetour.Hookfields.Dictionary<FsmStateAction, Queue<object>> RandomActionValueswithConditionalWeakTable<FsmStateAction, Queue<object>>.Why it matters:
FsmStateActioninstances to be collected once the action is no longer strongly referenced elsewhere.Registry Generalization & Silksong Port (
EntityRegistry.cs,EntityType.cs)Changed:
FsmNamesandparent_name.HashSet<string>cache (_fsmNameSet) for faster FSM name lookups in registry entry matching.Why it matters:
Component Updates & Centralization (
EntityComponent.csand Components)Changed:
MonoBehaviourUtil.Instance.OnUpdateEventwith a centralized update path whereEntity.OnUpdate()drivesEntityComponent.OnUpdate().sceneHostEpochintoInitializeHostandInitializeClientduring component setup.Why it matters:
Entity Update Lifetime & Buffer Lifecycles (
EntityManager.cs,ClientManager.cs)Changed:
_receivedUpdatesto_pendingUpdates.DrainPendingUpdates()and returns processed updates to the object pool withObjectPool<EntityUpdate>.Return.FindGameObject.OnEnterso FSM queries can locate entities that the system has deactivated.FindEntitiesInScenewith targeted component candidate gathering.Why it matters:
Health Synchronization (
HealthManagerComponent.cs)Changed:
_currentHealthEpochand_nextHealthUpdateId.EntityNetworkDataobjects used for HP and invincibility updates.0.4seconds to verify whether the increase is backed by host authority, rolling back unauthorized local increases when needed.Why it matters:
Packet Serialization (
IPacket.cs,Packet.cs,UpdatePacket.cs,EntityUpdate.cs,PlayerUpdate.cs)Changed:
ReadPacketView(length)to return a sub-packet view over an existing packet buffer without copying the byte array.Enum.GetNames(typeof(T))withEnumCache<T>.Countfor enum-size lookup.AckFieldarray inUpdatePacketwhen it already has the correct size.Why it matters:
Deferred / New Files
These files are intentionally listed separately because they are new or mostly self-contained. They should be reviewed after existing behavior changes.
SSMP/Game/Client/GamePatcher.EnemyTargeting.csSSMP/Game/Client/GamePatcher.PlayerDetection.csSSMP/Game/Client/PlayerTargetRegistry.csSSMP/Util/EnumCache.cs