aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/world/Avatar.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/world/Avatar.cs')
-rw-r--r--src/world/Avatar.cs70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/world/Avatar.cs b/src/world/Avatar.cs
new file mode 100644
index 0000000..863ce29
--- /dev/null
+++ b/src/world/Avatar.cs
@@ -0,0 +1,70 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using libsecondlife.Packets;
6
7namespace OpenSim.world
8{
9 public class Avatar : Entity
10 {
11 public string firstname;
12 public string lastname;
13 public OpenSimClient ControllingClient;
14
15 public Avatar(OpenSimClient TheClient) {
16 Console.WriteLine("Avatar.cs - Loading details from grid (DUMMY)");
17 ControllingClient=TheClient;
18 }
19
20 public void CompleteMovement(World RegionInfo) {
21 Console.WriteLine("Avatar.cs:CompleteMovement() - Constructing AgentMovementComplete packet");
22 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
23 mov.AgentData.SessionID = this.ControllingClient.SessionID;
24 mov.AgentData.AgentID = this.ControllingClient.AgentID;
25 mov.Data.RegionHandle = OpenSim_Main.cfg.RegionHandle;
26 // TODO - dynamicalise this stuff
27 mov.Data.Timestamp = 1169838966;
28 mov.Data.Position = new LLVector3(100f, 100f, 22f);
29 mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0);
30
31 Console.WriteLine("Sending AgentMovementComplete packet");
32 ControllingClient.OutPacket(mov);
33 }
34
35 public void SendRegionHandshake(World RegionInfo) {
36 Console.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
37 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
38 RegionHandshakePacket handshake = new RegionHandshakePacket();
39
40 Console.WriteLine("Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details");
41 handshake.RegionInfo.BillableFactor = 0;
42 handshake.RegionInfo.IsEstateManager = false;
43 handshake.RegionInfo.TerrainHeightRange00 = 60;
44 handshake.RegionInfo.TerrainHeightRange01 = 60;
45 handshake.RegionInfo.TerrainHeightRange10 = 60;
46 handshake.RegionInfo.TerrainHeightRange11 = 60;
47 handshake.RegionInfo.TerrainStartHeight00 = 20;
48 handshake.RegionInfo.TerrainStartHeight01 = 20;
49 handshake.RegionInfo.TerrainStartHeight10 = 20;
50 handshake.RegionInfo.TerrainStartHeight11 = 20;
51 handshake.RegionInfo.SimAccess = 13;
52 handshake.RegionInfo.WaterHeight = 5;
53 handshake.RegionInfo.RegionFlags = 72458694;
54 handshake.RegionInfo.SimName = _enc.GetBytes(OpenSim_Main.cfg.RegionName + "\0");
55 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
56 handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975");
57 handshake.RegionInfo.TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3");
58 handshake.RegionInfo.TerrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f");
59 handshake.RegionInfo.TerrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2");
60 handshake.RegionInfo.TerrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000");
61 handshake.RegionInfo.TerrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000");
62 handshake.RegionInfo.TerrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000");
63 handshake.RegionInfo.TerrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000");
64 handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37");
65
66 Console.WriteLine("Avatar.cs:SendRegionHandshake() - Sending RegionHandshake packet");
67 this.ControllingClient.OutPacket(handshake);
68 }
69 }
70}