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:
@@ -8,164 +8,20 @@ public class VideoHostingUtil : SingletonMonoBehaviour<VideoHostingUtil>
|
||||
public enum Option
|
||||
{
|
||||
EnemyNameDisplay,
|
||||
RecordPauseInMenu,
|
||||
UseRecordingFaceCamera,
|
||||
UseRecordingMicrophone,
|
||||
UsePublishingFaceCamera,
|
||||
UsePublishingMicrophone,
|
||||
NicoNicoNotificationAgreement,
|
||||
AutoPauseRecording,
|
||||
AutoPausePublishing,
|
||||
AutoStopRecording,
|
||||
IsPublishing,
|
||||
IsRecording,
|
||||
Max
|
||||
}
|
||||
|
||||
public enum HUDScene
|
||||
{
|
||||
Title = 0,
|
||||
Home = 1,
|
||||
Battle = 2,
|
||||
BattleResult = 3,
|
||||
RoomMatchRobby = 4,
|
||||
Default = 1
|
||||
}
|
||||
|
||||
private enum RecordingAutoStopStatus
|
||||
{
|
||||
Null,
|
||||
Active,
|
||||
Pause
|
||||
}
|
||||
|
||||
public const int FACECAMERAWINDOW_WIDTH_DEFAULT = 72;
|
||||
|
||||
public const int FACECAMERAWINDOW_HEIGHT_DEFAULT = 72;
|
||||
|
||||
public const float FACECAMERAWINDOW_WIDTH_MIN = 72f;
|
||||
|
||||
public const float FACECAMERAWINDOW_WIDTH_MAX = 400f;
|
||||
|
||||
public const float FACECAMERAWINDOW_HEIGHT_MIN = 72f;
|
||||
|
||||
public const float FACECAMERAWINDOW_HEIGHT_MAX = 400f;
|
||||
|
||||
private const int TAGRECORDING_EDITABLE_CAPACITY = 2;
|
||||
|
||||
private const int TAGRECORDING_UNEDITABLE_CAPACITY = 2;
|
||||
|
||||
private const int TAGPUBLISHING_UNEDITABLE_CAPACITY = 3;
|
||||
|
||||
public const int VIDEOHOSTING_DIALOG_OVERLAY_DEPTH = 5000;
|
||||
|
||||
public const int VIDEOHOSTING_DIALOG_OVERLAY_DEPTH_AUTOSTOP = 5010;
|
||||
|
||||
private const int NICONICODIALOG_BUTTON_NICONICO = 0;
|
||||
|
||||
private const int NICONICODIALOG_BUTTON_NICONAMA = 1;
|
||||
|
||||
private const int NICONICODIALOG_BUTTON_AGREE = 2;
|
||||
|
||||
private const int NICONICODIALOG_LABEL_NICONICO = 0;
|
||||
|
||||
private const int NICONICODIALOG_LABEL_NICONAMA = 1;
|
||||
|
||||
private const int NICONICODIALOG_LABEL_AGREE = 2;
|
||||
|
||||
private const int NICONICODIALOG_LABEL_DIALOGBODY = 3;
|
||||
|
||||
private const int NICONICODIALOG_TOGGLE_AGREE = 0;
|
||||
|
||||
public const int VIDEOHOSTING_OPTION_DEFAULT = 1;
|
||||
|
||||
private const int ERROR_DIALOG_DEPTH_OFFSET = 5;
|
||||
|
||||
private const int ERROR_DIALOG_MAX = 100;
|
||||
|
||||
private const float DELAY_UPLOAD_SEC = 0.3f;
|
||||
|
||||
private const float DELAY_UPLOAD_RETURN_MUTE_SEC = 1f;
|
||||
|
||||
private const float RECORD_AUTOSTOP_SEC_BUFFER = 10f;
|
||||
|
||||
private const float RECORD_AUTOSTOP_SEC = 1510f;
|
||||
|
||||
private bool _isRecordModeEnable;
|
||||
|
||||
private bool _isPublishModeEnable;
|
||||
|
||||
private HUDScene _HUDScene = HUDScene.Home;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _niconicoNotifcation;
|
||||
|
||||
private double _autoStopTimer;
|
||||
|
||||
private RecordingAutoStopStatus _autoStopStatus;
|
||||
|
||||
public static int GetFaceCameraWindowXDefault()
|
||||
{
|
||||
UIManager uIManager = UIManager.GetInstance();
|
||||
if (null == uIManager)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (null == uIManager.getCamera() || null == uIManager.GetVideoHostingHUD())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return (int)uIManager.getCamera().WorldToScreenPoint(uIManager.GetVideoHostingHUD().GetFaceCameraWindowLocator().position).x;
|
||||
}
|
||||
|
||||
public static int GetFaceCameraWindowYDefault()
|
||||
{
|
||||
UIManager uIManager = UIManager.GetInstance();
|
||||
if (null == uIManager)
|
||||
{
|
||||
return Screen.height;
|
||||
}
|
||||
if (null == uIManager.getCamera() || null == uIManager.GetVideoHostingHUD())
|
||||
{
|
||||
return Screen.height;
|
||||
}
|
||||
return (int)uIManager.getCamera().WorldToScreenPoint(uIManager.GetVideoHostingHUD().GetFaceCameraWindowLocator().position).y;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
_UpdateRecordingAutoStopTimer();
|
||||
}
|
||||
|
||||
public static bool GetRecordModeEnable()
|
||||
{
|
||||
return SingletonMonoBehaviour<VideoHostingUtil>.instance._isRecordModeEnable;
|
||||
}
|
||||
|
||||
public static void SetRecordModeEnable(bool isEnable)
|
||||
{
|
||||
SingletonMonoBehaviour<VideoHostingUtil>.instance._isRecordModeEnable = isEnable;
|
||||
}
|
||||
|
||||
public static bool GetPublishModeEnable()
|
||||
{
|
||||
return SingletonMonoBehaviour<VideoHostingUtil>.instance._isPublishModeEnable;
|
||||
}
|
||||
|
||||
public static void SetPublishModeEnable(bool isEnable)
|
||||
{
|
||||
SingletonMonoBehaviour<VideoHostingUtil>.instance._isPublishModeEnable = isEnable;
|
||||
}
|
||||
|
||||
public static bool GetOptionFlagFromPlayerPrefs(Option option)
|
||||
{
|
||||
if (option < Option.EnemyNameDisplay || option >= Option.Max)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.VIDEOHOSTING_FLAGS);
|
||||
return (value & (1 << (int)option)) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetOptionFlagFromPlayerPrefs(Option option, bool enable)
|
||||
{
|
||||
@@ -177,51 +33,6 @@ public class VideoHostingUtil : SingletonMonoBehaviour<VideoHostingUtil>
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetVideoHostingVersion()
|
||||
{
|
||||
return PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.VIDEOHOSTING_VERSION);
|
||||
}
|
||||
|
||||
public static void SetVideoHostingVersion(string version)
|
||||
{
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.VIDEOHOSTING_VERSION, version);
|
||||
}
|
||||
|
||||
public static void CreateVideoHostingSetting()
|
||||
{
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording() || SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublising())
|
||||
{
|
||||
CreateDialogInvalidOperation();
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.GetInstance().CreateVideoHostingSettingRoot().SetTitleLabel(GetVideoHostingSettingTitle());
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreateNicoNicoNotification()
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetTitleLabel(systemText.Get("VideoHosting_0037"));
|
||||
dialogBase.SetButtonText(systemText.Get("Common_0004"), systemText.Get("Common_0005"));
|
||||
GameObject gameObject = UnityEngine.Object.Instantiate(SingletonMonoBehaviour<VideoHostingUtil>.instance._niconicoNotifcation);
|
||||
dialogBase.SetObj(gameObject);
|
||||
gameObject.GetComponent<VideoHostingNicoNicoNotification>().SetParent(dialogBase);
|
||||
}
|
||||
|
||||
public static string GetVideoHostingSettingTitle()
|
||||
{
|
||||
return Data.SystemText.Get("VideoHosting_0001");
|
||||
}
|
||||
|
||||
public static void CheckVideoHostingAndShowAchievement(Action cbAchievement)
|
||||
{
|
||||
cbAchievement();
|
||||
}
|
||||
|
||||
public static void CheckVideoHostingAndExecAction(Action cbClose)
|
||||
{
|
||||
bool flag = SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublising() && !SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublishingPause();
|
||||
@@ -251,190 +62,6 @@ public class VideoHostingUtil : SingletonMonoBehaviour<VideoHostingUtil>
|
||||
}
|
||||
}
|
||||
|
||||
private static void _OverrideSoundMute()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().AllMute(isMute: true);
|
||||
}
|
||||
|
||||
private static void _ReturnSoundMute()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().AllMute(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE));
|
||||
}
|
||||
|
||||
public static void UploadRecordingAndSoundMute()
|
||||
{
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.HasRecordedData() && !SingletonMonoBehaviour<VideoHostingManager>.instance.IsUploading())
|
||||
{
|
||||
_OverrideSoundMute();
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.UploadRecording();
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateDialogNotHasRecordedData();
|
||||
}
|
||||
}
|
||||
|
||||
private static void _DelayUpload()
|
||||
{
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
UploadRecordingAndSoundMute();
|
||||
}
|
||||
|
||||
public static void CheckAndCreateHUD(HUDScene scene)
|
||||
{
|
||||
if (GetRecordModeEnable())
|
||||
{
|
||||
UIManager.GetInstance().CreateVideoHostingHUD(VideoHostingHUD.HUDMode.Recording);
|
||||
SetHUDScene(scene);
|
||||
}
|
||||
else if (GetPublishModeEnable())
|
||||
{
|
||||
UIManager.GetInstance().CreateVideoHostingHUD(VideoHostingHUD.HUDMode.Publishing);
|
||||
SetHUDScene(scene);
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.GetInstance().DestroyVideoHostingHUD();
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetHUDScene(HUDScene scene)
|
||||
{
|
||||
VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD();
|
||||
if (null == videoHostingHUD)
|
||||
{
|
||||
return;
|
||||
}
|
||||
bool pushEnablePlay = false;
|
||||
bool pushEnableSetting = false;
|
||||
int controlButtonLayer = VideoHostingHUD.CONTROLBUTTON_LAYER_DEFAULT;
|
||||
switch (scene)
|
||||
{
|
||||
case HUDScene.Home:
|
||||
if (GetRecordModeEnable())
|
||||
{
|
||||
pushEnablePlay = true;
|
||||
pushEnableSetting = true;
|
||||
}
|
||||
else if (GetPublishModeEnable())
|
||||
{
|
||||
pushEnablePlay = true;
|
||||
pushEnableSetting = true;
|
||||
}
|
||||
break;
|
||||
case HUDScene.Battle:
|
||||
if (GetRecordModeEnable())
|
||||
{
|
||||
pushEnablePlay = true;
|
||||
pushEnableSetting = true;
|
||||
}
|
||||
else if (GetPublishModeEnable())
|
||||
{
|
||||
pushEnablePlay = false;
|
||||
pushEnableSetting = true;
|
||||
}
|
||||
controlButtonLayer = VideoHostingHUD.CONTROLBUTTON_LAYER_BATTLE;
|
||||
break;
|
||||
case HUDScene.BattleResult:
|
||||
if (GetRecordModeEnable())
|
||||
{
|
||||
pushEnablePlay = true;
|
||||
pushEnableSetting = true;
|
||||
}
|
||||
else if (GetPublishModeEnable())
|
||||
{
|
||||
pushEnablePlay = false;
|
||||
pushEnableSetting = true;
|
||||
}
|
||||
break;
|
||||
case HUDScene.RoomMatchRobby:
|
||||
if (GetRecordModeEnable())
|
||||
{
|
||||
pushEnablePlay = true;
|
||||
pushEnableSetting = true;
|
||||
}
|
||||
else if (GetPublishModeEnable())
|
||||
{
|
||||
pushEnablePlay = false;
|
||||
pushEnableSetting = true;
|
||||
}
|
||||
break;
|
||||
case HUDScene.Title:
|
||||
if (GetRecordModeEnable())
|
||||
{
|
||||
pushEnablePlay = false;
|
||||
pushEnableSetting = false;
|
||||
}
|
||||
else if (GetPublishModeEnable())
|
||||
{
|
||||
pushEnablePlay = false;
|
||||
pushEnableSetting = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
SingletonMonoBehaviour<VideoHostingUtil>.instance._HUDScene = scene;
|
||||
videoHostingHUD.SetPushEnablePlay(pushEnablePlay);
|
||||
videoHostingHUD.SetPushEnableSetting(pushEnableSetting);
|
||||
videoHostingHUD.SetControlButtonLayer(controlButtonLayer);
|
||||
}
|
||||
|
||||
public static HUDScene GetHUDScene()
|
||||
{
|
||||
return SingletonMonoBehaviour<VideoHostingUtil>.instance._HUDScene;
|
||||
}
|
||||
|
||||
public static bool CheckHUDSceneUploadEnable(HUDScene scene)
|
||||
{
|
||||
if (scene == HUDScene.Battle || scene == HUDScene.BattleResult || scene == HUDScene.RoomMatchRobby)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void FaceCameraAdjustSwitch()
|
||||
{
|
||||
VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD();
|
||||
if (!(null == videoHostingHUD))
|
||||
{
|
||||
if (GetPublishModeEnable() && SingletonMonoBehaviour<VideoHostingManager>.instance.GetPublishingFaceCameraEnable())
|
||||
{
|
||||
videoHostingHUD.InitFaceCameraAdjust();
|
||||
videoHostingHUD.SetFaceCameraAdjustSwitchEnable(isEnable: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
videoHostingHUD.SetFaceCameraAdjustSwitchEnable(isEnable: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerator _InitHUDForPublishing()
|
||||
{
|
||||
VideoHostingHUD vhHUD = UIManager.GetInstance().GetVideoHostingHUD();
|
||||
while (!vhHUD.GetInitialized())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
UIManager.GetInstance().GetVideoHostingHUD().OnStartPublishing();
|
||||
FaceCameraAdjustSwitch();
|
||||
}
|
||||
|
||||
public static bool IsAutoPauseRecording()
|
||||
{
|
||||
return GetOptionFlagFromPlayerPrefs(Option.AutoPauseRecording);
|
||||
}
|
||||
|
||||
public static bool IsAutoStopRecording()
|
||||
{
|
||||
return GetOptionFlagFromPlayerPrefs(Option.AutoStopRecording);
|
||||
}
|
||||
|
||||
public static bool IsAutoPausePublishing()
|
||||
{
|
||||
return GetOptionFlagFromPlayerPrefs(Option.AutoPausePublishing);
|
||||
}
|
||||
|
||||
public static void AutoPausePublishing(bool isSave)
|
||||
{
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublising() && !SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublishingPause())
|
||||
@@ -447,18 +74,6 @@ public class VideoHostingUtil : SingletonMonoBehaviour<VideoHostingUtil>
|
||||
}
|
||||
}
|
||||
|
||||
public static void AutoPauseRecording(bool isSave)
|
||||
{
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording() && !SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecordingPause())
|
||||
{
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.PauseRecording();
|
||||
if (isSave)
|
||||
{
|
||||
SetOptionFlagFromPlayerPrefs(Option.AutoPauseRecording, enable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void AutoStopRecording(bool isSave)
|
||||
{
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording())
|
||||
@@ -471,159 +86,6 @@ public class VideoHostingUtil : SingletonMonoBehaviour<VideoHostingUtil>
|
||||
}
|
||||
}
|
||||
|
||||
public static void AutoResumePublishing()
|
||||
{
|
||||
if (IsAutoPausePublishing())
|
||||
{
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublishingPause())
|
||||
{
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.ResumePublishing();
|
||||
}
|
||||
SetOptionFlagFromPlayerPrefs(Option.AutoPausePublishing, enable: false);
|
||||
}
|
||||
}
|
||||
|
||||
public static void AutoResumeRecording()
|
||||
{
|
||||
if (IsAutoPauseRecording())
|
||||
{
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecordingPause())
|
||||
{
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.ResumeRecording();
|
||||
}
|
||||
SetOptionFlagFromPlayerPrefs(Option.AutoPauseRecording, enable: false);
|
||||
}
|
||||
}
|
||||
|
||||
private void _UpdateRecordingAutoStopTimer()
|
||||
{
|
||||
if (RecordingAutoStopStatus.Active != _autoStopStatus)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_autoStopTimer -= Time.deltaTime;
|
||||
if (_autoStopTimer < 0.0)
|
||||
{
|
||||
VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD();
|
||||
if (null != videoHostingHUD)
|
||||
{
|
||||
videoHostingHUD.CloseSettingMenuDialog();
|
||||
}
|
||||
CreateDialogStopRecording(CheckHUDSceneUploadEnable(GetHUDScene()), isTimeOut: true);
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.StopRecording();
|
||||
_StopRecordingAutoStopTimer();
|
||||
}
|
||||
}
|
||||
|
||||
private void _StartRecordingAutoStopTimer(float sec)
|
||||
{
|
||||
_StopRecordingAutoStopTimer();
|
||||
_autoStopStatus = RecordingAutoStopStatus.Active;
|
||||
_autoStopTimer = sec;
|
||||
}
|
||||
|
||||
private void _StopRecordingAutoStopTimer()
|
||||
{
|
||||
_autoStopStatus = RecordingAutoStopStatus.Null;
|
||||
_autoStopTimer = 0.0;
|
||||
}
|
||||
|
||||
private void _PauseRecordingAutoStopTimer()
|
||||
{
|
||||
if (RecordingAutoStopStatus.Active == _autoStopStatus)
|
||||
{
|
||||
_autoStopStatus = RecordingAutoStopStatus.Pause;
|
||||
}
|
||||
}
|
||||
|
||||
private void _ResumeRecordingAutoStopTimer()
|
||||
{
|
||||
if (RecordingAutoStopStatus.Pause == _autoStopStatus)
|
||||
{
|
||||
_autoStopStatus = RecordingAutoStopStatus.Active;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetUserNameHidden(string userName)
|
||||
{
|
||||
if ((GetRecordModeEnable() || GetPublishModeEnable()) && !GetOptionFlagFromPlayerPrefs(Option.EnemyNameDisplay))
|
||||
{
|
||||
userName = Data.SystemText.Get("VideoHosting_0046");
|
||||
}
|
||||
return userName;
|
||||
}
|
||||
|
||||
public static string GetUserIDHidden(string userID)
|
||||
{
|
||||
if (GetRecordModeEnable() || GetPublishModeEnable())
|
||||
{
|
||||
userID = Data.SystemText.Get("VideoHosting_0081");
|
||||
}
|
||||
return userID;
|
||||
}
|
||||
|
||||
public static void OnStartRecording()
|
||||
{
|
||||
VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD();
|
||||
if (null != videoHostingHUD)
|
||||
{
|
||||
videoHostingHUD.OnStartRecording();
|
||||
}
|
||||
SetOptionFlagFromPlayerPrefs(Option.IsRecording, enable: true);
|
||||
}
|
||||
|
||||
public static void OnFinishRecording()
|
||||
{
|
||||
VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD();
|
||||
if (null != videoHostingHUD)
|
||||
{
|
||||
videoHostingHUD.OnFinishRecording();
|
||||
}
|
||||
SetOptionFlagFromPlayerPrefs(Option.AutoPauseRecording, enable: false);
|
||||
SetOptionFlagFromPlayerPrefs(Option.IsRecording, enable: false);
|
||||
}
|
||||
|
||||
public static void OnPauseRecording()
|
||||
{
|
||||
VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD();
|
||||
if (null != videoHostingHUD)
|
||||
{
|
||||
videoHostingHUD.OnPauseRecording();
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnResumeRecording()
|
||||
{
|
||||
VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD();
|
||||
if (null != videoHostingHUD)
|
||||
{
|
||||
videoHostingHUD.OnResumeRecording();
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnStartUploadRecording()
|
||||
{
|
||||
}
|
||||
|
||||
public static void OnFinishUploadRecording(string strVideoId, string strUrl)
|
||||
{
|
||||
}
|
||||
|
||||
public static void OnCameraStartedSession()
|
||||
{
|
||||
FaceCameraAdjustSwitch();
|
||||
}
|
||||
|
||||
public static void OnCameraStoppedSession()
|
||||
{
|
||||
VideoHostingHUD videoHostingHUD = UIManager.GetInstance().GetVideoHostingHUD();
|
||||
if (null != videoHostingHUD)
|
||||
{
|
||||
videoHostingHUD.EndFaceCameraAdjust();
|
||||
videoHostingHUD.SetFaceCameraAdjustSwitchEnable(isEnable: false);
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnSoftwareReset()
|
||||
{
|
||||
AutoPausePublishing(isSave: true);
|
||||
@@ -631,160 +93,4 @@ public class VideoHostingUtil : SingletonMonoBehaviour<VideoHostingUtil>
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.SetRecordingFaceCameraMicrophoneStatus(isEnableCamera: false, isEnableMicrophone: false);
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.SetPublishingFaceCameraMicrophoneStatus(isEnableCamera: false, isEnableMicrophone: false);
|
||||
}
|
||||
|
||||
private static DialogBase _CreateVideoHostingDialogCommon(string strKeyTitle, string strKeyText)
|
||||
{
|
||||
return _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, strKeyTitle, strKeyText, "", "");
|
||||
}
|
||||
|
||||
private static DialogBase _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout layout, string strKeyTitle, string strKeyText, string strKeyButton1, string strKeyButton2)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.S);
|
||||
dialogBase.SetButtonLayout(layout);
|
||||
dialogBase.SetTitleLabel(systemText.Get(strKeyTitle));
|
||||
dialogBase.SetText(systemText.Get(strKeyText));
|
||||
if (!string.IsNullOrEmpty(strKeyButton1) && !string.IsNullOrEmpty(strKeyButton2))
|
||||
{
|
||||
dialogBase.SetButtonText(systemText.Get(strKeyButton1), systemText.Get(strKeyButton2));
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(strKeyButton1))
|
||||
{
|
||||
dialogBase.SetButtonText(systemText.Get(strKeyButton1));
|
||||
}
|
||||
dialogBase.SetPanelDepth(5000);
|
||||
return dialogBase;
|
||||
}
|
||||
|
||||
public static void CreateDialogNotHasRecordedData()
|
||||
{
|
||||
_CreateVideoHostingDialogCommon("Common_0021", "VideoHosting_0075");
|
||||
}
|
||||
|
||||
public static void CreateDialogStopRecording(bool isUseUploadButton, bool isTimeOut)
|
||||
{
|
||||
if (isUseUploadButton)
|
||||
{
|
||||
string strKeyText = (isTimeOut ? "VideoHosting_0049" : "VideoHosting_0051");
|
||||
string strKeyButton = "VideoHosting_0021";
|
||||
DialogBase dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.BlueBtn_CancelBtn, "Common_0021", strKeyText, "Common_0004", strKeyButton);
|
||||
dialogBase.onPushButton2 = (Action)Delegate.Combine(dialogBase.onPushButton2, (Action)delegate
|
||||
{
|
||||
SingletonMonoBehaviour<VideoHostingUtil>.instance.StartCoroutine(Timer.DelayMethod(0.3f, _DelayUpload));
|
||||
});
|
||||
dialogBase.SetPanelDepth(5010);
|
||||
}
|
||||
else
|
||||
{
|
||||
string strKeyText2 = (isTimeOut ? "VideoHosting_0024" : "VideoHosting_0050");
|
||||
_CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", strKeyText2, "Common_0004", "").SetPanelDepth(5010);
|
||||
}
|
||||
}
|
||||
|
||||
private static void _CreateDialogStopPublishing(bool isTimeOut)
|
||||
{
|
||||
string text = "";
|
||||
text = ((!isTimeOut) ? "VideoHosting_0040" : "VideoHosting_0039");
|
||||
_CreateVideoHostingDialogCommon("Common_0021", text);
|
||||
}
|
||||
|
||||
public static void CreateDialogNotSupported()
|
||||
{
|
||||
_CreateVideoHostingDialogCommon("Error_0001", "VideoHosting_0080");
|
||||
}
|
||||
|
||||
public static void CreateDialogInvalidOperation()
|
||||
{
|
||||
string strKeyText = "";
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublising())
|
||||
{
|
||||
strKeyText = "VideoHosting_0067";
|
||||
}
|
||||
else if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording())
|
||||
{
|
||||
strKeyText = "VideoHosting_0068";
|
||||
}
|
||||
_CreateVideoHostingDialogCommon("Common_0021", strKeyText);
|
||||
}
|
||||
|
||||
public static void CreateDialogPrivacyAccount()
|
||||
{
|
||||
string strKeyText = "";
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublising())
|
||||
{
|
||||
strKeyText = "VideoHosting_0057";
|
||||
}
|
||||
else if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording())
|
||||
{
|
||||
strKeyText = "VideoHosting_0056";
|
||||
}
|
||||
_CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", strKeyText, "Common_0004", "");
|
||||
}
|
||||
|
||||
public static void CreateDialogAchievementEnter()
|
||||
{
|
||||
string strKeyText = "";
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublising())
|
||||
{
|
||||
strKeyText = "VideoHosting_0072";
|
||||
}
|
||||
else if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording())
|
||||
{
|
||||
strKeyText = "VideoHosting_0068";
|
||||
}
|
||||
_CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", strKeyText, "Common_0004", "");
|
||||
}
|
||||
|
||||
public static void CreateDialogPrivacyBuyCrystalEnter(Action cbPushOK)
|
||||
{
|
||||
DialogBase dialogBase = null;
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsPublising())
|
||||
{
|
||||
string strKeyTitle = "VideoHosting_0078";
|
||||
string strKeyText = "VideoHosting_0054";
|
||||
string strKeyButton = "VideoHosting_0063";
|
||||
dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.BlueBtn_CancelBtn, strKeyTitle, strKeyText, strKeyButton, "");
|
||||
DialogBase dialogBase2 = dialogBase;
|
||||
dialogBase2.onPushButton1 = (Action)Delegate.Combine(dialogBase2.onPushButton1, (Action)delegate
|
||||
{
|
||||
AutoPausePublishing(isSave: true);
|
||||
});
|
||||
}
|
||||
else if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording())
|
||||
{
|
||||
string strKeyTitle2 = "VideoHosting_0079";
|
||||
string strKeyText2 = "VideoHosting_0052";
|
||||
string strKeyButton2 = "VideoHosting_0048";
|
||||
dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.BlueBtn_CancelBtn, strKeyTitle2, strKeyText2, strKeyButton2, "");
|
||||
DialogBase dialogBase3 = dialogBase;
|
||||
dialogBase3.onPushButton1 = (Action)Delegate.Combine(dialogBase3.onPushButton1, (Action)delegate
|
||||
{
|
||||
AutoStopRecording(isSave: false);
|
||||
});
|
||||
}
|
||||
if (!(null == dialogBase) && cbPushOK != null)
|
||||
{
|
||||
DialogBase dialogBase4 = dialogBase;
|
||||
dialogBase4.onPushButton1 = (Action)Delegate.Combine(dialogBase4.onPushButton1, cbPushOK);
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreateDialogPrivacyBuyCrystalExit()
|
||||
{
|
||||
DialogBase dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", "VideoHosting_0055", "Common_0004", "");
|
||||
dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, new Action(AutoResumePublishing));
|
||||
}
|
||||
|
||||
public static void CreateDialogPrivacyAutoStopRecordingTitle(Action cbPushOK)
|
||||
{
|
||||
DialogBase dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", "VideoHosting_0066", "Common_0004", "");
|
||||
dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, cbPushOK);
|
||||
}
|
||||
|
||||
public static void CreateDialogPrivacyAutoPausePublishingTitle(Action cbPushOK)
|
||||
{
|
||||
DialogBase dialogBase = _CreateVideoHostingDialogCommon(DialogBase.ButtonLayout.OkBtn, "Common_0021", "VideoHosting_0065", "Common_0004", "");
|
||||
dialogBase.OnClose = (Action)Delegate.Combine(dialogBase.OnClose, cbPushOK);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user