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:
@@ -12,127 +12,12 @@ namespace Wizard.Battle.View
|
||||
{
|
||||
public partial class BattlePlayerView
|
||||
{
|
||||
public Vector3 firstHitPoint;
|
||||
public bool moveSeFirst;
|
||||
public bool isDetailRotating;
|
||||
public const int CLASS_EFFECT_DIALOG_DEPTH = 31;
|
||||
public bool _isEvolutionCardLanding;
|
||||
private int? _detailEffectSavedLayer;
|
||||
private const int KEY_WORD_START = 0;
|
||||
private const int KEY_WORD_END = 1;
|
||||
private const int KEY_WORD_DIALOG_LINE_OBJECT = 0;
|
||||
private const string KEY_WORD_PRESS_COLOR = "[00d2e4]";
|
||||
public const string KEY_WORD_COLOR = "[ffcd45]";
|
||||
protected string HandDeckObjectName { get; set; }
|
||||
protected string InPlayCardObjectName { get; set; }
|
||||
protected string CemeteryObjectName { get; set; }
|
||||
protected string BanishObjectName { get; set; }
|
||||
private ArrowControl ArrowCtrl { get; set; }
|
||||
private SoundMgr SoundMgr { get; set; }
|
||||
public BattleCardBase DetailOpenCard { get; set; }
|
||||
public BattleCardBase SubDetailOpenCard { get; set; }
|
||||
public GameObject CardMoveEffect { get; set; }
|
||||
public bool IsMenuOpen { get; set; }
|
||||
public bool IsMenuCloseEscape { get; set; }
|
||||
public bool CanPlayerEndTurnImmediately { get; set; }
|
||||
public bool IsShowTurnEndDialogOfNotAttackingOrPlaying { get; set; }
|
||||
public bool IsShowTurnEndDialogOfNotUsingHeroSkill { get; set; }
|
||||
public bool _isEvolutionSkillSelect { get; set; }
|
||||
public IList<BattleDialog> GetPopupPanelList { get; set; }
|
||||
public bool IsEvolutionStart { get; set; }
|
||||
public bool IsEvolutionVfx { get; set; }
|
||||
public PlayerChoiceBraveButtonUI PlayerChoiceBraveButtonUI { get; set; }
|
||||
public Transform ChoiceBraveButtonTransform { get; set; }
|
||||
public bool IsShowCantChoiceBraveText { get; set; }
|
||||
public BattlePlayerView(BattlePlayer battlePlayer) { }
|
||||
public void Setup(GameObject statusPanel, GameObject uiContainer, GameObject btlContainer, GameObject battle3DContainer) { }
|
||||
public void ClearPlayQueue() { }
|
||||
public void ShowCommonPanel() { }
|
||||
public void RegisterPlayCard(BattleCardBase actCard) { }
|
||||
public void DisableSettingFlag() { }
|
||||
public SideLogControl GetSideLogControl(bool isSkillTargetSelect) => default!;
|
||||
public VfxBase StartShowChoice(BattleCardBase actCard, SkillBase choiceSkill, List<BattleCardBase> choiceCards, bool isEvol, BattleCardBase accelerateCard, bool isChoiceBrave) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance();
|
||||
public VfxBase StartShowSelect(BattleCardBase actCard, SkillBase skill, IEnumerable<BattleCardBase> selectableCards, bool isEvol) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance();
|
||||
public VfxBase UpdateHandsSelectState(bool isSelecting) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance();
|
||||
public void GetCardSelectedWithButton(Camera camera, ref UIButton button, ref BattleCardBase card, ref GameObject check) { }
|
||||
public void ClearDifferentiatePopUp(List<BattleDialogItem> deselectionItem) { }
|
||||
public void LockOnAttackTarget(BattleCardBase Attacker, BattleCardBase Target) { }
|
||||
public void ReleaseLockOnTarget() { }
|
||||
public void ReverseDetailCard() { }
|
||||
public void DetailReverseOver() { }
|
||||
public void ShowDetailPanel(BattleManagerBase battleMgrBase, OperateMgr operateMgr, BattleCardBase card, DetailPanelControl.ShowRequest showRequest, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, BuffInfo buff = null, string divergenceId = "", int logTextureId = 0) { }
|
||||
private void ShowDetailCommon(BattleManagerBase battleMgrBase, OperateMgr operateMgr, List<BattleCardBase> cards, DetailPanelControl.ShowRequest showRequest, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, BuffInfo buff = null, string divergenceId = "", int logTextureId = 0) { }
|
||||
public void ShowDetailPanelList(BattleManagerBase battleMgrBase, OperateMgr operateMgr, List<BattleCardBase> cards, DetailPanelControl.ShowRequest showRequest) { }
|
||||
public void CallOnOpenEvolveDialoguePanel() { }
|
||||
public static bool HasKeyword(CardParameter cardParameter) => default!;
|
||||
public void HideDetailPanel() { }
|
||||
public void HideSubDetailPanel() { }
|
||||
public BattleCardBase GetDetailCard() => default!;
|
||||
private void OpenCardDetailList(BattleManagerBase battleMgrBase, OperateMgr operateMgr, List<BattleCardBase> cards, DetailPanelControl.ShowRequest showRequest, BuffInfo buff, BattleLogItem.CardTextureOption textureOption = BattleLogItem.CardTextureOption.Null, string divergenceId = "", int logTextureId = 0, bool useSubDetailPanelControl = false) { }
|
||||
public void SetDetailScreenPosition(bool right) { }
|
||||
public void DragArrowStart(BattleManagerBase battleMgr, BattleCardBase attackCard, GameObject arrowHead) { }
|
||||
public void DragArrowStart(BattleManagerBase battleMgr, GameObject startObject, GameObject arrowHead, bool isTargettingEnemy = true) { }
|
||||
public void DragArrow(BattleManagerBase battleMgr, GameObject arrowHead, Vector3 pos) { }
|
||||
public void MoveCardStart(BattleCardBase moveCard, bool isEffectAndSoundOn) { }
|
||||
public void MoveCard(BattleCardBase hitCard, Vector3 pos) { }
|
||||
public void MoveCardCancel(BattleCardBase hitCard, Vector3 position, Quaternion rotation, bool IsPress) { }
|
||||
public void CancelCardDrag(BattleCardBase cardBeingDragged) { }
|
||||
public void CardMoveEffectSwitch(bool on) { }
|
||||
public void HideModeEffect(bool on) { }
|
||||
public bool IsMoving() => default!;
|
||||
public void OffNotHideAndNotCreate() { }
|
||||
public void LockOnEffectOn(BattleCardBase SelectCard) { }
|
||||
public Effect DetailPanelSelectEffectOn(BattleCardBase selectedCard, DetailPanelControl.ShowRequest request) => default!;
|
||||
public void StopBattleLogSelectDetailPanelEffect() { }
|
||||
public void DetailPanelSelectEffectOff() { }
|
||||
public bool isDetailAble(BattleCardBase card, DetailPanelControl.ShowRequest showRequest) => default!;
|
||||
public bool IsDetailOn() => default!;
|
||||
public bool IsFieldDetailOn() => default!;
|
||||
public void ShowTurnEndDialog(GameObject return_obj = null) { }
|
||||
public void ShowPlayerTurnEnd(bool isAuto = false) { }
|
||||
public virtual void ShowTurnEndPulseEffect() { }
|
||||
public virtual VfxBase HideTurnEndPulseEffect() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance();
|
||||
public virtual void ShowTurnEndButton(bool showEffect = true) { }
|
||||
public void ForceShowTurnEndButton() { }
|
||||
public void UpdateTurnEndPulseEffect() { }
|
||||
public void ShowKeyPanel(int page) { }
|
||||
public void HideKeyPanel() { }
|
||||
public DialogBase CreateKeyPanel(BattleCardBase card, UILabel label, CardMaster.CardMasterId cardMasterId, CardParameter baseParameter) => default!;
|
||||
public static DialogBase CreateKeyPanel(UILabel label, IList<string> keywordList, CardMaster.CardMasterId cardMasterId) => default!;
|
||||
public static DialogBase CreateKeyPanel(string skillDescription, UILabel label, CardMaster.CardMasterId cardMasterId) => default!;
|
||||
public static DialogBase CreateClassEffectPanel(List<string> keyWordList, CardMaster.CardMasterId cardMasterId) => default!;
|
||||
private static DialogBase CreateKeywordsPanel_Inner(string titleTextID, Action<BattleKeywordInfoListMgr> funcSetup, UILabel label = null) => default!;
|
||||
private static void SetKeyWordView(UILabel label, BattleKeywordInfoListMgr keywordInfo, out string keywordText, out int startIndex, out int endIndex) { keywordText = default!; startIndex = default!; endIndex = default!; }
|
||||
private static List<int[]> GetKeyWordIndexList(string inText) => default!;
|
||||
public static List<string> GetKeyWordList(string inText) => default!;
|
||||
private static void ChangeKeyWordNewLineToSpace(ref string keyWordText) { }
|
||||
public static bool IsKeyWordUnderLine() => default!;
|
||||
public static void SetKeyWordColor(GameObject colliderObject, UILabel label, DetailPanelControl control = null) { }
|
||||
public static void SetLabelColorEvent(UILabel label, GameObject inClickObject = null) { }
|
||||
public static void PressKeyWordColorChange(UILabel label, bool press) { }
|
||||
public static void SetKeyWordLabelColor(UILabel label, string colorCode = "[ffcd45]") { }
|
||||
public DialogBase ShowRetireConfirmPanel() => default!;
|
||||
public DialogBase CreateBattleSetting() => default!;
|
||||
public bool IsTouchable() => default!;
|
||||
public void SetTouchable(bool enable) { }
|
||||
public void ResetTouchable() { }
|
||||
public void AddPopUpPanel(DialogBase dia, BattleDialogItem diaItem) { }
|
||||
public void AddPopUpPanel(NonDialogPopup popup, BattleDialogItem item) { }
|
||||
public VfxBase Recovery(bool doseFirst, bool isFocusHand = true) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance();
|
||||
public VfxBase HideCardAttackEffects(IList<BattleCardBase> _targetCards) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance();
|
||||
public VfxBase RecoveryInHandCards() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance();
|
||||
public VfxBase RecoveryMulligan() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance();
|
||||
public VfxBase RecoveryTurnStart() => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance();
|
||||
protected HandViewBase CreateHandView(GameObject gameObject) => default!;
|
||||
protected PlayQueueViewBase CreatePlayQueueView() => default!;
|
||||
protected InPlayViewBase CreateInPlayView(GameObject gameObject) => default!;
|
||||
public DialogBase ShowFusionCardPlayDialog(EventDelegate onClickOk, Action onClose) => default!;
|
||||
public void ShowChoiceBraveButton(bool isNewReplay) { }
|
||||
public void UpdateChoiceBraveActivatingEffect(bool isActivating) { }
|
||||
public void HideChoiceBraveButton() { }
|
||||
public void UpdateChoiceBraveButtonPulsateEffectAndSprite() { }
|
||||
public void HideChoiceBraveButtonPulsateEffect() { }
|
||||
public VfxBase SetBp(int num) => global::Wizard.Battle.View.Vfx.NullVfx.GetInstance();
|
||||
public Vector3 GetBPLabelPosition() => default!;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user