void PlayerDisconnect(Player p, string reason) { SetPresence(); if (p.hidden) { return; } if (reason == null) { reason = PlayerDB.GetLogoutMessage(p); } string message = config.DiscordPrefix + config.DisconnectPrefix + " " + p.DisplayName + " " + reason; SendMessage(Colors.Strip(message)); }
/// <summary> Disconnects the player from the server, /// with their default logout message shown in chat. </summary> public void Disconnect() { LeaveServer(PlayerDB.GetLogoutMessage(this), "disconnected", false); }
public void Disconnect() { LeaveServer("Disconnected", PlayerDB.GetLogoutMessage(this)); }
void PlayerCommand(Player p, string cmd, string args, CommandData data) { if (cmd != "hide") { return; } // Offset the player count by one if player is going to hide // Has to be done because this event is called before /hide is called if (p.hidden) { SetPresence(1); string message = config.DiscordPrefix + config.ConnectPrefix + " " + p.DisplayName + " " + PlayerDB.GetLoginMessage(p); SendMessage(Colors.Strip(message)); } else { SetPresence(-1); string message = config.DiscordPrefix + config.DisconnectPrefix + " " + p.DisplayName + " " + PlayerDB.GetLogoutMessage(p); SendMessage(Colors.Strip(message)); } }