예제 #1
0
        public override CmdResult ExecuteRequest(CmdRequest args)
        {
            int seconds;
            if (args.Length != 1 || !Int32.TryParse(args[0], out seconds))
                return ShowUsage(); // " sleep [seconds]";

            AgentPausePacket pause = new AgentPausePacket();
            pause.AgentData.AgentID = Client.Self.AgentID;
            pause.AgentData.SessionID = Client.Self.SessionID;
            pause.AgentData.SerialNum = sleepSerialNum++;

            Client.Network.SendPacket(pause);

            // Sleep
            Thread.Sleep(seconds*1000);

            AgentResumePacket resume = new AgentResumePacket();
            resume.AgentData.AgentID = Client.Self.AgentID;
            resume.AgentData.SessionID = Client.Self.SessionID;
            resume.AgentData.SerialNum = pause.AgentData.SerialNum;

            Client.Network.SendPacket(resume);

            return Success("Paused, slept for " + seconds + " second(s), and resumed");
        }
예제 #2
0
        public override string Execute(string[] args, UUID fromAgentID)
        {
            int seconds;
            if (args.Length != 1 || !Int32.TryParse(args[0], out seconds))
                return "Usage: sleep [seconds]";

            AgentPausePacket pause = new AgentPausePacket();
            pause.AgentData.AgentID = Client.Self.AgentID;
            pause.AgentData.SessionID = Client.Self.SessionID;
            pause.AgentData.SerialNum = sleepSerialNum++;

            Client.Network.SendPacket(pause);

            // Sleep
            System.Threading.Thread.Sleep(seconds * 1000);

            AgentResumePacket resume = new AgentResumePacket();
            resume.AgentData.AgentID = Client.Self.AgentID;
            resume.AgentData.SessionID = Client.Self.SessionID;
            resume.AgentData.SerialNum = pause.AgentData.SerialNum;

            Client.Network.SendPacket(resume);

            return "Paused, slept for " + seconds + " second(s), and resumed";
        }
        public override CmdResult ExecuteRequest(CmdRequest args)
        {
            int seconds;

            if (args.Length != 1 || !Int32.TryParse(args[0], out seconds))
            {
                return(ShowUsage()); // " sleep [seconds]";
            }
            AgentPausePacket pause = new AgentPausePacket();

            pause.AgentData.AgentID   = Client.Self.AgentID;
            pause.AgentData.SessionID = Client.Self.SessionID;
            pause.AgentData.SerialNum = sleepSerialNum++;

            Client.Network.SendPacket(pause);

            // Sleep
            Thread.Sleep(seconds * 1000);

            AgentResumePacket resume = new AgentResumePacket();

            resume.AgentData.AgentID   = Client.Self.AgentID;
            resume.AgentData.SessionID = Client.Self.SessionID;
            resume.AgentData.SerialNum = pause.AgentData.SerialNum;

            Client.Network.SendPacket(resume);

            return(Success("Paused, slept for " + seconds + " second(s), and resumed"));
        }
예제 #4
0
        public override string Execute(string[] args, UUID fromAgentID)
        {
            int seconds;

            if (args.Length != 1 || !Int32.TryParse(args[0], out seconds))
            {
                return("Usage: sleep [seconds]");
            }

            AgentPausePacket pause = new AgentPausePacket();

            pause.AgentData.AgentID   = Client.Self.AgentID;
            pause.AgentData.SessionID = Client.Self.SessionID;
            pause.AgentData.SerialNum = sleepSerialNum++;

            Client.Network.SendPacket(pause);

            // Sleep
            System.Threading.Thread.Sleep(seconds * 1000);

            AgentResumePacket resume = new AgentResumePacket();

            resume.AgentData.AgentID   = Client.Self.AgentID;
            resume.AgentData.SessionID = Client.Self.SessionID;
            resume.AgentData.SerialNum = pause.AgentData.SerialNum;

            Client.Network.SendPacket(resume);

            return("Paused, slept for " + seconds + " second(s), and resumed");
        }
예제 #5
0
        /// <summary>
        /// Instructs the simulator to stop sending update (and possibly other) packets
        /// </summary>
        public void Pause()
        {
            AgentPausePacket pause = new AgentPausePacket();

            pause.AgentData.AgentID   = Client.Self.AgentID;
            pause.AgentData.SessionID = Client.Self.SessionID;
            pause.AgentData.SerialNum = (uint)Interlocked.Exchange(ref pauseSerial, pauseSerial + 1);

            Client.Network.SendPacket(pause, this);
        }
예제 #6
0
        /// <summary>
        /// Instructs the simulator to stop sending update (and possibly other) packets
        /// </summary>
        public void Pause()
        {
            AgentPausePacket pause = new AgentPausePacket();
            pause.AgentData.AgentID = Client.Self.AgentID;
            pause.AgentData.SessionID = Client.Self.SessionID;
            pause.AgentData.SerialNum = (uint)Interlocked.Exchange(ref pauseSerial, pauseSerial + 1);

            Client.Network.SendPacket(pause, this);
        }