private void BroadCastRank() { if (leftTime > 0) { leftTime--; } if (leftTime <= 0) { refreshIndex++; if (refreshIndex > BigRefrshTime.Length - 1) { refreshIndex = BigRefrshTime.Length - 1; } leftTime = int.Parse(BigRefrshTime[refreshIndex]); CreateNpcLogic(); } if (_playerList.Count == 0) { return; } _playerList.Sort((a, b) => { return(a.point - b.point); }); if (_playerList.Count > 0 && kingId != _playerList[0].objId)//成为鸡王 { kingId = _playerList[0].objId; SceneServer.Instance.ServerControl.BroadcastSceneChat(EnumAllPlayerId(), _playerList[0].name, 272000); } MsgCheckenRankList msg = new MsgCheckenRankList(); for (int i = _playerList.Count - 1; i >= 0; i--) { MsgCheckenRankInfo info = new MsgCheckenRankInfo(); info.Guid = _playerList[i].objId; info.Name = _playerList[i].name; info.Score = _playerList[i].point; info.Kill = _playerList[i].kill; info.Die = _playerList[i].die; info.EnemyGuid = _playerList[i].enemyId; var selfChar = FindPlayer(info.Guid); if (selfChar != null) { info.PosX = selfChar.GetPosition().X; info.PosZ = selfChar.GetPosition().Y; } msg.RankList.Add(info); } msg.bosDie = bosIsDie; msg.PosX = npcBoss.mPosition.X; msg.PosZ = npcBoss.mPosition.Y; msg.LeftTime = leftTime; foreach (var player in EnumAllPlayer()) { player.Proxy.CK_NotifyRankList(msg); } }
private void OnChickenInfoSyna(IEvent evt) { RefreshChijRankiListEvent e = evt as RefreshChijRankiListEvent; if (e == null) { return; } msgR = e.msg; InitModel(); }
public void CK_NotifyRankList(MsgCheckenRankList rank) { RefreshChijRankiListEvent e = new RefreshChijRankiListEvent(rank); EventDispatcher.Instance.DispatchEvent(e); }