示例#1
0
 public void UpdatePlayer(PlayerInfo infos)
 {
     if (PlayersConnected.ContainsKey(infos.UserId))
     {
         PlayersConnected[infos.UserId] = infos;
     }
     else
     {
         PlayersConnected.Add(infos.UserId, infos);
     }
 }
示例#2
0
 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();
     }
 }