public DateTime SearchSeenDate(string username) { if (GetPlayer(username) != null) { return(DateTime.Now); } if (SeenTime.ContainsKey(username.ToUpper())) { return(SeenTime[username.ToUpper()]); } else { return(new DateTime(1, 1, 1)); } }
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(); } }