protected void UpdateBossInfo() { this.EndCountDown(); BossItemInfo bossItemInfo = BossBookManager.Instance.GetBossItemInfo(this.curBossId); if (bossItemInfo == null) { return; } this.SetToggle(bossItemInfo.trackFlag); if (bossItemInfo.survivalBossCount > 0) { this.m_TextRefresh.set_text(GameDataUtils.GetChineseContent(517520, false)); this.m_TextRefreshTime.set_text(bossItemInfo.survivalBossCount.ToString()); } else { this.m_TextRefresh.set_text(GameDataUtils.GetChineseContent(517521, false)); int num = BossBookManager.ToTimeStamp(TimeManager.Instance.PreciseServerTime); int nextRefreshSec = bossItemInfo.nextRefreshSec; if (nextRefreshSec > num) { this.m_TextRefreshTime.set_text(TimeConverter.GetTime(nextRefreshSec - num, TimeFormat.HHMMSS)); this.StratCountDown(); } else { this.m_TextRefresh.set_text(GameDataUtils.GetChineseContent(517520, false)); this.m_TextRefreshTime.set_text(bossItemInfo.survivalBossCount.ToString()); } } }
public void OnGetBossPageInfoRes(short state, GetBossPageInfoRes msg = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (msg == null) { return; } List <int> list = new List <int>(); for (int i = 0; i < msg.bossLabelInfo.get_Count(); i++) { BossLabelInfo bossLabelInfo = msg.bossLabelInfo.get_Item(i); if (DataReader <BossBiaoQian> .Get(bossLabelInfo.labelId) != null) { BossItemInfo bossItemInfo = this.GetBossItemInfo(bossLabelInfo.labelId); if (bossItemInfo != null) { bossItemInfo.UpdateInfo(bossLabelInfo); list.Add(bossLabelInfo.labelId); } } } EventDispatcher.Broadcast <List <int> >(EventNames.BossBookPageUpdate, list); }
public void ContinueNavToBoss() { if (this.AfterTeleportNavToBossId > 0) { BossItemInfo bossItemInfo = this.GetBossItemInfo(this.AfterTeleportNavToBossId); if (bossItemInfo == null) { return; } BossBiaoQian bossBiaoQian = DataReader <BossBiaoQian> .Get(this.AfterTeleportNavToBossId); if (bossBiaoQian == null) { return; } if (CityManager.Instance.CurrentCityID != bossBiaoQian.scene) { return; } if (bossItemInfo.pos.get_Count() > 0) { Pos pos; if (bossItemInfo.pos.get_Count() > 1) { int num = Random.Range(0, bossItemInfo.pos.get_Count()); pos = bossItemInfo.pos.get_Item(num); } else { pos = bossItemInfo.pos.get_Item(0); } float x = pos.x * 0.01f; float z = pos.y * 0.01f; TimerHeap.AddTimer(500u, 0, delegate { EventDispatcher.Broadcast(EventNames.BeginNav); EntityWorld.Instance.EntSelf.NavToSameScenePoint(x, z, 0f, delegate { EventDispatcher.Broadcast(EventNames.EndNav); }); }); } this.AfterTeleportNavToBossId = 0; } }
public override void Release() { using (Dictionary <int, BossItemInfo> .ValueCollection.Enumerator enumerator = this.BossDictionary.get_Values().GetEnumerator()) { while (enumerator.MoveNext()) { BossItemInfo current = enumerator.get_Current(); current.ClearInfo(); } } this.BossDictionary.Clear(); this.PageDictionary.Clear(); this.AfterTeleportNavToBossId = 0; this.TrackBossComeOutUtcDic = null; this.RemoveBossBookCountDown(); this.isFirstLogin = true; this.CurrentUITabIndex = 0; }
public void OnGetBossLabelInfoRes(short state, GetBossLabelInfoRes msg = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (msg == null) { return; } BossItemInfo bossItemInfo = this.GetBossItemInfo(msg.labelId); if (bossItemInfo != null) { bossItemInfo.UpdateInfo(msg.bossLabelInfo); } EventDispatcher.Broadcast <int>(EventNames.BossBookItemUpdate, msg.labelId); }
public bool TeleportAndNavToBoss(int bossId) { BossItemInfo bossItemInfo = this.GetBossItemInfo(bossId); if (bossItemInfo == null) { return(false); } BossBiaoQian bossBiaoQian = DataReader <BossBiaoQian> .Get(bossId); if (bossBiaoQian == null) { return(false); } bool result = false; int scene = bossBiaoQian.scene; if (CityManager.Instance.CurrentCityID == scene) { if (bossItemInfo.pos.get_Count() > 0) { Pos pos; if (bossItemInfo.pos.get_Count() > 1) { int num = Random.Range(0, bossItemInfo.pos.get_Count()); pos = bossItemInfo.pos.get_Item(num); } else { pos = bossItemInfo.pos.get_Item(0); } float pointX = pos.x * 0.01f; float pointZ = pos.y * 0.01f; result = true; EventDispatcher.Broadcast(EventNames.BeginNav); EntityWorld.Instance.EntSelf.NavToSameScenePoint(pointX, pointZ, 0f, delegate { EventDispatcher.Broadcast(EventNames.EndNav); }); } } else if (!this.IsTeleportOn(scene)) { UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(517001, false)); } else { RadarManager.Instance.StopNav(); ZhuChengPeiZhi zhuChengPeiZhi = DataReader <ZhuChengPeiZhi> .Get(scene); if (zhuChengPeiZhi != null) { this.AfterTeleportNavToBossId = bossId; result = true; if (zhuChengPeiZhi.mapType == 3) { this.SendCondMainCityEnterReq(scene); } else { EventDispatcher.Broadcast <int>(CityManagerEvent.ChangeCityByIntegrationHearth, scene); } } } return(result); }