public static void SendStatisticsMessage(PlayerEntity targetPlayer)
        {
            BattleStatisticsMessage message = BattleStatisticsMessage.Allocate();

            if (targetPlayer.hasStatisticsData)
            {
                BattleData data = targetPlayer.statisticsData.Battle;

                KillerInfo killer = KillerInfo.Allocate();
                killer.PlayerLv   = data.Killer.PlayerLv;
                killer.PlayerName = data.Killer.PlayerName;
                killer.BackId     = data.Killer.BackId;
                killer.TitleId    = data.Killer.TitleId;
                killer.BadgeId    = data.Killer.BadgeId;
                killer.WeaponId   = data.Killer.WeaponId;
                killer.DeadType   = (int)data.Killer.DeadType;
                message.Killer    = killer;

                foreach (var opponent in data.OpponentList)
                {
                    OpponentInfo info = OpponentInfo.Allocate();
                    info.PlayerLv   = opponent.PlayerLv;
                    info.PlayerName = opponent.PlayerName;
                    info.BackId     = opponent.BackId;
                    info.TitleId    = opponent.TitleId;
                    info.BadgeId    = opponent.BadgeId;
                    info.WeaponId   = opponent.WeaponId;
                    info.IsKill     = opponent.IsKill;
                    info.Damage     = opponent.Damage;
                    message.Opponents.Add(info);
                }
            }

            targetPlayer.network.NetworkChannel.SendReliable((int)EServer2ClientMessage.Statistics, message);
        }
Beispiel #2
0
        public void Display()
        {
            if (_localist == null)
            {
                _size = 0;
            }
            else
            {
                _size = _localist.Count;
            }

            for (int i = 0; i < 5; i++)
            {
                if (i < _size && _size != 0)
                {
                    if (_localist != null)
                    {
                        while (_localist.ElementAt(i).Killer != "Player")
                        {
                            i++;
                        }

                        KillerInfo info = _localist.ElementAt(i);


                        _show[i].text = "<color=#ff0000>" + "你用" + "</color>" +
                                        "<color=#00FFff>" + info.Guntype + "</color>" +
                                        "<color=#ffffff> 击杀了 </color>" +
                                        "<color=#00ff00>" + info.Victim + "</color>\n";;
                    }
                }
                else
                {
                    _show[i].text = " ";
                }
            }
        }