コード例 #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));
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: rdebath/MCGalaxy
 /// <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);
 }
コード例 #3
0
ファイル: Player.cs プロジェクト: Peteys93/MCGalaxy
 public void Disconnect()
 {
     LeaveServer("Disconnected", PlayerDB.GetLogoutMessage(this));
 }
コード例 #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));
            }
        }