Ejemplo n.º 1
0
 public void RemovePlayer(Player player)
 {
     lock (OnlinePlayers)
     {
         OnlinePlayers.Remove(player);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     Handle a player disconnect event
 /// </summary>
 private static void HandlePlayerDisconnect(string text, OutputParseResult outputparseresult, IPlayerAction playeraction)
 {
     if (OnlinePlayers.ContainsKey(playeraction.PlayerName))
     {
         OnlinePlayers.Remove(playeraction.PlayerName);
     }
     RaisePlayerListChangedEvent();
 }
Ejemplo n.º 3
0
 public void RemovePlayer(int entityId)
 {
     lock (OnlinePlayers)
     {
         if (OnlinePlayers.ContainsKey(entityId))
         {
             OnlinePlayers.Remove(entityId);
         }
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 ///     Remove a player from the online players list and raise the according events
 /// </summary>
 /// <param name="player">The player to remove</param>
 public static void RemovePlayer(Player player)
 {
     if (player == null || !OnlinePlayers.ContainsKey(player.Name))
     {
         return;
     }
     OnlinePlayers.Remove(player.Name);
     RaisePlayerListChangedEvent();
     RaisePlayerListDeletionEvent(player);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Logs out.
        /// </summary>
        /// <param name="player">The player.</param>
        protected virtual void LogOut(Player player)
        {
            if (!OnlinePlayers.Remove(player))
            {
                return;
            }

            PlayerRepository.UpdatePlayerAsync(player);
            LoggedOut?.Invoke(this, player);
            Logger.Info($"[{player.Username}] logout succeed");
        }