engine cleanup passes 4-7 + multi-instancing ambient rip
Squashes 146 commits from battle-engine-extraction. Net: 2,045 files changed, +11,896 / -158,687 lines. Ships engine passes 4-7 (dead-code cull, view-layer stub, receive-path shrink) plus the Phase-5 AsyncLocal ambient deletion that turns concurrent battles into a type-system property rather than a scope contract. ## What landed **Passes 4-7 (chunks 1-34):** Extended the Phase-4 const-false collapse into a cascading cull across the skill graph, view layer, and receive-path periphery. Six mode flags (IsWatchBattle/IsReplayBattle/IsAdmin/IsAdminWatch/IsPuzzleQuest/ IsAINetwork) became `const false`, every guarded block deleted. Field*.cs subclass ctors + BackGroundBase + ObjectChecker culled to no-ops. Mulligan family reworked to take a mgr param through IMulliganMgr.InitMulligan. Emotion/Recovery/Resource clusters null-stubbed. Prediction/OperationSimulator/ skill filters converted from static ambient reads to per-mgr reads via SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr / ins.BattleMgr / this.BattleMgr. **Phase-5 ambient rip (chunks 35-47):** Deleted BattleAmbient / BattleAmbient- Context / TestBattleScope in full. Every per-battle mutable slot now lives on the mgr instance itself: mgr.InstanceIsForecast / InstanceIsRandomDraw / InstanceRecoveryInfo / InstanceViewerId / InstanceNetworkAgent / GameMgr BattleManagerBase.GetIns() returns null unconditionally; the residual static flags + 3 façades (Certification.ViewerId, Data.BattleRecoveryInfo, ToolboxGame.RealTimeNetworkAgent) are null-tolerant defaults kept for the handful of engine-internal readers that still reference their types. Zero BattleAmbient references anywhere in engine + node + tests. Added pre-seeded GameMgr ctor overload threaded through the mgr chain (BattleManagerBase → SingleBattleMgr / NetworkBattleManagerBase → NetworkStandard- BattleMgr → HeadlessBattleMgr / HeadlessNetworkBattleMgr). Fixtures build a GameMgr, seed it via HeadlessEngineEnv.SeedCharaIds/SeedNetUser, and pass it to the mgr's ctor — no ambient reach. Node side (SVSim.BattleNode/SessionBattleEngine): _ctx replaced with a plain GameMgr field; 34 `using var _ambient = BattleAmbient.Enter(_ctx)` scope wraps ripped from every accessor and mutator; EngineGlobalInit.WirePerSessionGameMgr takes GameMgr as a param and runs from SessionBattleEngine.SetupInternal BEFORE mgr construction. Test side: TestBattleScope deleted; 18 fixture [SetUp]s migrated to `HeadlessEngineEnv.EnsureProcessGlobals()`; MultiInstanceEngineTests rewritten around per-mgr construction (GetIns() → null is the pinned invariant). ## Regression fixes - **chunk-48** (MulliganCtrl): chunk-35's `= null` stubs on card lookups broke the live receive-driven Deal path (BattlePlayerBase.DrawCard NRE'd downstream of NetworkPlayerMulliganCtrl.StartMulliganVfx). Restored the three lookups via `_battlePlayer.BattleMgr.GetBattleCardIdx`. Engine tests were satisfied by the WireMulliganPhase seam; unit tests exposed the live-path gap. ## Ship state - SVSim.BattleEngine.Tests: 56/56 pass, 2 skip - SVSim.UnitTests: 1554/1554 pass (was 1523/31-fail before chunk 48) - Solution build: 0 source warnings (40 pre-existing NU1902 MessagePack CVEs in SVSim.EmulatedEntrypoint, unrelated) - Sequential PVP smoke: verified live (two back-to-back battles, no regression on cleanup/spinup) - Concurrent PVP smoke: verified live Adds tools/engine-port/ClosureAnalyzer/ — the Roslyn transitive-type-closure analyzer needed to make future cascade cleanup safe (per feedback memory "Engine cleanup needs closure tool" from the 2026-06-28 pass-3 failure). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -6,194 +6,14 @@ public static class NativePluginWrapper
|
||||
{
|
||||
public enum BatteryState
|
||||
{
|
||||
UNKNOWN,
|
||||
DISCHARGING,
|
||||
CHARGING,
|
||||
FULL
|
||||
}
|
||||
}
|
||||
|
||||
public enum NetworkMode
|
||||
{
|
||||
UNCONNECTED,
|
||||
WIFI,
|
||||
MOBILE
|
||||
}
|
||||
|
||||
public static void DeviceInit()
|
||||
{
|
||||
}
|
||||
|
||||
public static int GetUseResidentMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetUseVirtualMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetDeviceFreeMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetVmUseMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetVmFreeMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetStringToClipboard(string copyText)
|
||||
{
|
||||
ClipboardHelper.Clipboard = copyText;
|
||||
}
|
||||
|
||||
public static int GetAccelerometerRotation()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static void RequestAudioFocus()
|
||||
{
|
||||
}
|
||||
|
||||
public static void AbandonAudioFocus()
|
||||
{
|
||||
}
|
||||
|
||||
public static string GetMacAddressByName(string devicename)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void DispStatusBar(bool isDisp)
|
||||
{
|
||||
if (isDisp)
|
||||
{
|
||||
Screen.fullScreen = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Screen.fullScreen = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void RegistPhoneStateListener()
|
||||
{
|
||||
}
|
||||
|
||||
public static void UnregistPhoneStateListener()
|
||||
{
|
||||
}
|
||||
|
||||
public static int GetBatteryLevel()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static BatteryState GetBatteryState()
|
||||
{
|
||||
return BatteryState.UNKNOWN;
|
||||
}
|
||||
|
||||
public static int GetWifiAntenaLevel()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static NetworkMode GetNetworkMode()
|
||||
{
|
||||
return NetworkMode.UNCONNECTED;
|
||||
}
|
||||
|
||||
public static bool IsAirplaneMode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetCdmaDbm()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCdmaEcio()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetEvdoDbm()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetEvdoEcio()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetDescriveContents()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static bool IsGsm()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetSignalHashCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetGsmSignalStrength()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetGsmBitErrorRate()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void ShowToast(string text)
|
||||
{
|
||||
}
|
||||
|
||||
public static void DumpWWWCache()
|
||||
{
|
||||
}
|
||||
|
||||
public static void SetCacheMemorySize(int nMemSize)
|
||||
{
|
||||
}
|
||||
|
||||
public static int GetCacheDiskUsage()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCacheDiskCapacity()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCacheCurrentMemoryUsage()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCacheCurrentMemoryCapacity()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void ClearWWWCache()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user