aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ExportBot/Commands/Movement/StandCommand.cs
blob: 8a0055296d625a0e3133eed488bbe861ac7ce6cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;

namespace libsecondlife.TestClient
{
    public class StandCommand: Command
    {
        public StandCommand(TestClient testClient)
	{
		Name = "stand";
		Description = "Stand";
	}
	
        public override string Execute(string[] args, LLUUID fromAgentID)
	{
		Client.Self.Status.StandUp = true;
		stand(Client);
		return "Standing up.";  
	}

        void stand(SecondLife client)
        {
            SendAgentUpdate(client, (uint)MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP);
        }

        const float DRAW_DISTANCE = 96.0f;
        void SendAgentUpdate(SecondLife client, uint ControlID)
        {
            AgentUpdatePacket p = new AgentUpdatePacket();
            p.AgentData.Far = DRAW_DISTANCE;
            //LLVector3 myPos = client.Self.Position;
            p.AgentData.CameraCenter = new LLVector3(0, 0, 0);
            p.AgentData.CameraAtAxis = new LLVector3(0, 0, 0);
            p.AgentData.CameraLeftAxis = new LLVector3(0, 0, 0);
            p.AgentData.CameraUpAxis = new LLVector3(0, 0, 0);
            p.AgentData.HeadRotation = new LLQuaternion(0, 0, 0, 1); ;
            p.AgentData.BodyRotation = new LLQuaternion(0, 0, 0, 1); ;
            p.AgentData.AgentID = client.Network.AgentID;
            p.AgentData.SessionID = client.Network.SessionID;
            p.AgentData.ControlFlags = ControlID;
            client.Network.SendPacket(p);
        }
    }
}