public void UpdatePlayer(PlayerInfo infos) { if (PlayersConnected.ContainsKey(infos.UserId)) { PlayersConnected[infos.UserId] = infos; } else { PlayersConnected.Add(infos.UserId, infos); } }
public void RemovePlayer(PlayerInfo infos) { if (PlayersConnected.ContainsKey(infos.UserId)) { if (!SeenTime.ContainsKey(infos.Username.ToUpper())) { SeenTime.Add(infos.Username.ToUpper(), DateTime.Now); } else { SeenTime[infos.Username.ToUpper()] = DateTime.Now; } PlayersConnected.Remove(infos.UserId); SaveSeenTime(); } }