diff options
Diffstat (limited to '')
-rw-r--r-- | ExportBot/Commands/Movement/StandCommand.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/ExportBot/Commands/Movement/StandCommand.cs b/ExportBot/Commands/Movement/StandCommand.cs new file mode 100644 index 0000000..8a00552 --- /dev/null +++ b/ExportBot/Commands/Movement/StandCommand.cs | |||
@@ -0,0 +1,47 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using libsecondlife; | ||
5 | using libsecondlife.Packets; | ||
6 | |||
7 | namespace libsecondlife.TestClient | ||
8 | { | ||
9 | public class StandCommand: Command | ||
10 | { | ||
11 | public StandCommand(TestClient testClient) | ||
12 | { | ||
13 | Name = "stand"; | ||
14 | Description = "Stand"; | ||
15 | } | ||
16 | |||
17 | public override string Execute(string[] args, LLUUID fromAgentID) | ||
18 | { | ||
19 | Client.Self.Status.StandUp = true; | ||
20 | stand(Client); | ||
21 | return "Standing up."; | ||
22 | } | ||
23 | |||
24 | void stand(SecondLife client) | ||
25 | { | ||
26 | SendAgentUpdate(client, (uint)MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP); | ||
27 | } | ||
28 | |||
29 | const float DRAW_DISTANCE = 96.0f; | ||
30 | void SendAgentUpdate(SecondLife client, uint ControlID) | ||
31 | { | ||
32 | AgentUpdatePacket p = new AgentUpdatePacket(); | ||
33 | p.AgentData.Far = DRAW_DISTANCE; | ||
34 | //LLVector3 myPos = client.Self.Position; | ||
35 | p.AgentData.CameraCenter = new LLVector3(0, 0, 0); | ||
36 | p.AgentData.CameraAtAxis = new LLVector3(0, 0, 0); | ||
37 | p.AgentData.CameraLeftAxis = new LLVector3(0, 0, 0); | ||
38 | p.AgentData.CameraUpAxis = new LLVector3(0, 0, 0); | ||
39 | p.AgentData.HeadRotation = new LLQuaternion(0, 0, 0, 1); ; | ||
40 | p.AgentData.BodyRotation = new LLQuaternion(0, 0, 0, 1); ; | ||
41 | p.AgentData.AgentID = client.Network.AgentID; | ||
42 | p.AgentData.SessionID = client.Network.SessionID; | ||
43 | p.AgentData.ControlFlags = ControlID; | ||
44 | client.Network.SendPacket(p); | ||
45 | } | ||
46 | } | ||
47 | } | ||