private void OnCheatOnIIPSServerSelectChanged(CUIEvent uiEvent) { enIIPSServerType selected = (enIIPSServerType)((CUIToggleListScript)uiEvent.m_srcWidgetScript).GetSelected(); if (selected >= enIIPSServerType.None) { selected = enIIPSServerType.Test; ((CUIToggleListScript)uiEvent.m_srcWidgetScript).SetSelected((int)selected); } CVersionUpdateSystem.SetIIPSServerType(selected); }
private void OnCheatErrorLogSelectChanged(CUIEvent uiEvent) { bool[] multiSelected = ((CUIToggleListScript)uiEvent.m_srcWidgetScript).GetMultiSelected(); for (int i = 0; i < CCheatSystem.s_errorLogFlags.Length; i++) { CCheatSystem.s_errorLogFlags[i] = multiSelected[i]; if (i == 1) { CVersionUpdateSystem.EnableLogDebug(CCheatSystem.s_errorLogFlags[i]); } } }
private void OpenCheatForm() { CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_cheatFormPath, false, false); if (script != null) { this.m_enabled = true; GameObject widget = script.GetWidget(0); if (widget != null) { CUIToggleListScript component = widget.GetComponent <CUIToggleListScript>(); if (component != null) { component.SetElementAmount(s_tversionServerTypeName.Length); for (int i = 0; i < s_tversionServerTypeName.Length; i++) { Transform transform = component.GetElemenet(i).gameObject.transform.Find("Label"); if (transform != null) { Text text = transform.gameObject.GetComponent <Text>(); if (text != null) { text.text = s_tversionServerTypeName[i]; if (i == 8) { text.color = new Color(1f, 0f, 0f, 1f); } } } } component.SetSelected((int)CVersionUpdateSystem.GetIIPSServerType()); } } GameObject obj3 = script.GetWidget(1); if (obj3 != null) { CUIToggleListScript script4 = obj3.GetComponent <CUIToggleListScript>(); if (script4 != null) { script4.SetElementAmount(s_TDirServerTypeName.Length); for (int j = 0; j < s_TDirServerTypeName.Length; j++) { Transform transform2 = script4.GetElemenet(j).gameObject.transform.Find("Label"); if (transform2 != null) { Text text2 = transform2.gameObject.GetComponent <Text>(); if (text2 != null) { text2.text = s_TDirServerTypeName[j]; if (j == 0) { text2.color = new Color(1f, 0f, 0f, 1f); } } } } script4.SetSelected((int)TdirConfig.cheatServerType); } } GameObject obj4 = script.GetWidget(2); if (obj4 != null) { CUIToggleListScript script6 = obj4.GetComponent <CUIToggleListScript>(); if (script6 != null) { script6.SetElementAmount(s_errorLogFlagName.Length); for (int k = 0; k < s_errorLogFlagName.Length; k++) { Transform transform3 = script6.GetElemenet(k).gameObject.transform.Find("Label"); if (transform3 != null) { Text text3 = transform3.gameObject.GetComponent <Text>(); if (text3 != null) { text3.text = s_errorLogFlagName[k]; } } } for (int m = 0; m < s_errorLogFlags.Length; m++) { script6.SetMultiSelected(m, s_errorLogFlags[m]); } } } GameObject obj5 = script.GetWidget(3); if (obj5 != null) { CUIToggleListScript script8 = obj5.GetComponent <CUIToggleListScript>(); if (script8 != null) { script8.SetElementAmount(s_ignoreMaintainName.Length); for (int n = 0; n < s_ignoreMaintainName.Length; n++) { Transform transform4 = script8.GetElemenet(n).gameObject.transform.Find("Label"); if (transform4 != null) { Text text4 = transform4.gameObject.GetComponent <Text>(); if (text4 != null) { text4.text = s_ignoreMaintainName[n]; } } } script8.SetMultiSelected(0, TdirMgr.s_maintainBlock); } } GameObject obj6 = script.GetWidget(4); if (obj6 != null) { CUIToggleListScript script10 = obj6.GetComponent <CUIToggleListScript>(); if (script10 != null) { script10.SetElementAmount(s_joystickConfigNames.Length); for (int num6 = 0; num6 < s_joystickConfigNames.Length; num6++) { Transform transform5 = script10.GetElemenet(num6).gameObject.transform.Find("Label"); if (transform5 != null) { Text text5 = transform5.gameObject.GetComponent <Text>(); if (text5 != null) { text5.text = s_joystickConfigNames[num6]; } } if (num6 == 0) { script10.SetMultiSelected(num6, s_joystickConfigs[num6]); } } } } } }
private void OpenCheatForm() { CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CCheatSystem.s_cheatFormPath, false, false); if (cUIFormScript == null) { return; } this.m_enabled = true; GameObject widget = cUIFormScript.GetWidget(0); if (widget != null) { CUIToggleListScript component = widget.GetComponent <CUIToggleListScript>(); if (component != null) { component.SetElementAmount(CCheatSystem.s_tversionServerTypeName.Length); for (int i = 0; i < CCheatSystem.s_tversionServerTypeName.Length; i++) { CUIListElementScript elemenet = component.GetElemenet(i); Transform transform = elemenet.gameObject.transform.Find("Label"); if (transform != null) { Text component2 = transform.gameObject.GetComponent <Text>(); if (component2 != null) { component2.set_text(CCheatSystem.s_tversionServerTypeName[i]); if (i == 8) { component2.set_color(new Color(1f, 0f, 0f, 1f)); } } } } component.SetSelected((int)CVersionUpdateSystem.GetIIPSServerType()); } } GameObject widget2 = cUIFormScript.GetWidget(1); if (widget2 != null) { CUIToggleListScript component3 = widget2.GetComponent <CUIToggleListScript>(); if (component3 != null) { component3.SetElementAmount(CCheatSystem.s_TDirServerTypeName.Length); for (int j = 0; j < CCheatSystem.s_TDirServerTypeName.Length; j++) { CUIListElementScript elemenet2 = component3.GetElemenet(j); Transform transform2 = elemenet2.gameObject.transform.Find("Label"); if (transform2 != null) { Text component4 = transform2.gameObject.GetComponent <Text>(); if (component4 != null) { component4.set_text(CCheatSystem.s_TDirServerTypeName[j]); if (j == 0) { component4.set_color(new Color(1f, 0f, 0f, 1f)); } } } } component3.SetSelected((int)TdirConfig.cheatServerType); } } GameObject widget3 = cUIFormScript.GetWidget(2); if (widget3 != null) { CUIToggleListScript component5 = widget3.GetComponent <CUIToggleListScript>(); if (component5 != null) { component5.SetElementAmount(CCheatSystem.s_errorLogFlagName.Length); for (int k = 0; k < CCheatSystem.s_errorLogFlagName.Length; k++) { CUIListElementScript elemenet3 = component5.GetElemenet(k); Transform transform3 = elemenet3.gameObject.transform.Find("Label"); if (transform3 != null) { Text component6 = transform3.gameObject.GetComponent <Text>(); if (component6 != null) { component6.set_text(CCheatSystem.s_errorLogFlagName[k]); } } } CCheatSystem.s_errorLogFlags[1] = CVersionUpdateSystem.IsEnableLogDebug(); for (int l = 0; l < CCheatSystem.s_errorLogFlags.Length; l++) { component5.SetMultiSelected(l, CCheatSystem.s_errorLogFlags[l]); } } } GameObject widget4 = cUIFormScript.GetWidget(3); if (widget4 != null) { CUIToggleListScript component7 = widget4.GetComponent <CUIToggleListScript>(); if (component7 != null) { component7.SetElementAmount(CCheatSystem.s_ignoreMaintainName.Length); for (int m = 0; m < CCheatSystem.s_ignoreMaintainName.Length; m++) { CUIListElementScript elemenet4 = component7.GetElemenet(m); Transform transform4 = elemenet4.gameObject.transform.Find("Label"); if (transform4 != null) { Text component8 = transform4.gameObject.GetComponent <Text>(); if (component8 != null) { component8.set_text(CCheatSystem.s_ignoreMaintainName[m]); } } } component7.SetMultiSelected(0, TdirMgr.s_maintainBlock); } } GameObject widget5 = cUIFormScript.GetWidget(4); if (widget5 != null) { CUIToggleListScript component9 = widget5.GetComponent <CUIToggleListScript>(); if (component9 != null) { component9.SetElementAmount(CCheatSystem.s_joystickConfigNames.Length); for (int n = 0; n < CCheatSystem.s_joystickConfigNames.Length; n++) { CUIListElementScript elemenet5 = component9.GetElemenet(n); Transform transform5 = elemenet5.gameObject.transform.Find("Label"); if (transform5 != null) { Text component10 = transform5.gameObject.GetComponent <Text>(); if (component10 != null) { component10.set_text(CCheatSystem.s_joystickConfigNames[n]); } } component9.SetMultiSelected(n, CCheatSystem.s_joystickConfigs[n]); } } } }
private void OnExitGame(CUIEvent uiEvent) { Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.CheckDevice_Quit, new CUIEventManager.OnUIEventHandler(this.OnExitGame)); CVersionUpdateSystem.QuitApp(); }
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) { } }