private void OnSurrenderConfirm(CUIEvent cuiEvent) { if (!this.IsWarmBattle()) { this.SendMsgSurrender(1); } else { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); if (masterRoleInfo != null) { this.m_lastSurrenderTime = (uint)masterRoleInfo.getCurrentTimeSinceLogin(); this.m_maxCnt = this.GetTotalAcnt(); this.m_curCnt = 1; if (this.m_maxCnt == 1) { LobbyMsgHandler.ForceKillCrystal((int)Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerCamp); } else { this.m_haveRights = false; this.m_result = this.ConstrcutData(this.m_maxCnt); this.m_timerSeq = Singleton <CTimerManager> .instance.AddTimer(this.m_random.Next(500, 0xbb8), 1, new CTimer.OnTimeUpHandler(this.OnTimerWarmBattle)); this.OpenSurrenderForm(this.m_maxCnt, this.m_curCnt, this.m_result); } } } }
private void OnTimerWarmBattle(int timerSequence) { Singleton <CTimerManager> .instance.RemoveTimer(this.m_timerSeq); this.m_timerSeq = -1; if (this.m_curCnt != this.m_maxCnt) { this.m_curCnt++; this.m_timerSeq = Singleton <CTimerManager> .instance.AddTimer(this.m_random.Next(500, 0xbb8), 1, new CTimer.OnTimeUpHandler(this.OnTimerWarmBattle)); this.OpenSurrenderForm(this.m_maxCnt, this.m_curCnt, this.m_result); } else { this.m_haveRights = true; LobbyMsgHandler.ForceKillCrystal((int)Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerCamp); } }