Beispiel #1
0
 /// <summary>
 /// Disconnect the client with the given reason.
 /// </summary>
 /// <param name="reason">The reason to be displayed to the player.</param>
 public void Kick(string reason)
 {
     //Event
     ClientKickedEventArgs e = new ClientKickedEventArgs(this, reason);
     _Player.Server.PluginManager.CallEvent(Event.PLAYER_KICKED, e);
     if (e.EventCanceled) return;
     reason = e.Message;
     //End Event
     SendPacket(new DisconnectPacket
     {
         Reason = reason
     });
 }
Beispiel #2
0
        /// <summary>
        /// Disconnect the client with the given reason.
        /// </summary>
        /// <param name="reason">The reason to be displayed to the player.</param>
        public void Kick(string reason)
        {
            //Event
            ClientKickedEventArgs e = new ClientKickedEventArgs(this, reason);
            Server.PluginManager.CallEvent(Event.PlayerKicked, e);
            if (e.EventCanceled) return;
            reason = e.Message;
            //End Event

            if(_player != null && _player.LoggedIn)
                Save();

            SendPacket(new DisconnectPacket
            {
                Reason = reason
            });
        }
Beispiel #3
0
 public virtual void OnPlayerKicked(ClientKickedEventArgs e)
 {
 }
Beispiel #4
0
 private void OnPlayerKicked(ClientKickedEventArgs e)
 {
     foreach (EventListener el in Plugins)
     {
         PlayerListener pl = (PlayerListener)el.Listener;
         if (el.Event == Event.PLAYER_KICKED)
             pl.OnPlayerKicked(e);
     }
 }