/// <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 }); }
/// <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 }); }
public virtual void OnPlayerKicked(ClientKickedEventArgs e) { }
private void OnPlayerKicked(ClientKickedEventArgs e) { foreach (EventListener el in Plugins) { PlayerListener pl = (PlayerListener)el.Listener; if (el.Event == Event.PLAYER_KICKED) pl.OnPlayerKicked(e); } }