Hygiene B4d: PlayerResolve dedup + explicit Temp-ECB Dispose tail
- New Server/PlayerResolve.TryResolve single-sources the RPC SourceConnection -> NetworkId -> conn->player map resolve (3 sites: ClassSelectReceive, PrepPurchase, DebugCommandReceive); EntityManager reads keep it source-gen-safe from Bursted receivers. - ecb.Dispose() after Playback in 9 Temp-ECB systems (explicit-lifetime hygiene). - The TuningConfig.GetOrDefault(ref state) variant of this tail was REVERTED: state.GetEntityQuery in OnUpdate trips the Entities "creates a query during OnUpdate" diagnostic per system per world (caught in Play smoke) - the SystemAPI.TryGetSingleton idiom is already source-gen-optimal, confirming the original B4 deferral. Verified: 466/466 EditMode green on the final tree, console clean, Play smoke 0 errors. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -48,8 +48,7 @@ namespace ProjectM.Server
|
||||
if (!accept) continue;
|
||||
|
||||
var conn = receive.ValueRO.SourceConnection;
|
||||
if (!SystemAPI.HasComponent<NetworkId>(conn)
|
||||
|| !playerByConn.TryGetValue(SystemAPI.GetComponent<NetworkId>(conn).Value, out var player))
|
||||
if (!PlayerResolve.TryResolve(ref state, playerByConn, conn, out var player))
|
||||
continue;
|
||||
if (!SystemAPI.HasComponent<AbilityRef>(player)) continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user