private void OnGameLoadComplete() { if (!Singleton <BattleLogic> .get_instance().isRuning) { DebugHelper.Assert(false, "都没有在游戏局内,何来的游戏加载完成"); return; } if (Singleton <WatchController> .get_instance().workMode != WatchController.WorkMode.None) { DebugHelper.CustomLog("观战模式:{0}", new object[] { Singleton <WatchController> .get_instance().workMode.ToString() }); } try { this.gameInfo.PostBeginPlay(); } catch (Exception ex) { DebugHelper.Assert(false, "Exception In PostBeginPlay {0} {1}", new object[] { ex.get_Message(), ex.get_StackTrace() }); throw ex; } this.m_fLoadingTime = Time.time - this.m_fLoadingTime; if (MonoSingleton <Reconnection> .GetInstance().g_fBeginReconnectTime > 0f) { List <KeyValuePair <string, string> > list = new List <KeyValuePair <string, string> >(); list.Add(new KeyValuePair <string, string>("ReconnectTime", (Time.time - MonoSingleton <Reconnection> .GetInstance().g_fBeginReconnectTime).ToString())); MonoSingleton <Reconnection> .GetInstance().g_fBeginReconnectTime = -1f; Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_Reconnet_IntoGame", list, true); } }
private void HeroSelectReconectSwapStep(CSDT_RECONN_ADJUSTINFO swapInfo) { DebugHelper.CustomLog("HeroSelectReconectSwapStep"); Singleton <GameStateCtrl> .GetInstance().GotoState("LobbyState"); Singleton <CRoomSystem> .instance.SetRoomType(1); CSDT_CAMPINFO[] campInfo = new CSDT_CAMPINFO[swapInfo.astCampInfo.Length]; for (int i = 0; i < swapInfo.astCampInfo.Length; i++) { campInfo[i] = new CSDT_CAMPINFO(); campInfo[i].dwPlayerNum = swapInfo.astCampInfo[i].dwPlayerNum; campInfo[i].astCampPlayerInfo = new CSDT_CAMPPLAYERINFO[swapInfo.astCampInfo[i].astPlayerInfo.Length]; for (int k = 0; k < swapInfo.astCampInfo[i].astPlayerInfo.Length; k++) { campInfo[i].astCampPlayerInfo[k] = swapInfo.astCampInfo[i].astPlayerInfo[k].stPickHeroInfo; } } CHeroSelectBaseSystem.StartPvpHeroSelectSystem(swapInfo.stDeskInfo, campInfo, swapInfo.stFreeHero, swapInfo.stFreeHeroSymbol); Singleton <CHeroSelectBaseSystem> .instance.m_banPickStep = enBanPickStep.enSwap; for (int j = 0; j < swapInfo.astCampInfo.Length; j++) { for (int m = 0; m < swapInfo.astCampInfo[j].astPlayerInfo.Length; m++) { uint dwObjId = swapInfo.astCampInfo[j].astPlayerInfo[m].stPickHeroInfo.stPlayerInfo.dwObjId; byte bIsPickOK = swapInfo.astCampInfo[j].astPlayerInfo[m].bIsPickOK; MemberInfo memberInfo = Singleton <CHeroSelectBaseSystem> .instance.roomInfo.GetMemberInfo(dwObjId); if (memberInfo != null) { memberInfo.isPrepare = bIsPickOK == 1; } } } MemberInfo masterMemberInfo = Singleton <CRoomSystem> .instance.roomInfo.GetMasterMemberInfo(); if (masterMemberInfo != null) { Singleton <CHeroSelectBaseSystem> .instance.SetPvpHeroSelect(masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID); if (masterMemberInfo.isPrepare) { Singleton <CHeroSelectBaseSystem> .instance.m_isSelectConfirm = true; } } else { return; } if (Singleton <CHeroSelectBaseSystem> .instance.uiType == enUIType.enNormal) { Singleton <CHeroSelectNormalSystem> .GetInstance().m_showHeroID = masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID; if (Singleton <CHeroSelectBaseSystem> .instance.selectType == enSelectType.enRandom) { Singleton <CHeroSelectNormalSystem> .instance.SwitchSkinMenuSelect(); } Singleton <CHeroSelectNormalSystem> .instance.RefreshHeroPanel(false, true); Singleton <CHeroSelectNormalSystem> .instance.StartEndTimer((int)(swapInfo.dwLeftMs / 0x3e8)); } else if (Singleton <CHeroSelectBaseSystem> .instance.uiType == enUIType.enBanPick) { Singleton <CHeroSelectBaseSystem> .instance.ClearBanHero(); Singleton <CHeroSelectBaseSystem> .instance.AddBanHero(COM_PLAYERCAMP.COM_PLAYERCAMP_1, swapInfo.stHeroSwapInfo.stPickDetail.stHeroSwapInfo.Camp1BanList); Singleton <CHeroSelectBaseSystem> .instance.AddBanHero(COM_PLAYERCAMP.COM_PLAYERCAMP_2, swapInfo.stHeroSwapInfo.stPickDetail.stHeroSwapInfo.Camp2BanList); Singleton <CHeroSelectBaseSystem> .instance.m_swapInfo.dwActiveObjID = swapInfo.stHeroSwapInfo.stPickDetail.stHeroSwapInfo.dwActiveObjID; Singleton <CHeroSelectBaseSystem> .instance.m_swapInfo.dwPassiveObjID = swapInfo.stHeroSwapInfo.stPickDetail.stHeroSwapInfo.dwPassiveObjID; Singleton <CHeroSelectBaseSystem> .instance.m_swapInfo.iErrCode = 0; Singleton <CHeroSelectBaseSystem> .instance.m_banHeroTeamMaxCount = swapInfo.stHeroSwapInfo.stPickDetail.stHeroSwapInfo.bBanPosNum; if (masterMemberInfo.dwObjId == Singleton <CHeroSelectBaseSystem> .instance.m_swapInfo.dwActiveObjID) { Singleton <CHeroSelectBaseSystem> .instance.m_swapState = enSwapHeroState.enReqing; } else if (masterMemberInfo.dwObjId == Singleton <CHeroSelectBaseSystem> .instance.m_swapInfo.dwPassiveObjID) { Singleton <CHeroSelectBaseSystem> .instance.m_swapState = enSwapHeroState.enSwapAllow; } Singleton <CHeroSelectBanPickSystem> .instance.InitMenu(false); Singleton <CHeroSelectBanPickSystem> .instance.RefreshAll(); Singleton <CHeroSelectBanPickSystem> .instance.StartEndTimer((int)(swapInfo.dwLeftMs / 0x3e8)); Singleton <CSoundManager> .GetInstance().PostEvent("Set_BanPickEnd", null); } }
private void HeroSelectReconectPickStep(CSDT_RECONN_PICKINFO pickInfo) { DebugHelper.CustomLog("HeroSelectReconectPickStep"); Singleton <GameStateCtrl> .GetInstance().GotoState("LobbyState"); Singleton <CRoomSystem> .instance.SetRoomType(1); CSDT_CAMPINFO[] campInfo = new CSDT_CAMPINFO[pickInfo.astCampInfo.Length]; for (int i = 0; i < pickInfo.astCampInfo.Length; i++) { campInfo[i] = new CSDT_CAMPINFO(); campInfo[i].dwPlayerNum = pickInfo.astCampInfo[i].dwPlayerNum; campInfo[i].astCampPlayerInfo = new CSDT_CAMPPLAYERINFO[pickInfo.astCampInfo[i].astPlayerInfo.Length]; for (int k = 0; k < pickInfo.astCampInfo[i].astPlayerInfo.Length; k++) { campInfo[i].astCampPlayerInfo[k] = pickInfo.astCampInfo[i].astPlayerInfo[k].stPickHeroInfo; } } CHeroSelectBaseSystem.StartPvpHeroSelectSystem(pickInfo.stDeskInfo, campInfo, pickInfo.stFreeHero, pickInfo.stFreeHeroSymbol); Singleton <CHeroSelectBaseSystem> .instance.m_banPickStep = enBanPickStep.enPick; for (int j = 0; j < pickInfo.astCampInfo.Length; j++) { for (int m = 0; m < pickInfo.astCampInfo[j].astPlayerInfo.Length; m++) { uint dwObjId = pickInfo.astCampInfo[j].astPlayerInfo[m].stPickHeroInfo.stPlayerInfo.dwObjId; byte bIsPickOK = pickInfo.astCampInfo[j].astPlayerInfo[m].bIsPickOK; MemberInfo memberInfo = Singleton <CHeroSelectBaseSystem> .instance.roomInfo.GetMemberInfo(dwObjId); if (memberInfo != null) { memberInfo.isPrepare = bIsPickOK == 1; } } } MemberInfo masterMemberInfo = Singleton <CRoomSystem> .instance.roomInfo.GetMasterMemberInfo(); if (masterMemberInfo != null) { Singleton <CHeroSelectBaseSystem> .instance.SetPvpHeroSelect(masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID); if (masterMemberInfo.isPrepare) { Singleton <CHeroSelectBaseSystem> .instance.m_isSelectConfirm = true; } } else { return; } if (Singleton <CHeroSelectBaseSystem> .instance.uiType == enUIType.enNormal) { Singleton <CHeroSelectNormalSystem> .GetInstance().m_showHeroID = masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID; if (Singleton <CHeroSelectBaseSystem> .instance.selectType == enSelectType.enRandom) { Singleton <CHeroSelectNormalSystem> .instance.SwitchSkinMenuSelect(); } Singleton <CHeroSelectNormalSystem> .GetInstance().RefreshHeroPanel(false, true); } else if (Singleton <CHeroSelectBaseSystem> .instance.uiType == enUIType.enBanPick) { CSDT_RECONN_BAN_PICK_STATE_INFO stBanPickInfo = pickInfo.stPickStateExtra.stPickDetail.stBanPickInfo; Singleton <CHeroSelectBaseSystem> .instance.ClearBanHero(); if (stBanPickInfo != null) { Singleton <CHeroSelectBaseSystem> .instance.AddBanHero(COM_PLAYERCAMP.COM_PLAYERCAMP_1, stBanPickInfo.Camp1BanList); Singleton <CHeroSelectBaseSystem> .instance.AddBanHero(COM_PLAYERCAMP.COM_PLAYERCAMP_2, stBanPickInfo.Camp2BanList); Singleton <CHeroSelectBaseSystem> .instance.m_curBanPickInfo.stCurState = stBanPickInfo.stCurState; Singleton <CHeroSelectBaseSystem> .instance.m_curBanPickInfo.stNextState = stBanPickInfo.stNextState; Singleton <CHeroSelectBaseSystem> .instance.m_banHeroTeamMaxCount = stBanPickInfo.bBanPosNum; Singleton <CHeroSelectBanPickSystem> .instance.InitMenu(false); Singleton <CHeroSelectBanPickSystem> .instance.RefreshAll(); Singleton <CHeroSelectBanPickSystem> .instance.PlayStepTitleAnimation(); Singleton <CHeroSelectBanPickSystem> .instance.PlayCurrentBgAnimation(); MemberInfo info3 = Singleton <CHeroSelectBaseSystem> .instance.roomInfo.GetMemberInfo((COM_PLAYERCAMP)Singleton <CHeroSelectBaseSystem> .instance.m_curBanPickInfo.stCurState.bCamp, Singleton <CHeroSelectBaseSystem> .instance.m_curBanPickInfo.stCurState.bPos); if (info3 != null) { if (masterMemberInfo == info3) { Utility.VibrateHelper(); Singleton <CSoundManager> .GetInstance().PostEvent("UI_MyTurn", null); Singleton <CSoundManager> .GetInstance().PostEvent("Set_Segment2", null); } else { Singleton <CSoundManager> .GetInstance().PostEvent("Set_Segment1", null); } } } } }
private void OnApplicationPause(bool pauseStatus) { object[] inParameters = new object[] { pauseStatus }; DebugHelper.CustomLog("OnApplicationPause {0}", inParameters); }
private void Awake() { if (ms_Instance != null) { if (ms_Instance != this) { UnityEngine.Object.DestroyImmediate(base.gameObject); } } else { Debug.Log("WwiseUnity: Initialize sound engine ..."); DebugHelper.CustomLog("WwiseUnity: Initialize sound engine ..."); AkMemSettings settings = new AkMemSettings { uMaxNumPools = 40 }; AkDeviceSettings settings2 = new AkDeviceSettings(); AkSoundEngine.GetDefaultDeviceSettings(settings2); AkStreamMgrSettings settings3 = new AkStreamMgrSettings { uMemorySize = (uint)(this.streamingPoolSize * 0x400) }; AkInitSettings settings4 = new AkInitSettings(); AkSoundEngine.GetDefaultInitSettings(settings4); settings4.uDefaultPoolSize = (uint)(this.defaultPoolSize * 0x400); AkPlatformInitSettings settings5 = new AkPlatformInitSettings(); AkSoundEngine.GetDefaultPlatformInitSettings(settings5); settings5.uLEngineDefaultPoolSize = (uint)(this.lowerPoolSize * 0x400); settings5.fLEngineDefaultPoolRatioThreshold = this.memoryCutoffThreshold; AkMusicSettings settings6 = new AkMusicSettings(); AkSoundEngine.GetDefaultMusicSettings(settings6); if (AkSoundEngine.Init(settings, settings3, settings2, settings4, settings5, settings6) != AKRESULT.AK_Success) { Debug.LogError("WwiseUnity: Failed to initialize the sound engine. Abort."); } else { ms_Instance = this; AkBankPathUtil.UsePlatformSpecificPath(); string platformBasePath = AkBankPathUtil.GetPlatformBasePath(); if (!s_loadBankFromMemory) { } AkSoundEngine.SetBasePath(platformBasePath); AkSoundEngine.SetCurrentLanguage(this.language); if (AkCallbackManager.Init() != AKRESULT.AK_Success) { Debug.LogError("WwiseUnity: Failed to initialize Callback Manager. Terminate sound engine."); AkSoundEngine.Term(); ms_Instance = null; } else { AKRESULT akresult; uint num; Debug.Log("WwiseUnity: Sound engine initialized."); UnityEngine.Object.DontDestroyOnLoad(this); if (s_loadBankFromMemory) { string soundBankPathInResources = GetSoundBankPathInResources("Init.bytes"); CBinaryObject content = Singleton <CResourceManager> .GetInstance().GetResource(soundBankPathInResources, typeof(TextAsset), enResourceType.Sound, false, false).m_content as CBinaryObject; GCHandle handle = GCHandle.Alloc(content.m_data, GCHandleType.Pinned); IntPtr ptr = handle.AddrOfPinnedObject(); if (ptr != IntPtr.Zero) { akresult = AkSoundEngine.LoadBank(ptr, (uint)content.m_data.Length, -1, out num); handle.Free(); } else { akresult = AKRESULT.AK_Fail; } Singleton <CResourceManager> .GetInstance().RemoveCachedResource(soundBankPathInResources); } else { akresult = AkSoundEngine.LoadBank("Init.bnk", -1, out num); } if (akresult != AKRESULT.AK_Success) { Debug.LogError("WwiseUnity: Failed load Init.bnk with result: " + akresult.ToString()); } } } } }
public virtual void PreLoad() { if (Singleton <BattleLogic> .instance.isRuning) { return; } GameSettings.DecideDynamicParticleLOD(); Singleton <CHeroSelectBaseSystem> .instance.m_fOpenHeroSelectForm = Time.time - Singleton <CHeroSelectBaseSystem> .instance.m_fOpenHeroSelectForm; this.GameReportor.PrepareReport(); Singleton <BattleLogic> .GetInstance().isRuning = true; Singleton <BattleLogic> .GetInstance().isFighting = false; Singleton <BattleLogic> .GetInstance().isGameOver = false; Singleton <BattleLogic> .GetInstance().isWaitMultiStart = false; ActionManager.Instance.frameMode = true; MonoSingleton <ActionManager> .GetInstance().ForceStop(); Singleton <GameObjMgr> .GetInstance().ClearActor(); Singleton <SceneManagement> .GetInstance().Clear(); MonoSingleton <SceneMgr> .GetInstance().ClearAll(); MonoSingleton <GameLoader> .GetInstance().ResetLoader(); List <Player> .Enumerator enumerator = Singleton <GamePlayerCenter> .instance.GetAllPlayers().GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.get_Current() != null) { ReadonlyContext <uint> allHeroIds = enumerator.get_Current().GetAllHeroIds(); for (int i = 0; i < allHeroIds.Count; i++) { ActorMeta actorMeta = default(ActorMeta); ActorMeta actorMeta2 = actorMeta; actorMeta2.ActorCamp = enumerator.get_Current().PlayerCamp; actorMeta2.PlayerId = enumerator.get_Current().PlayerId; actorMeta2.ConfigId = (int)allHeroIds[i]; actorMeta = actorMeta2; MonoSingleton <GameLoader> .instance.AddActor(ref actorMeta); } } } if (!MonoSingleton <GameFramework> .instance.EditorPreviewMode) { if (string.IsNullOrEmpty(Singleton <GameContextEx> .GetInstance().GameContextCommonInfo.MapArtistFileName)) { MonoSingleton <GameLoader> .instance.AddLevel(Singleton <GameContextEx> .GetInstance().GameContextCommonInfo.MapDesignFileName); } else { MonoSingleton <GameLoader> .instance.AddDesignSerializedLevel(Singleton <GameContextEx> .GetInstance().GameContextCommonInfo.MapDesignFileName); MonoSingleton <GameLoader> .instance.AddArtistSerializedLevel(Singleton <GameContextEx> .GetInstance().GameContextCommonInfo.MapArtistFileName); } MonoSingleton <GameLoader> .instance.AddSoundBank("Effect_Common"); MonoSingleton <GameLoader> .instance.AddSoundBank("System_Voice"); } try { DebugHelper.CustomLog("GameBuilder Start Game: ispvplevel={0} ispvpmode={4} levelid={1} leveltype={6} levelname={3} Gametype={2} pick={5}", new object[] { Singleton <GameContextEx> .GetInstance().IsMobaMode(), Singleton <GameContextEx> .GetInstance().GameContextCommonInfo.MapId, Singleton <GameContextEx> .GetInstance().GetGameType(), Singleton <GameContextEx> .GetInstance().GameContextCommonInfo.MapName, Singleton <GameContextEx> .GetInstance().IsMobaMode(), Singleton <GameContextEx> .GetInstance().GetSelectHeroType(), Singleton <GameContextEx> .GetInstance().GameContextSoloInfo.PveLevelType }); Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer(); if (hostPlayer != null) { DebugHelper.CustomLog("HostPlayer player id={1} name={2} ", new object[] { hostPlayer.PlayerId, hostPlayer.Name }); } } catch (Exception) { } }
public virtual void EndGame() { try { DebugHelper.CustomLog("Prepare GameBuilder EndGame"); } catch (Exception) { } Singleton <LobbyLogic> .GetInstance().StopGameEndTimer(); Singleton <LobbyLogic> .GetInstance().StopSettleMsgTimer(); Singleton <LobbyLogic> .GetInstance().StopSettlePanelTimer(); MonoSingleton <GameLoader> .instance.AdvanceStopLoad(); Singleton <WatchController> .GetInstance().Stop(); Singleton <CBattleGuideManager> .GetInstance().resetPause(); MonoSingleton <ShareSys> .instance.SendQQGameTeamStateChgMsg(ShareSys.QQGameTeamEventType.end, COM_ROOM_TYPE.COM_ROOM_TYPE_NULL, 0, 0u, string.Empty, 0u, 0u); Singleton <StarSystem> .GetInstance().EndGame(); Singleton <WinLoseByStarSys> .GetInstance().EndGame(); this.GameReportor.DoApolloReport(); MonoSingleton <DialogueProcessor> .GetInstance().Uninit(); Singleton <TipProcessor> .GetInstance().Uninit(); Singleton <LobbyLogic> .instance.inMultiRoom = false; Singleton <LobbyLogic> .instance.inMultiGame = false; Singleton <BattleLogic> .GetInstance().isRuning = false; Singleton <BattleLogic> .GetInstance().isFighting = false; Singleton <BattleLogic> .GetInstance().isGameOver = false; Singleton <BattleLogic> .GetInstance().isWaitMultiStart = false; Singleton <NetworkModule> .GetInstance().CloseGameServerConnect(true); Singleton <ShenFuSystem> .instance.ClearAll(); MonoSingleton <ActionManager> .GetInstance().ForceStop(); Singleton <GameObjMgr> .GetInstance().ClearActor(); Singleton <SceneManagement> .GetInstance().Clear(); MonoSingleton <SceneMgr> .GetInstance().ClearAll(); Singleton <GamePlayerCenter> .GetInstance().ClearAllPlayers(); Singleton <ActorDataCenter> .instance.ClearHeroServerData(); Singleton <FrameSynchr> .GetInstance().ResetSynchr(); Singleton <GameReplayModule> .GetInstance().OnGameEnd(); Singleton <BattleLogic> .GetInstance().ResetBattleSystem(); ActionManager.Instance.frameMode = false; if (!Singleton <GameStateCtrl> .instance.isLobbyState) { DebugHelper.CustomLog("GotoLobbyState by EndGame"); Singleton <GameStateCtrl> .GetInstance().GotoState("LobbyState"); } Singleton <BattleSkillHudControl> .DestroyInstance(); try { FogOfWar.EndLevel(); } catch (DllNotFoundException ex) { DebugHelper.Assert(false, "FOW Exception {0} {1}", new object[] { ex.get_Message(), ex.get_StackTrace() }); } Singleton <BattleStatistic> .instance.PostEndGame(); try { DebugHelper.CustomLog("Finish GameBuilder EndGame"); } catch (Exception) { } }
public static void CustomLog(string str) { DebugHelper.CustomLog(str, null); }
public GameInfoBase StartGame(GameContextBase InGameContext) { DebugHelper.Assert(InGameContext != null); if (InGameContext == null) { return(null); } if (Singleton <BattleLogic> .get_instance().isRuning) { return(null); } SynchrReport.Reset(); GameSettings.DecideDynamicParticleLOD(); Singleton <CHeroSelectBaseSystem> .get_instance().m_fOpenHeroSelectForm = Time.time - Singleton <CHeroSelectBaseSystem> .get_instance().m_fOpenHeroSelectForm; this.m_fLoadingTime = Time.time; this.m_eventsLoadingTime.Clear(); ApolloAccountInfo accountInfo = Singleton <ApolloHelper> .GetInstance().GetAccountInfo(false); DebugHelper.Assert(accountInfo != null, "account info is null"); this.m_iMapId = InGameContext.levelContext.m_mapID; this.m_kGameType = InGameContext.levelContext.GetGameType(); this.m_eventsLoadingTime.Add(new KeyValuePair <string, string>("OpenID", (accountInfo == null) ? "0" : accountInfo.get_OpenId())); this.m_eventsLoadingTime.Add(new KeyValuePair <string, string>("LevelID", InGameContext.levelContext.m_mapID.ToString())); this.m_eventsLoadingTime.Add(new KeyValuePair <string, string>("isPVPLevel", InGameContext.levelContext.IsMobaMode().ToString())); this.m_eventsLoadingTime.Add(new KeyValuePair <string, string>("isPVPMode", InGameContext.levelContext.IsMobaMode().ToString())); this.m_eventsLoadingTime.Add(new KeyValuePair <string, string>("bLevelNo", InGameContext.levelContext.m_levelNo.ToString())); Singleton <BattleLogic> .GetInstance().isRuning = true; Singleton <BattleLogic> .GetInstance().isFighting = false; Singleton <BattleLogic> .GetInstance().isGameOver = false; Singleton <BattleLogic> .GetInstance().isWaitMultiStart = false; ActionManager.Instance.frameMode = true; MonoSingleton <ActionManager> .GetInstance().ForceStop(); Singleton <GameObjMgr> .GetInstance().ClearActor(); Singleton <SceneManagement> .GetInstance().Clear(); MonoSingleton <SceneMgr> .GetInstance().ClearAll(); MonoSingleton <GameLoader> .GetInstance().ResetLoader(); InGameContext.PrepareStartup(); if (!MonoSingleton <GameFramework> .get_instance().EditorPreviewMode) { DebugHelper.Assert(InGameContext.levelContext != null); DebugHelper.Assert(!string.IsNullOrEmpty(InGameContext.levelContext.m_levelDesignFileName)); if (string.IsNullOrEmpty(InGameContext.levelContext.m_levelArtistFileName)) { MonoSingleton <GameLoader> .get_instance().AddLevel(InGameContext.levelContext.m_levelDesignFileName); } else { MonoSingleton <GameLoader> .get_instance().AddDesignSerializedLevel(InGameContext.levelContext.m_levelDesignFileName); MonoSingleton <GameLoader> .get_instance().AddArtistSerializedLevel(InGameContext.levelContext.m_levelArtistFileName); } MonoSingleton <GameLoader> .get_instance().AddSoundBank("Effect_Common"); MonoSingleton <GameLoader> .get_instance().AddSoundBank("System_Voice"); } GameInfoBase gameInfoBase = InGameContext.CreateGameInfo(); DebugHelper.Assert(gameInfoBase != null, "can't create game logic object!"); this.gameInfo = gameInfoBase; gameInfoBase.PreBeginPlay(); Singleton <BattleLogic> .get_instance().m_LevelContext = this.gameInfo.gameContext.levelContext; try { DebugHelper.CustomLog("GameBuilder Start Game: ispvplevel={0} ispvpmode={4} levelid={1} leveltype={6} levelname={3} Gametype={2} pick={5}", new object[] { InGameContext.levelContext.IsMobaMode(), InGameContext.levelContext.m_mapID, InGameContext.levelContext.GetGameType(), InGameContext.levelContext.m_levelName, InGameContext.levelContext.IsMobaMode(), InGameContext.levelContext.GetSelectHeroType(), InGameContext.levelContext.m_pveLevelType }); Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer(); if (hostPlayer != null) { DebugHelper.CustomLog("HostPlayer player id={1} name={2} ", new object[] { hostPlayer.PlayerId, hostPlayer.Name }); } } catch (Exception) { } if (!MonoSingleton <GameFramework> .get_instance().EditorPreviewMode) { this.m_fLoadProgress = 0f; MonoSingleton <GameLoader> .GetInstance().Load(new GameLoader.LoadProgressDelegate(this.onGameLoadProgress), new GameLoader.LoadCompleteDelegate(this.OnGameLoadComplete)); MonoSingleton <VoiceSys> .GetInstance().HeroSelectTobattle(); Singleton <GameStateCtrl> .GetInstance().GotoState("LoadingState"); } return(gameInfoBase); }
public void EndGame() { if (!Singleton <BattleLogic> .get_instance().isRuning) { return; } try { DebugHelper.CustomLog("Prepare GameBuilder EndGame"); } catch (Exception) { } MonoSingleton <GSDKsys> .GetInstance().EndSpeed(); Singleton <GameLogic> .GetInstance().HashCheckFreq = 500u; Singleton <GameLogic> .GetInstance().SnakeTraceMasks = 0u; Singleton <GameLogic> .GetInstance().SnakeTraceSize = 1024000u; Singleton <LobbyLogic> .GetInstance().StopGameEndTimer(); Singleton <LobbyLogic> .GetInstance().StopSettleMsgTimer(); Singleton <LobbyLogic> .GetInstance().StopSettlePanelTimer(); MonoSingleton <GameLoader> .get_instance().AdvanceStopLoad(); Singleton <WatchController> .GetInstance().Stop(); Singleton <FrameWindow> .GetInstance().ResetSendCmdSeq(); Singleton <CBattleGuideManager> .GetInstance().resetPause(); MonoSingleton <ShareSys> .get_instance().SendQQGameTeamStateChgMsg(ShareSys.QQGameTeamEventType.end, 0, 0, 0u, string.Empty); Singleton <StarSystem> .GetInstance().EndGame(); Singleton <WinLoseByStarSys> .GetInstance().EndGame(); Singleton <CMatchingSystem> .GetInstance().EndGame(); string openID = Singleton <ApolloHelper> .GetInstance().GetOpenID(); List <KeyValuePair <string, string> > list = new List <KeyValuePair <string, string> >(); list.Add(new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion())); list.Add(new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString())); list.Add(new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString())); list.Add(new KeyValuePair <string, string>("openid", openID)); list.Add(new KeyValuePair <string, string>("GameType", this.m_kGameType.ToString())); list.Add(new KeyValuePair <string, string>("MapID", this.m_iMapId.ToString())); list.Add(new KeyValuePair <string, string>("LoadingTime", this.m_fLoadingTime.ToString())); Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_LoadingBattle", list, true); List <KeyValuePair <string, string> > list2 = new List <KeyValuePair <string, string> >(); list2.Add(new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion())); list2.Add(new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString())); list2.Add(new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString())); list2.Add(new KeyValuePair <string, string>("openid", openID)); list2.Add(new KeyValuePair <string, string>("totaltime", Singleton <CHeroSelectBaseSystem> .get_instance().m_fOpenHeroSelectForm.ToString())); list2.Add(new KeyValuePair <string, string>("gameType", this.m_kGameType.ToString())); list2.Add(new KeyValuePair <string, string>("role_list", string.Empty)); list2.Add(new KeyValuePair <string, string>("errorCode", string.Empty)); list2.Add(new KeyValuePair <string, string>("error_msg", string.Empty)); Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_Login_EnterGame", list2, true); float num = Singleton <FrameSynchr> .GetInstance().LogicFrameTick * 0.001f; Singleton <FrameSynchr> .GetInstance().PingVariance(); List <KeyValuePair <string, string> > list3 = new List <KeyValuePair <string, string> >(); list3.Add(new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion())); list3.Add(new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString())); list3.Add(new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString())); list3.Add(new KeyValuePair <string, string>("openid", openID)); list3.Add(new KeyValuePair <string, string>("GameType", this.m_kGameType.ToString())); list3.Add(new KeyValuePair <string, string>("MapID", this.m_iMapId.ToString())); list3.Add(new KeyValuePair <string, string>("Max_FPS", Singleton <CBattleSystem> .GetInstance().m_MaxBattleFPS.ToString())); list3.Add(new KeyValuePair <string, string>("Min_FPS", Singleton <CBattleSystem> .GetInstance().m_MinBattleFPS.ToString())); float num2 = -1f; if (Singleton <CBattleSystem> .GetInstance().m_BattleFPSCount > 0f) { num2 = Singleton <CBattleSystem> .GetInstance().m_AveBattleFPS / Singleton <CBattleSystem> .GetInstance().m_BattleFPSCount; } list3.Add(new KeyValuePair <string, string>("Avg_FPS", num2.ToString())); list3.Add(new KeyValuePair <string, string>("Ab_FPS_time", Singleton <BattleLogic> .GetInstance().m_Ab_FPS_time.ToString())); list3.Add(new KeyValuePair <string, string>("Abnormal_FPS", Singleton <BattleLogic> .GetInstance().m_Abnormal_FPS_Count.ToString())); list3.Add(new KeyValuePair <string, string>("Less10FPSCount", Singleton <BattleLogic> .GetInstance().m_fpsCunt10.ToString())); list3.Add(new KeyValuePair <string, string>("Less18FPSCount", Singleton <BattleLogic> .GetInstance().m_fpsCunt18.ToString())); list3.Add(new KeyValuePair <string, string>("Ab_4FPS_time", Singleton <BattleLogic> .GetInstance().m_Ab_4FPS_time.ToString())); list3.Add(new KeyValuePair <string, string>("Abnormal_4FPS", Singleton <BattleLogic> .GetInstance().m_Abnormal_4FPS_Count.ToString())); list3.Add(new KeyValuePair <string, string>("Min_Ping", Singleton <FrameSynchr> .get_instance().m_MinPing.ToString())); list3.Add(new KeyValuePair <string, string>("Max_Ping", Singleton <FrameSynchr> .get_instance().m_MaxPing.ToString())); list3.Add(new KeyValuePair <string, string>("Avg_Ping", Singleton <FrameSynchr> .get_instance().m_AvePing.ToString())); list3.Add(new KeyValuePair <string, string>("Abnormal_Ping", Singleton <FrameSynchr> .get_instance().m_Abnormal_PingCount.ToString())); list3.Add(new KeyValuePair <string, string>("Ping300", Singleton <FrameSynchr> .get_instance().m_ping300Count.ToString())); list3.Add(new KeyValuePair <string, string>("Ping150to300", Singleton <FrameSynchr> .get_instance().m_ping150to300.ToString())); list3.Add(new KeyValuePair <string, string>("Ping150", Singleton <FrameSynchr> .get_instance().m_ping150.ToString())); list3.Add(new KeyValuePair <string, string>("LostpingCount", Singleton <FrameSynchr> .get_instance().m_pingLost.ToString())); list3.Add(new KeyValuePair <string, string>("PingSeqCount", Singleton <FrameSynchr> .get_instance().m_LastReceiveHeartSeq.ToString())); list3.Add(new KeyValuePair <string, string>("PingVariance", Singleton <FrameSynchr> .get_instance().m_PingVariance.ToString())); list3.Add(new KeyValuePair <string, string>("Battle_Time", num.ToString())); list3.Add(new KeyValuePair <string, string>("BattleSvr_Reconnect", Singleton <NetworkModule> .GetInstance().m_GameReconnetCount.ToString())); list3.Add(new KeyValuePair <string, string>("GameSvr_Reconnect", Singleton <NetworkModule> .GetInstance().m_lobbyReconnetCount.ToString())); list3.Add(new KeyValuePair <string, string>("music", GameSettings.EnableMusic.ToString())); list3.Add(new KeyValuePair <string, string>("quality", GameSettings.RenderQuality.ToString())); list3.Add(new KeyValuePair <string, string>("status", "1")); list3.Add(new KeyValuePair <string, string>("Quality_Mode", GameSettings.ModelLOD.ToString())); list3.Add(new KeyValuePair <string, string>("Quality_Particle", GameSettings.ParticleLOD.ToString())); list3.Add(new KeyValuePair <string, string>("receiveMoveCmdAverage", Singleton <FrameSynchr> .get_instance().m_receiveMoveCmdAverage.ToString())); list3.Add(new KeyValuePair <string, string>("receiveMoveCmdMax", Singleton <FrameSynchr> .get_instance().m_receiveMoveCmdMax.ToString())); list3.Add(new KeyValuePair <string, string>("execMoveCmdAverage", Singleton <FrameSynchr> .get_instance().m_execMoveCmdAverage.ToString())); list3.Add(new KeyValuePair <string, string>("execMoveCmdMax", Singleton <FrameSynchr> .get_instance().m_execMoveCmdMax.ToString())); list3.Add(new KeyValuePair <string, string>("LOD_Down", Singleton <BattleLogic> .GetInstance().m_iAutoLODState.ToString())); if (NetworkAccelerator.started) { if (NetworkAccelerator.isAccerating()) { list3.Add(new KeyValuePair <string, string>("AccState", "Acc")); } else { list3.Add(new KeyValuePair <string, string>("AccState", "Direct")); } } else { list3.Add(new KeyValuePair <string, string>("AccState", "Off")); } int num3 = 0; if (MonoSingleton <VoiceSys> .GetInstance().UseSpeak&& MonoSingleton <VoiceSys> .GetInstance().UseMic) { num3 = 2; } else if (MonoSingleton <VoiceSys> .GetInstance().UseSpeak) { num3 = 1; } list3.Add(new KeyValuePair <string, string>("Mic", num3.ToString())); Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_PVPBattle_Summary", list3, true); this.m_eventsLoadingTime.Clear(); try { float num4 = (float)Singleton <BattleLogic> .GetInstance().m_fpsCunt10 / (float)Singleton <BattleLogic> .GetInstance().m_fpsCount; int iFps10PercentNum = Mathf.CeilToInt(num4 * 100f / 10f) * 10; float num5 = (float)(Singleton <BattleLogic> .GetInstance().m_fpsCunt18 + Singleton <BattleLogic> .GetInstance().m_fpsCunt10) / (float)Singleton <BattleLogic> .GetInstance().m_fpsCount; int iFps18PercentNum = Mathf.CeilToInt(num5 * 100f / 10f) * 10; CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(5000u); cSPkg.stPkgData.get_stCltPerformance().iMapID = this.m_iMapId; cSPkg.stPkgData.get_stCltPerformance().iPlayerCnt = Singleton <GamePlayerCenter> .get_instance().GetAllPlayers().get_Count(); cSPkg.stPkgData.get_stCltPerformance().chModelLOD = (sbyte)GameSettings.ModelLOD; cSPkg.stPkgData.get_stCltPerformance().chParticleLOD = (sbyte)GameSettings.ParticleLOD; cSPkg.stPkgData.get_stCltPerformance().chCameraHeight = (sbyte)GameSettings.CameraHeight; cSPkg.stPkgData.get_stCltPerformance().chEnableOutline = ((!GameSettings.EnableOutline) ? 0 : 1); cSPkg.stPkgData.get_stCltPerformance().iFps10PercentNum = iFps10PercentNum; cSPkg.stPkgData.get_stCltPerformance().iFps18PercentNum = iFps18PercentNum; cSPkg.stPkgData.get_stCltPerformance().iAveFps = (int)Singleton <CBattleSystem> .GetInstance().m_AveBattleFPS; cSPkg.stPkgData.get_stCltPerformance().iPingAverage = Singleton <FrameSynchr> .get_instance().m_PingAverage; cSPkg.stPkgData.get_stCltPerformance().iPingVariance = Singleton <FrameSynchr> .get_instance().m_PingVariance; Utility.StringToByteArray(SystemInfo.deviceModel, ref cSPkg.stPkgData.get_stCltPerformance().szDeviceModel); Utility.StringToByteArray(SystemInfo.graphicsDeviceName, ref cSPkg.stPkgData.get_stCltPerformance().szGPUName); cSPkg.stPkgData.get_stCltPerformance().iCpuCoreNum = SystemInfo.processorCount; cSPkg.stPkgData.get_stCltPerformance().iSysMemorySize = SystemInfo.systemMemorySize; cSPkg.stPkgData.get_stCltPerformance().iAvailMemory = DeviceCheckSys.GetAvailMemory(); cSPkg.stPkgData.get_stCltPerformance().iIsTongCai = ((!MonoSingleton <CTongCaiSys> .GetInstance().IsCanUseTongCai()) ? 0 : 1); int iIsSpeedUp; if (NetworkAccelerator.started) { if (NetworkAccelerator.isAccerating()) { iIsSpeedUp = 1; } else { iIsSpeedUp = 2; } } else { iIsSpeedUp = 0; } if (MonoSingleton <GSDKsys> .GetInstance().enabled) { iIsSpeedUp = 4; } cSPkg.stPkgData.get_stCltPerformance().iIsSpeedUp = iIsSpeedUp; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false); } catch (Exception ex) { Debug.Log(ex.get_Message()); } MonoSingleton <DialogueProcessor> .GetInstance().Uninit(); Singleton <TipProcessor> .GetInstance().Uninit(); Singleton <LobbyLogic> .get_instance().inMultiRoom = false; Singleton <LobbyLogic> .get_instance().inMultiGame = false; Singleton <LobbyLogic> .GetInstance().reconnGameInfo = null; Singleton <BattleLogic> .GetInstance().isRuning = false; Singleton <BattleLogic> .GetInstance().isFighting = false; Singleton <BattleLogic> .GetInstance().isGameOver = false; Singleton <BattleLogic> .GetInstance().isWaitMultiStart = false; Singleton <NetworkModule> .GetInstance().CloseGameServerConnect(true); Singleton <ShenFuSystem> .get_instance().ClearAll(); MonoSingleton <ActionManager> .GetInstance().ForceStop(); Singleton <GameObjMgr> .GetInstance().ClearActor(); Singleton <SceneManagement> .GetInstance().Clear(); MonoSingleton <SceneMgr> .GetInstance().ClearAll(); Singleton <GamePlayerCenter> .GetInstance().ClearAllPlayers(); Singleton <ActorDataCenter> .get_instance().ClearHeroServerData(); Singleton <FrameSynchr> .GetInstance().ResetSynchr(); Singleton <GameReplayModule> .GetInstance().OnGameEnd(); Singleton <BattleLogic> .GetInstance().ResetBattleSystem(); ActionManager.Instance.frameMode = false; MonoSingleton <VoiceInteractionSys> .get_instance().OnEndGame(); if (!Singleton <GameStateCtrl> .get_instance().isLobbyState) { DebugHelper.CustomLog("GotoLobbyState by EndGame"); Singleton <GameStateCtrl> .GetInstance().GotoState("LobbyState"); } Singleton <BattleSkillHudControl> .DestroyInstance(); this.m_kGameType = 12; this.m_iMapId = 0; try { FogOfWar.EndLevel(); } catch (DllNotFoundException ex2) { DebugHelper.Assert(false, "FOW Exception {0} {1}", new object[] { ex2.get_Message(), ex2.get_StackTrace() }); } Singleton <BattleStatistic> .get_instance().PostEndGame(); try { DebugHelper.CustomLog("Finish GameBuilder EndGame"); } catch (Exception) { } }
public void EndGame() { if (Singleton <BattleLogic> .instance.isRuning) { try { DebugHelper.CustomLog("Prepare GameBuilder EndGame"); } catch (Exception) { } Singleton <LobbyLogic> .GetInstance().StopGameEndTimer(); Singleton <LobbyLogic> .GetInstance().StopSettleMsgTimer(); Singleton <LobbyLogic> .GetInstance().StopSettlePanelTimer(); MonoSingleton <GameLoader> .instance.AdvanceStopLoad(); Singleton <WatchController> .GetInstance().Stop(); Singleton <CBattleGuideManager> .GetInstance().resetPause(); if (this.gameInfo != null) { this.gameInfo.EndGame(); } string openID = Singleton <ApolloHelper> .GetInstance().GetOpenID(); Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("GameBuild.EndGame", null, true); List <KeyValuePair <string, string> > events = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion()), new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()), new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString()), new KeyValuePair <string, string>("openid", openID), new KeyValuePair <string, string>("GameType", this.m_kGameType.ToString()), new KeyValuePair <string, string>("MapID", this.m_iMapId.ToString()), new KeyValuePair <string, string>("LoadingTime", this.m_fLoadingTime.ToString()) }; Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_LoadingBattle", events, true); List <KeyValuePair <string, string> > list2 = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion()), new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()), new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString()), new KeyValuePair <string, string>("openid", openID), new KeyValuePair <string, string>("totaltime", Singleton <CHeroSelectBaseSystem> .instance.m_fOpenHeroSelectForm.ToString()), new KeyValuePair <string, string>("gameType", this.m_kGameType.ToString()), new KeyValuePair <string, string>("role_list", string.Empty), new KeyValuePair <string, string>("errorCode", string.Empty), new KeyValuePair <string, string>("error_msg", string.Empty) }; Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_Login_EnterGame", list2, true); float num = Singleton <FrameSynchr> .GetInstance().LogicFrameTick * 0.001f; List <KeyValuePair <string, string> > list3 = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion()), new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()), new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString()), new KeyValuePair <string, string>("openid", openID), new KeyValuePair <string, string>("GameType", this.m_kGameType.ToString()), new KeyValuePair <string, string>("MapID", this.m_iMapId.ToString()), new KeyValuePair <string, string>("Max_FPS", Singleton <CBattleSystem> .GetInstance().m_MaxBattleFPS.ToString()), new KeyValuePair <string, string>("Min_FPS", Singleton <CBattleSystem> .GetInstance().m_MinBattleFPS.ToString()) }; float num2 = -1f; if (Singleton <CBattleSystem> .GetInstance().m_BattleFPSCount > 0f) { num2 = Singleton <CBattleSystem> .GetInstance().m_AveBattleFPS / Singleton <CBattleSystem> .GetInstance().m_BattleFPSCount; } list3.Add(new KeyValuePair <string, string>("Avg_FPS", num2.ToString())); list3.Add(new KeyValuePair <string, string>("Ab_FPS_time", Singleton <BattleLogic> .GetInstance().m_Ab_FPS_time.ToString())); list3.Add(new KeyValuePair <string, string>("Abnormal_FPS", Singleton <BattleLogic> .GetInstance().m_Abnormal_FPS_Count.ToString())); list3.Add(new KeyValuePair <string, string>("Ab_4FPS_time", Singleton <BattleLogic> .GetInstance().m_Ab_4FPS_time.ToString())); list3.Add(new KeyValuePair <string, string>("Abnormal_4FPS", Singleton <BattleLogic> .GetInstance().m_Abnormal_4FPS_Count.ToString())); list3.Add(new KeyValuePair <string, string>("Min_Ping", Singleton <FrameSynchr> .instance.m_MinPing.ToString())); list3.Add(new KeyValuePair <string, string>("Max_Ping", Singleton <FrameSynchr> .instance.m_MaxPing.ToString())); list3.Add(new KeyValuePair <string, string>("Avg_Ping", Singleton <FrameSynchr> .instance.m_AvePing.ToString())); list3.Add(new KeyValuePair <string, string>("Abnormal_Ping", Singleton <FrameSynchr> .instance.m_Abnormal_PingCount.ToString())); list3.Add(new KeyValuePair <string, string>("Ping300", Singleton <FrameSynchr> .instance.m_ping300Count.ToString())); list3.Add(new KeyValuePair <string, string>("Ping150to300", Singleton <FrameSynchr> .instance.m_ping150to300.ToString())); list3.Add(new KeyValuePair <string, string>("Ping150", Singleton <FrameSynchr> .instance.m_ping150.ToString())); list3.Add(new KeyValuePair <string, string>("LostpingCount", Singleton <FrameSynchr> .instance.m_pingLost.ToString())); list3.Add(new KeyValuePair <string, string>("Battle_Time", num.ToString())); list3.Add(new KeyValuePair <string, string>("BattleSvr_Reconnect", Singleton <NetworkModule> .GetInstance().m_GameReconnetCount.ToString())); list3.Add(new KeyValuePair <string, string>("GameSvr_Reconnect", Singleton <NetworkModule> .GetInstance().m_lobbyReconnetCount.ToString())); list3.Add(new KeyValuePair <string, string>("music", GameSettings.EnableMusic.ToString())); list3.Add(new KeyValuePair <string, string>("quality", GameSettings.RenderQuality.ToString())); list3.Add(new KeyValuePair <string, string>("status", "1")); int num3 = 0; if (MonoSingleton <VoiceSys> .GetInstance().UseSpeak&& MonoSingleton <VoiceSys> .GetInstance().UseMic) { num3 = 2; } else if (MonoSingleton <VoiceSys> .GetInstance().UseSpeak) { num3 = 1; } list3.Add(new KeyValuePair <string, string>("Mic", num3.ToString())); Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_PVPBattle_Summary", list3, true); List <KeyValuePair <string, string> > list4 = new List <KeyValuePair <string, string> >(); float num4 = Singleton <BattleLogic> .GetInstance().m_fAveFPS / ((float)Singleton <BattleLogic> .GetInstance().m_fpsCount); list4.Add(new KeyValuePair <string, string>("AveFPS", num4.ToString())); list4.Add(new KeyValuePair <string, string>("<10FPSCount", Singleton <BattleLogic> .GetInstance().m_fpsCunt10.ToString())); list4.Add(new KeyValuePair <string, string>("<18FPSCount", Singleton <BattleLogic> .GetInstance().m_fpsCunt18.ToString())); list4.Add(new KeyValuePair <string, string>("Quality_Mode", GameSettings.ModelLOD.ToString())); list4.Add(new KeyValuePair <string, string>("Quality_Particle", GameSettings.ParticleLOD.ToString())); if (Singleton <BattleLogic> .GetInstance().GetCurLvelContext() != null) { list4.Add(new KeyValuePair <string, string>("MapId", Singleton <BattleLogic> .GetInstance().GetCurLvelContext().m_mapID.ToString())); } if (this.m_eventsLoadingTime != null) { for (int i = 0; i < this.m_eventsLoadingTime.Count; i++) { KeyValuePair <string, string> item = this.m_eventsLoadingTime[i]; list4.Add(item); } } Singleton <BeaconHelper> .GetInstance().EventBase(ref list4); if (num4 >= 25f) { Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Event_FPS_ave >= 25_" + Singleton <BattleLogic> .GetInstance().GetLevelTypeDescription(), list4, true); } else if ((num4 >= 20f) && (num4 < 25f)) { Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Event_FPS_ave >= 20_" + Singleton <BattleLogic> .GetInstance().GetLevelTypeDescription(), list4, true); } else if ((num4 >= 18f) && (num4 < 20f)) { Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Event_FPS_ave >= 18_" + Singleton <BattleLogic> .GetInstance().GetLevelTypeDescription(), list4, true); } else if ((num4 >= 15f) && (num4 < 18f)) { Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Event_FPS_ave >= 15_" + Singleton <BattleLogic> .GetInstance().GetLevelTypeDescription(), list4, true); } else if ((num4 >= 10f) && (num4 < 15f)) { Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Event_FPS_ave >= 10_" + Singleton <BattleLogic> .GetInstance().GetLevelTypeDescription(), list4, true); } else { Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Event_FPS_ave < 10_" + Singleton <BattleLogic> .GetInstance().GetLevelTypeDescription(), list4, true); } float num6 = ((float)Singleton <BattleLogic> .GetInstance().m_fpsCunt10) / ((float)Singleton <BattleLogic> .GetInstance().m_fpsCount); int num7 = Mathf.CeilToInt((num6 * 100f) / 10f) * 10; Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Event_FPS_<=10_Percent:" + num7.ToString() + "%", list4, true); float num8 = ((float)(Singleton <BattleLogic> .GetInstance().m_fpsCunt18 + Singleton <BattleLogic> .GetInstance().m_fpsCunt10)) / ((float)Singleton <BattleLogic> .GetInstance().m_fpsCount); int num9 = Mathf.CeilToInt((num8 * 100f) / 10f) * 10; Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Event_FPS<=18_Percent:" + num9.ToString() + "%", list4, true); this.m_eventsLoadingTime.Clear(); Singleton <FrameSynchr> .instance.ReportPingToBeacon(); try { CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x1388); msg.stPkgData.stCltPerformance.iMapID = this.m_iMapId; msg.stPkgData.stCltPerformance.iPlayerCnt = Singleton <GamePlayerCenter> .instance.GetAllPlayers().Count; msg.stPkgData.stCltPerformance.chModelLOD = (sbyte)GameSettings.ModelLOD; msg.stPkgData.stCltPerformance.chParticleLOD = (sbyte)GameSettings.ParticleLOD; msg.stPkgData.stCltPerformance.chCameraHeight = (sbyte)GameSettings.CameraHeight; msg.stPkgData.stCltPerformance.chEnableOutline = !GameSettings.EnableOutline ? ((sbyte)0) : ((sbyte)1); msg.stPkgData.stCltPerformance.iFps10PercentNum = num7; msg.stPkgData.stCltPerformance.iFps18PercentNum = num9; msg.stPkgData.stCltPerformance.iAveFps = (int)Singleton <CBattleSystem> .GetInstance().m_AveBattleFPS; msg.stPkgData.stCltPerformance.iPingAverage = Singleton <FrameSynchr> .instance.m_PingAverage; msg.stPkgData.stCltPerformance.iPingVariance = Singleton <FrameSynchr> .instance.m_PingVariance; Utility.StringToByteArray(SystemInfo.deviceModel, ref msg.stPkgData.stCltPerformance.szDeviceModel); Utility.StringToByteArray(SystemInfo.graphicsDeviceName, ref msg.stPkgData.stCltPerformance.szGPUName); msg.stPkgData.stCltPerformance.iCpuCoreNum = SystemInfo.processorCount; msg.stPkgData.stCltPerformance.iSysMemorySize = SystemInfo.systemMemorySize; msg.stPkgData.stCltPerformance.iAvailMemory = DeviceCheckSys.GetAvailMemory(); Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false); } catch (Exception exception) { Debug.Log(exception.Message); } MonoSingleton <DialogueProcessor> .GetInstance().Uninit(); Singleton <TipProcessor> .GetInstance().Uninit(); Singleton <LobbyLogic> .instance.inMultiRoom = false; Singleton <LobbyLogic> .instance.inMultiGame = false; Singleton <BattleLogic> .GetInstance().isRuning = false; Singleton <BattleLogic> .GetInstance().isFighting = false; Singleton <BattleLogic> .GetInstance().isGameOver = false; Singleton <BattleLogic> .GetInstance().isWaitMultiStart = false; Singleton <NetworkModule> .GetInstance().CloseGameServerConnect(true); Singleton <ShenFuSystem> .instance.ClearAll(); MonoSingleton <ActionManager> .GetInstance().ForceStop(); Singleton <GameObjMgr> .GetInstance().ClearActor(); Singleton <SceneManagement> .GetInstance().Clear(); MonoSingleton <SceneMgr> .GetInstance().ClearAll(); Singleton <GamePlayerCenter> .GetInstance().ClearAllPlayers(); Singleton <ActorDataCenter> .instance.ClearHeroServerData(); Singleton <FrameSynchr> .GetInstance().ResetSynchr(); Singleton <GameReplayModule> .GetInstance().OnGameEnd(); Singleton <BattleLogic> .GetInstance().ResetBattleSystem(); ActionManager.Instance.frameMode = false; if (!Singleton <GameStateCtrl> .instance.isLobbyState) { DebugHelper.CustomLog("GotoLobbyState by EndGame"); Singleton <GameStateCtrl> .GetInstance().GotoState("LobbyState"); } Singleton <BattleSkillHudControl> .DestroyInstance(); this.m_kGameType = COM_GAME_TYPE.COM_GAME_TYPE_MAX; this.m_iMapId = 0; Singleton <BattleStatistic> .instance.PostEndGame(); try { FrameTracer.Destroy(); DebugHelper.CustomLog("Finish GameBuilder EndGame"); } catch (Exception) { } } }
public void EndGame() { if (!Singleton <BattleLogic> .instance.isRuning) { return; } try { DebugHelper.CustomLog("Prepare GameBuilder EndGame"); } catch (Exception) { } MonoSingleton <TGPSDKSys> .GetInstance().EnablePhone(false); MonoSingleton <GSDKsys> .GetInstance().EndSpeed(); Singleton <GameLogic> .GetInstance().HashCheckFreq = 500u; Singleton <GameLogic> .GetInstance().SnakeTraceMasks = 0u; Singleton <GameLogic> .GetInstance().SnakeTraceSize = 1024000u; Singleton <LobbyLogic> .GetInstance().StopGameEndTimer(); Singleton <LobbyLogic> .GetInstance().StopSettleMsgTimer(); Singleton <LobbyLogic> .GetInstance().StopSettlePanelTimer(); MonoSingleton <GameLoader> .instance.AdvanceStopLoad(); Singleton <WatchController> .GetInstance().Stop(); Singleton <FrameWindow> .GetInstance().ResetSendCmdSeq(); Singleton <CBattleGuideManager> .GetInstance().resetPause(); MonoSingleton <ShareSys> .instance.SendQQGameTeamStateChgMsg(ShareSys.QQGameTeamEventType.end, COM_ROOM_TYPE.COM_ROOM_TYPE_NULL, 0, 0u, string.Empty, 0u, 0u); Singleton <StarSystem> .GetInstance().EndGame(); Singleton <WinLoseByStarSys> .GetInstance().EndGame(); Singleton <CMatchingSystem> .GetInstance().EndGame(); string openID = Singleton <ApolloHelper> .GetInstance().GetOpenID(); List <KeyValuePair <string, string> > list = new List <KeyValuePair <string, string> >(); list.Add(new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion())); list.Add(new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString())); list.Add(new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString())); list.Add(new KeyValuePair <string, string>("openid", openID)); list.Add(new KeyValuePair <string, string>("GameType", this.m_kGameType.ToString())); list.Add(new KeyValuePair <string, string>("MapID", this.m_iMapId.ToString())); list.Add(new KeyValuePair <string, string>("LoadingTime", this.m_fLoadingTime.ToString())); Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_LoadingBattle", list, true); List <KeyValuePair <string, string> > list2 = new List <KeyValuePair <string, string> >(); list2.Add(new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion())); list2.Add(new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString())); list2.Add(new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString())); list2.Add(new KeyValuePair <string, string>("openid", openID)); list2.Add(new KeyValuePair <string, string>("totaltime", Singleton <CHeroSelectBaseSystem> .instance.m_fOpenHeroSelectForm.ToString())); list2.Add(new KeyValuePair <string, string>("gameType", this.m_kGameType.ToString())); list2.Add(new KeyValuePair <string, string>("role_list", string.Empty)); list2.Add(new KeyValuePair <string, string>("errorCode", string.Empty)); list2.Add(new KeyValuePair <string, string>("error_msg", string.Empty)); Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_Login_EnterGame", list2, true); float num = (float)Singleton <DataReportSys> .GetInstance().GameTime; List <KeyValuePair <string, string> > list3 = new List <KeyValuePair <string, string> >(); list3.Add(new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion())); list3.Add(new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString())); list3.Add(new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().GetPlatformStr())); list3.Add(new KeyValuePair <string, string>("openid", openID)); list3.Add(new KeyValuePair <string, string>("GameType", this.m_kGameType.ToString())); list3.Add(new KeyValuePair <string, string>("MapID", this.m_iMapId.ToString())); list3.Add(new KeyValuePair <string, string>("Battle_Time", num.ToString())); list3.Add(new KeyValuePair <string, string>("music", GameSettings.EnableMusic.ToString())); list3.Add(new KeyValuePair <string, string>("quality", GameSettings.RenderQuality.ToString())); list3.Add(new KeyValuePair <string, string>("status", "1")); list3.Add(new KeyValuePair <string, string>("Quality_Mode", GameSettings.ModelLOD.ToString())); list3.Add(new KeyValuePair <string, string>("Quality_Particle", GameSettings.ParticleLOD.ToString())); list3.Add(new KeyValuePair <string, string>("receiveMoveCmdAverage", Singleton <FrameSynchr> .instance.m_receiveMoveCmdAverage.ToString())); list3.Add(new KeyValuePair <string, string>("receiveMoveCmdMax", Singleton <FrameSynchr> .instance.m_receiveMoveCmdMax.ToString())); list3.Add(new KeyValuePair <string, string>("execMoveCmdAverage", Singleton <FrameSynchr> .instance.m_execMoveCmdAverage.ToString())); list3.Add(new KeyValuePair <string, string>("execMoveCmdMax", Singleton <FrameSynchr> .instance.m_execMoveCmdMax.ToString())); list3.Add(new KeyValuePair <string, string>("LOD_Down", Singleton <BattleLogic> .GetInstance().m_iAutoLODState.ToString())); if (NetworkAccelerator.started) { if (NetworkAccelerator.isAccerating()) { list3.Add(new KeyValuePair <string, string>("AccState", "Acc")); } else { list3.Add(new KeyValuePair <string, string>("AccState", "Direct")); } } else { list3.Add(new KeyValuePair <string, string>("AccState", "Off")); } list3.Add(new KeyValuePair <string, string>("MnaState", MonoSingleton <GSDKsys> .GetInstance().m_GsdkSpeedFlag.ToString())); int num2 = 0; if (MonoSingleton <VoiceSys> .GetInstance().UseSpeak&& MonoSingleton <VoiceSys> .GetInstance().UseMic) { num2 = 2; } else if (MonoSingleton <VoiceSys> .GetInstance().UseSpeak) { num2 = 1; } list3.Add(new KeyValuePair <string, string>("Mic", num2.ToString())); list3.Add(new KeyValuePair <string, string>("NetWorkType", CVersionUpdateSystem.Android_GetNetworkType().ToString())); list3.Add(new KeyValuePair <string, string>("vport", NetworkAccelerator.GetConnectIPstr())); List <KeyValuePair <string, string> > list4 = Singleton <DataReportSys> .GetInstance().ReportPingToBeacon(); for (int i = 0; i < list4.get_Count(); i++) { list3.Add(list4.get_Item(i)); } list4 = Singleton <DataReportSys> .GetInstance().ReportFPSToBeacon(); for (int j = 0; j < list4.get_Count(); j++) { list3.Add(list4.get_Item(j)); } Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_PVPBattle_Summary", list3, true); this.m_eventsLoadingTime.Clear(); try { float num3 = (float)Singleton <DataReportSys> .GetInstance().FPS10Count / (float)Singleton <DataReportSys> .GetInstance().FPSCount; int iFps10PercentNum = Mathf.CeilToInt(num3 * 100f / 10f) * 10; float num4 = (float)(Singleton <DataReportSys> .GetInstance().FPS10Count + Singleton <DataReportSys> .GetInstance().FPS18Count) / (float)Singleton <DataReportSys> .GetInstance().FPSCount; int iFps18PercentNum = Mathf.CeilToInt(num4 * 100f / 10f) * 10; CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(5000u); cSPkg.stPkgData.stCltPerformance.iMapID = this.m_iMapId; cSPkg.stPkgData.stCltPerformance.iPlayerCnt = Singleton <GamePlayerCenter> .instance.GetAllPlayers().get_Count(); cSPkg.stPkgData.stCltPerformance.chModelLOD = (sbyte)GameSettings.ModelLOD; cSPkg.stPkgData.stCltPerformance.chParticleLOD = (sbyte)GameSettings.ParticleLOD; cSPkg.stPkgData.stCltPerformance.chCameraHeight = (sbyte)GameSettings.CameraHeight; cSPkg.stPkgData.stCltPerformance.chEnableOutline = (GameSettings.EnableOutline ? 1 : 0); cSPkg.stPkgData.stCltPerformance.iFps10PercentNum = iFps10PercentNum; cSPkg.stPkgData.stCltPerformance.iFps18PercentNum = iFps18PercentNum; cSPkg.stPkgData.stCltPerformance.iAveFps = Singleton <DataReportSys> .GetInstance().FPSAVE; cSPkg.stPkgData.stCltPerformance.iPingAverage = Singleton <DataReportSys> .GetInstance().HeartPingAve; cSPkg.stPkgData.stCltPerformance.iPingVariance = Singleton <DataReportSys> .GetInstance().HeartPingVar; Utility.StringToByteArray(SystemInfo.deviceModel, ref cSPkg.stPkgData.stCltPerformance.szDeviceModel); Utility.StringToByteArray(SystemInfo.graphicsDeviceName, ref cSPkg.stPkgData.stCltPerformance.szGPUName); cSPkg.stPkgData.stCltPerformance.iCpuCoreNum = SystemInfo.processorCount; cSPkg.stPkgData.stCltPerformance.iSysMemorySize = SystemInfo.systemMemorySize; cSPkg.stPkgData.stCltPerformance.iAvailMemory = DeviceCheckSys.GetAvailMemory(); cSPkg.stPkgData.stCltPerformance.iIsTongCai = (MonoSingleton <CTongCaiSys> .GetInstance().IsCanUseTongCai() ? 1 : 0); int num5; if (NetworkAccelerator.started) { if (NetworkAccelerator.isAccerating()) { num5 = 1; } else { num5 = 2; } } else { num5 = 0; } if (MonoSingleton <GSDKsys> .GetInstance().UseGSdkSpeed) { num5 = 4 + num5; } cSPkg.stPkgData.stCltPerformance.iIsSpeedUp = num5; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false); } catch (Exception ex) { Debug.Log(ex.get_Message()); } MonoSingleton <DialogueProcessor> .GetInstance().Uninit(); Singleton <TipProcessor> .GetInstance().Uninit(); Singleton <LobbyLogic> .instance.inMultiRoom = false; Singleton <LobbyLogic> .instance.inMultiGame = false; Singleton <LobbyLogic> .GetInstance().reconnGameInfo = null; Singleton <BattleLogic> .GetInstance().isRuning = false; Singleton <BattleLogic> .GetInstance().isFighting = false; Singleton <BattleLogic> .GetInstance().isGameOver = false; Singleton <BattleLogic> .GetInstance().isWaitMultiStart = false; Singleton <NetworkModule> .GetInstance().CloseGameServerConnect(true); NetworkAccelerator.ClearConnectIP(); Singleton <ShenFuSystem> .instance.ClearAll(); MonoSingleton <ActionManager> .GetInstance().ForceStop(); Singleton <GameObjMgr> .GetInstance().ClearActor(); Singleton <SceneManagement> .GetInstance().Clear(); MonoSingleton <SceneMgr> .GetInstance().ClearAll(); Singleton <GamePlayerCenter> .GetInstance().ClearAllPlayers(); Singleton <ActorDataCenter> .instance.ClearHeroServerData(); Singleton <FrameSynchr> .GetInstance().ResetSynchr(); Singleton <GameReplayModule> .GetInstance().OnGameEnd(); Singleton <BattleLogic> .GetInstance().ResetBattleSystem(); ActionManager.Instance.frameMode = false; MonoSingleton <VoiceInteractionSys> .instance.OnEndGame(); Singleton <CBattleGuideManager> .instance.OnEndGame(); Singleton <DataReportSys> .GetInstance().ClearAllData(); if (!Singleton <GameStateCtrl> .instance.isLobbyState) { DebugHelper.CustomLog("GotoLobbyState by EndGame"); Singleton <GameStateCtrl> .GetInstance().GotoState("LobbyState"); } Singleton <BattleSkillHudControl> .DestroyInstance(); this.m_kGameType = COM_GAME_TYPE.COM_GAME_TYPE_MAX; this.m_iMapId = 0; try { FogOfWar.EndLevel(); } catch (DllNotFoundException ex2) { DebugHelper.Assert(false, "FOW Exception {0} {1}", new object[] { ex2.get_Message(), ex2.get_StackTrace() }); } Singleton <BattleStatistic> .instance.PostEndGame(); try { DebugHelper.CustomLog("Finish GameBuilder EndGame"); } catch (Exception) { } }