コード例 #1
0
        //============================================================================
        // Connection.handleReset
        //============================================================================
        bool handleReset()
        {
            // Read in parameters
            byte suffix = mReader.ReadByte();

            Server.output("Reset");

            // Verify the command suffix
            if (suffix != cCommandSuffix)
            {
                Server.output("ERROR - missing command suffix");
                return(false);
            }

            Server.resetClient(this);
            DebugConnectionManager.resetClient(mIP);

            // Send the response
            mWriter.Write((byte)cCommandPrefix);
            mWriter.Write((byte)CommandType.Reset);
            mWriter.Write((byte)1);
            mWriter.Write((byte)cCommandSuffix);
            mWriter.Flush();

            return(true);
        }
コード例 #2
0
        public static void Main()
        {
            //try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                mMainForm = new MainForm();

                if (!Server.setup(mMainForm.mDefaultIP))
                {
                    return;
                }

                if (!DebugConnectionManager.setup())
                {
                    return;
                }

                mMainForm.initData();
                mMainForm.Show();

                mPipeManager = new PipeManager();
                mPipeManager.Initialize();

                Server.start();
                DebugConnectionManager.start();

                try
                {
                    mXFSMutex = new Mutex(true, "XFSMutex");
                }
                catch
                {
                    return;
                }

                Application.Run(mMainForm);

                mMainForm.saveCommandHistory();


                Server.shutdown();
                DebugConnectionManager.shutdown();
                XenonInterface.destroy();

                mPipeManager.Stop();
            }
            //catch { }
        }
コード例 #3
0
        public static void helperThread(object parameter)
        {
            DebugConnection connection = (DebugConnection)parameter;

            connection.mRecvBufferLen = 0;

            connection.mSocket.BeginReceive(connection.mRecvBuffer, 0, connection.mRecvBuffer.Length, 0, new AsyncCallback(ReadCallBack), connection);

            for ( ; ;)
            {
                try
                {
                    WaitHandle[] waitHandles     = { connection.mExitThread, connection.mCommandReady };
                    int          waitHandleIndex = WaitHandle.WaitAny(waitHandles);

                    if (waitHandleIndex == 0)
                    {
                        break;
                    }

                    connection.sendQueuedCommands();
                }
                catch
                {
                    break;
                }
            }

            connection.mSocket.Close();

            if (connection.mTextCallback != null)
            {
                connection.mTextCallback("<debug>Debug connection [" + connection.mID.ToString() + "] disconnected: " + connection.getXboxName() + " (" + connection.getIP() + ") </debug>");
            }

            DebugConnectionManager.removeConnection(connection);
        }
コード例 #4
0
 static public void reloadFile(string filename)
 {
     // This is called from a worker thread.
     DebugConnectionManager.sendCommand(@"reloadFile(""" + filename + @""")");
 }
コード例 #5
0
 static public void launchScenerio(string scen)
 {
     // This is called from a worker thread.
     DebugConnectionManager.sendCommand(@"loadScenario(""" + scen + @""")");
 }