aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/world/Avatar.cs
diff options
context:
space:
mode:
authorlbsa712007-03-27 19:12:55 +0000
committerlbsa712007-03-27 19:12:55 +0000
commitccfddd1775fe2786ad54b7bbfe528e7eb65170b1 (patch)
treee9f60b7bdb0b84917ed060159814357ea80321c4 /OpenSim.RegionServer/world/Avatar.cs
parent* Introduced BaseHttpServer (doing nothing at the moment) (diff)
downloadopensim-SC-ccfddd1775fe2786ad54b7bbfe528e7eb65170b1.zip
opensim-SC-ccfddd1775fe2786ad54b7bbfe528e7eb65170b1.tar.gz
opensim-SC-ccfddd1775fe2786ad54b7bbfe528e7eb65170b1.tar.bz2
opensim-SC-ccfddd1775fe2786ad54b7bbfe528e7eb65170b1.tar.xz
* Continued refactoring away OpenSimRoot - now it's down to the final 2.
Diffstat (limited to 'OpenSim.RegionServer/world/Avatar.cs')
-rw-r--r--OpenSim.RegionServer/world/Avatar.cs39
1 files changed, 24 insertions, 15 deletions
diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs
index 75f2cff..2ae9992 100644
--- a/OpenSim.RegionServer/world/Avatar.cs
+++ b/OpenSim.RegionServer/world/Avatar.cs
@@ -30,14 +30,23 @@ namespace OpenSim.world
30 private byte[] visualParams; 30 private byte[] visualParams;
31 private AvatarWearable[] Wearables; 31 private AvatarWearable[] Wearables;
32 private LLVector3 positionLastFrame = new LLVector3(0, 0, 0); 32 private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
33 private World m_world;
34 private ulong m_regionHandle;
35 private Dictionary<uint, SimClient> m_clientThreads;
36 private string m_regionName;
33 37
34 public Avatar(SimClient TheClient) 38 public Avatar(SimClient TheClient, World world, string regionName, Dictionary<uint, SimClient> clientThreads, ulong regionHandle)
35 { 39 {
40 m_world = world;
41 m_clientThreads = clientThreads;
42 m_regionName = regionName;
43 m_regionHandle = regionHandle;
44
36 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); 45 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)");
37 ControllingClient = TheClient; 46 ControllingClient = TheClient;
38 localid = 8880000 + (OpenSimRoot.Instance.LocalWorld._localNumber++); 47 localid = 8880000 + (m_world._localNumber++);
39 position = new LLVector3(100.0f, 100.0f, 30.0f); 48 position = new LLVector3(100.0f, 100.0f, 30.0f);
40 position.Z = OpenSimRoot.Instance.LocalWorld.LandMap[(int)position.Y * 256 + (int)position.X] + 1; 49 position.Z = m_world.LandMap[(int)position.Y * 256 + (int)position.X] + 1;
41 visualParams = new byte[218]; 50 visualParams = new byte[218];
42 for (int i = 0; i < 218; i++) 51 for (int i = 0; i < 218; i++)
43 { 52 {
@@ -52,7 +61,7 @@ namespace OpenSim.world
52 this.Wearables[0].ItemID = LLUUID.Random(); 61 this.Wearables[0].ItemID = LLUUID.Random();
53 62
54 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); 63 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
55 64
56 } 65 }
57 66
58 public PhysicsActor PhysActor 67 public PhysicsActor PhysActor
@@ -96,11 +105,11 @@ namespace OpenSim.world
96 //use CreateTerseBlock() 105 //use CreateTerseBlock()
97 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); 106 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
98 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 107 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
99 terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME 108 terse.RegionData.RegionHandle = m_regionHandle; // FIXME
100 terse.RegionData.TimeDilation = 64096; 109 terse.RegionData.TimeDilation = 64096;
101 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 110 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
102 terse.ObjectData[0] = terseBlock; 111 terse.ObjectData[0] = terseBlock;
103 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) 112 foreach (SimClient client in m_clientThreads.Values)
104 { 113 {
105 client.OutPacket(terse); 114 client.OutPacket(terse);
106 } 115 }
@@ -119,11 +128,11 @@ namespace OpenSim.world
119 //It has been a while since last update was sent so lets send one. 128 //It has been a while since last update was sent so lets send one.
120 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); 129 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
121 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 130 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
122 terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME 131 terse.RegionData.RegionHandle = m_regionHandle; // FIXME
123 terse.RegionData.TimeDilation = 64096; 132 terse.RegionData.TimeDilation = 64096;
124 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 133 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
125 terse.ObjectData[0] = terseBlock; 134 terse.ObjectData[0] = terseBlock;
126 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) 135 foreach (SimClient client in m_clientThreads.Values)
127 { 136 {
128 client.OutPacket(terse); 137 client.OutPacket(terse);
129 } 138 }
@@ -172,7 +181,7 @@ namespace OpenSim.world
172 AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); 181 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
173 mov.AgentData.SessionID = this.ControllingClient.SessionID; 182 mov.AgentData.SessionID = this.ControllingClient.SessionID;
174 mov.AgentData.AgentID = this.ControllingClient.AgentID; 183 mov.AgentData.AgentID = this.ControllingClient.AgentID;
175 mov.Data.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; 184 mov.Data.RegionHandle = m_regionHandle;
176 // TODO - dynamicalise this stuff 185 // TODO - dynamicalise this stuff
177 mov.Data.Timestamp = 1172750370; 186 mov.Data.Timestamp = 1172750370;
178 mov.Data.Position = new LLVector3(100f, 100f, 23f); 187 mov.Data.Position = new LLVector3(100f, 100f, 23f);
@@ -187,7 +196,7 @@ namespace OpenSim.world
187 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 196 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
188 //send a objectupdate packet with information about the clients avatar 197 //send a objectupdate packet with information about the clients avatar
189 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 198 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
190 objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; 199 objupdate.RegionData.RegionHandle = m_regionHandle;
191 objupdate.RegionData.TimeDilation = 64096; 200 objupdate.RegionData.TimeDilation = 64096;
192 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 201 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
193 202
@@ -202,9 +211,9 @@ namespace OpenSim.world
202 byte[] pb = pos2.GetBytes(); 211 byte[] pb = pos2.GetBytes();
203 212
204 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); 213 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
205 OpenSimRoot.Instance.LocalWorld._localNumber++; 214 m_world._localNumber++;
206 215
207 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) 216 foreach (SimClient client in m_clientThreads.Values)
208 { 217 {
209 client.OutPacket(objupdate); 218 client.OutPacket(objupdate);
210 if (client.AgentID != ControllingClient.AgentID) 219 if (client.AgentID != ControllingClient.AgentID)
@@ -241,7 +250,7 @@ namespace OpenSim.world
241 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 250 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
242 //send a objectupdate packet with information about the clients avatar 251 //send a objectupdate packet with information about the clients avatar
243 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 252 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
244 objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; 253 objupdate.RegionData.RegionHandle = m_regionHandle;
245 objupdate.RegionData.TimeDilation = 64096; 254 objupdate.RegionData.TimeDilation = 64096;
246 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 255 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
247 256
@@ -293,7 +302,7 @@ namespace OpenSim.world
293 this.visualParams[i] = appear.VisualParam[i].ParamValue; 302 this.visualParams[i] = appear.VisualParam[i].ParamValue;
294 } 303 }
295 304
296 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) 305 foreach (SimClient client in m_clientThreads.Values)
297 { 306 {
298 if (client.AgentID != ControllingClient.AgentID) 307 if (client.AgentID != ControllingClient.AgentID)
299 { 308 {
@@ -490,7 +499,7 @@ namespace OpenSim.world
490 handshake.RegionInfo.SimAccess = 13; 499 handshake.RegionInfo.SimAccess = 13;
491 handshake.RegionInfo.WaterHeight = 20; 500 handshake.RegionInfo.WaterHeight = 20;
492 handshake.RegionInfo.RegionFlags = 72458694; 501 handshake.RegionInfo.RegionFlags = 72458694;
493 handshake.RegionInfo.SimName = _enc.GetBytes(OpenSimRoot.Instance.Cfg.RegionName + "\0"); 502 handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0");
494 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000"); 503 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
495 handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); 504 handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975");
496 handshake.RegionInfo.TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); 505 handshake.RegionInfo.TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3");