Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
 public void Disconnect()
 {
     LeaveServer("Disconnected", PlayerDB.GetLogoutMessage(this));
 }
Ejemplo n.º 4
0
        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));
            }
        }