Command Window class for Debug purpose.
Debug command UI that runs in the Game. You can type commands by keyboard. This works Xbox 360 too. You just need to connect USB keyboard. Also, this debug command works on Windows Phone too. How to Use: 1) Add this component to the game. 2) Register command by RegisterCommand method. 3) Open/Close Debug window by Tab key.
Inheritance: Microsoft.Xna.Framework.DrawableGameComponent, IDebugCommandHost
Exemple #1
0
        /// <summary>
        /// Start remote debug command.
        /// </summary>
        void ConnectedToRemote()
        {
            DebugCommandUI commandUI = commandHost as DebugCommandUI;

            if (IsHost)
            {
                if (commandUI != null)
                {
                    commandUI.Prompt = "[Host]>";
                }
            }
            else
            {
                if (commandUI != null)
                {
                    commandUI.Prompt = "[Client]>";
                }

                commandHost.PushExecutioner(this);

                SendPacket(StartPacketHeader, "Remote Debug Command Started!!");
            }

            commandHost.RegisterCommand("quit", "Quit from remote command",
                                        ExecuteQuitCommand);
        }
Exemple #2
0
        /// <summary>
        /// End remote debug command.
        /// </summary>
        void DisconnectedFromRemote()
        {
            DebugCommandUI commandUI = commandHost as DebugCommandUI;

            if (commandUI != null)
            {
                commandUI.Prompt = DebugCommandUI.DefaultPrompt;
            }

            commandHost.UnregisterCommand("quit");

            if (!IsHost)
            {
                commandHost.PopExecutioner();

                if (OwnsNetworkSession)
                {
                    NetworkSession.Dispose();
                    NetworkSession     = null;
                    OwnsNetworkSession = false;
                }
            }
        }