public static void ReadPlayerInfoTeam(PacketReader stream) { int id = stream.ReadByte(); if (!_Players.TryGetValue(id, out PlayerInfo pi)) { return; } OnPlayerListChange?.Invoke(); }
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(); }
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(); } }
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(); }