protected virtual void NetClientRejected(MsgReject.RejectionCodes code, string reason) { NetClient.Shutdown(); if (ClientRejected != null) { ClientRejected.Invoke(this, new ClientRejectionEventArgs(code, reason)); } }
private void SendReject(ServerPlayer player, MsgReject.RejectionCodes code, string reason) { player.Accepted = false; player.RejectionReason = code.ToString() + " :" + reason; Logger.Log1("Reject Player " + player.PlayerID + " " + player.RejectionReason); player.SendMessage(new MsgReject(code, reason)); PlayerRejected?.Invoke(this, player); player.Disconnect(); RemovePlayer(player); }
public ClientRejectionEventArgs(MsgReject.RejectionCodes code, string reason) { Code = code; Reason = reason; }