示例#1
0
        public static void ReadPlayerInfoTeam(PacketReader stream)
        {
            int id = stream.ReadByte();

            if (!_Players.TryGetValue(id, out PlayerInfo pi))
            {
                return;
            }

            OnPlayerListChange?.Invoke();
        }
示例#2
0
        public static void ReadPlayerInfoMessage(PacketReader stream)
        {
            int id = stream.ReadByte();

            if (!_Players.TryGetValue(id, out PlayerInfo pi))
            {
                pi = id == HeroInfo.Id ? HeroInfo : new PlayerInfo {
                    Id = id
                };
                _Players.Add(id, pi);
            }

            pi.Name = stream.ReadString();

            OnPlayerListChange?.Invoke();
        }
示例#3
0
        public static void ReadPlayerInfoTeam(PacketReader stream)
        {
            int id = stream.ReadByte();

            if (!players.TryGetValue(id, out PlayerInfo pi))
            {
                return;
            }

            pi.teamID = (TeamIdent)stream.ReadSByte();
            OnPlayerListChange?.Invoke();

            if (pi == heroInfo && TDMMode.IsActive)
            {
                TDMMode.HeroTeamChange();
            }
        }
示例#4
0
        public static void ReadPlayerInfoMessage(PacketReader stream)
        {
            int id = stream.ReadByte();

            if (!players.TryGetValue(id, out PlayerInfo pi))
            {
                pi = id == heroInfo.ID ? heroInfo : new PlayerInfo {
                    id = id
                };
                players.Add(id, pi);
            }

            pi.name   = stream.ReadString();
            pi.teamID = (TeamIdent)stream.ReadSByte();

            if (id == heroInfo.ID && pi.teamID < TeamIdent.GMPlayer)
            {
                NPCClass.Hero = null;
            }

            OnPlayerListChange?.Invoke();
        }