aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/world
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/world/Avatar.cs39
-rw-r--r--OpenSim.RegionServer/world/Primitive.cs27
-rw-r--r--OpenSim.RegionServer/world/World.cs31
3 files changed, 61 insertions, 36 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");
diff --git a/OpenSim.RegionServer/world/Primitive.cs b/OpenSim.RegionServer/world/Primitive.cs
index 6ff66a3..a185f0b 100644
--- a/OpenSim.RegionServer/world/Primitive.cs
+++ b/OpenSim.RegionServer/world/Primitive.cs
@@ -22,6 +22,9 @@ namespace OpenSim.world
22 private PhysicsActor _physActor; 22 private PhysicsActor _physActor;
23 private bool physicsEnabled = false; 23 private bool physicsEnabled = false;
24 private bool physicstest = false; //just added for testing 24 private bool physicstest = false; //just added for testing
25 private Dictionary<uint, SimClient> m_clientThreads;
26 private ulong m_regionHandle;
27 private World m_world;
25 28
26 public bool PhysicsEnabled 29 public bool PhysicsEnabled
27 { 30 {
@@ -65,10 +68,14 @@ namespace OpenSim.world
65 } 68 }
66 } 69 }
67 70
68 public Primitive() 71 public Primitive(Dictionary<uint, SimClient> clientThreads, ulong regionHandle, World world)
69 { 72 {
70 mesh_cutbegin = 0.0f; 73 mesh_cutbegin = 0.0f;
71 mesh_cutend = 1.0f; 74 mesh_cutend = 1.0f;
75
76 m_clientThreads = clientThreads;
77 m_regionHandle = regionHandle;
78 m_world = world;
72 } 79 }
73 80
74 public override Mesh getMesh() 81 public override Mesh getMesh()
@@ -99,7 +106,7 @@ namespace OpenSim.world
99 { 106 {
100 if (this.newPrimFlag) 107 if (this.newPrimFlag)
101 { 108 {
102 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) 109 foreach (SimClient client in m_clientThreads.Values)
103 { 110 {
104 client.OutPacket(OurPacket); 111 client.OutPacket(OurPacket);
105 } 112 }
@@ -108,11 +115,11 @@ namespace OpenSim.world
108 else if (this.updateFlag) 115 else if (this.updateFlag)
109 { 116 {
110 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 117 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
111 terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME 118 terse.RegionData.RegionHandle = m_regionHandle; // FIXME
112 terse.RegionData.TimeDilation = 64096; 119 terse.RegionData.TimeDilation = 64096;
113 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 120 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
114 terse.ObjectData[0] = this.CreateImprovedBlock(); 121 terse.ObjectData[0] = this.CreateImprovedBlock();
115 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) 122 foreach (SimClient client in m_clientThreads.Values)
116 { 123 {
117 client.OutPacket(terse); 124 client.OutPacket(terse);
118 } 125 }
@@ -120,7 +127,7 @@ namespace OpenSim.world
120 } 127 }
121 else if (this.dirtyFlag) 128 else if (this.dirtyFlag)
122 { 129 {
123 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) 130 foreach (SimClient client in m_clientThreads.Values)
124 { 131 {
125 UpdateClient(client); 132 UpdateClient(client);
126 } 133 }
@@ -131,11 +138,11 @@ namespace OpenSim.world
131 if (this._physActor != null && this.physicsEnabled) 138 if (this._physActor != null && this.physicsEnabled)
132 { 139 {
133 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 140 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
134 terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME 141 terse.RegionData.RegionHandle = m_regionHandle; // FIXME
135 terse.RegionData.TimeDilation = 64096; 142 terse.RegionData.TimeDilation = 64096;
136 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 143 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
137 terse.ObjectData[0] = this.CreateImprovedBlock(); 144 terse.ObjectData[0] = this.CreateImprovedBlock();
138 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) 145 foreach (SimClient client in m_clientThreads.Values)
139 { 146 {
140 client.OutPacket(terse); 147 client.OutPacket(terse);
141 } 148 }
@@ -255,7 +262,7 @@ namespace OpenSim.world
255 public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) 262 public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID)
256 { 263 {
257 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 264 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
258 objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; 265 objupdate.RegionData.RegionHandle = m_regionHandle;
259 objupdate.RegionData.TimeDilation = 64096; 266 objupdate.RegionData.TimeDilation = 64096;
260 267
261 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 268 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
@@ -323,7 +330,7 @@ namespace OpenSim.world
323 { 330 {
324 //need to clean this up as it shares a lot of code with CreateFromPacket() 331 //need to clean this up as it shares a lot of code with CreateFromPacket()
325 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 332 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
326 objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; 333 objupdate.RegionData.RegionHandle = m_regionHandle;
327 objupdate.RegionData.TimeDilation = 64096; 334 objupdate.RegionData.TimeDilation = 64096;
328 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 335 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
329 336
@@ -480,7 +487,7 @@ namespace OpenSim.world
480 this.primData.LocalID = this.localid; 487 this.primData.LocalID = this.localid;
481 this.primData.Position = this.position; 488 this.primData.Position = this.position;
482 this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w); 489 this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w);
483 OpenSimRoot.Instance.LocalWorld.localStorage.StorePrim(this.primData); 490 m_world.localStorage.StorePrim(this.primData);
484 } 491 }
485 } 492 }
486 493
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs
index e6d8921..0d126e6 100644
--- a/OpenSim.RegionServer/world/World.cs
+++ b/OpenSim.RegionServer/world/World.cs
@@ -25,10 +25,19 @@ namespace OpenSim.world
25 private Random Rand = new Random(); 25 private Random Rand = new Random();
26 private uint _primCount = 702000; 26 private uint _primCount = 702000;
27 private int storageCount; 27 private int storageCount;
28 private Dictionary<uint, SimClient> m_clientThreads;
29 private ulong m_regionHandle;
30 private string m_regionName;
31 private SimConfig m_cfg;
28 32
29 public World() 33 public World(Dictionary<uint, SimClient> clientThreads, ulong regionHandle, string regionName, SimConfig cfg)
30 { 34 {
31 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating new entitities instance"); 35 m_clientThreads = clientThreads;
36 m_regionHandle = regionHandle;
37 m_regionName = regionName;
38 m_cfg = cfg;
39
40 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating new entitities instance");
32 Entities = new Dictionary<libsecondlife.LLUUID, Entity>(); 41 Entities = new Dictionary<libsecondlife.LLUUID, Entity>();
33 42
34 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); 43 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap");
@@ -115,9 +124,9 @@ namespace OpenSim.world
115 HeightmapGenHills hills = new HeightmapGenHills(); 124 HeightmapGenHills hills = new HeightmapGenHills();
116 this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); 125 this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
117 this.phyScene.SetTerrain(this.LandMap); 126 this.phyScene.SetTerrain(this.LandMap);
118 OpenSimRoot.Instance.Cfg.SaveMap(this.LandMap); 127 m_cfg.SaveMap(this.LandMap);
119 128
120 foreach(SimClient client in OpenSimRoot.Instance.ClientThreads.Values) { 129 foreach(SimClient client in m_clientThreads.Values) {
121 this.SendLayerData(client); 130 this.SendLayerData(client);
122 } 131 }
123 } 132 }
@@ -134,7 +143,7 @@ namespace OpenSim.world
134 _primCount = prim.LocalID + 1; 143 _primCount = prim.LocalID + 1;
135 } 144 }
136 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId "+ prim.LocalID+ " ) from storage"); 145 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId "+ prim.LocalID+ " ) from storage");
137 Primitive nPrim = new Primitive(); 146 Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
138 nPrim.CreateFromStorage(prim); 147 nPrim.CreateFromStorage(prim);
139 this.Entities.Add(nPrim.uuid, nPrim); 148 this.Entities.Add(nPrim.uuid, nPrim);
140 } 149 }
@@ -175,7 +184,7 @@ namespace OpenSim.world
175 184
176 public void AddViewerAgent(SimClient AgentClient) { 185 public void AddViewerAgent(SimClient AgentClient) {
177 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); 186 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
178 Avatar NewAvatar = new Avatar(AgentClient); 187 Avatar NewAvatar = new Avatar(AgentClient, this, m_regionName, m_clientThreads, m_regionHandle );
179 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); 188 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world");
180 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); 189 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake ");
181 NewAvatar.SendRegionHandshake(this); 190 NewAvatar.SendRegionHandshake(this);
@@ -187,7 +196,7 @@ namespace OpenSim.world
187 public void AddNewPrim(ObjectAddPacket addPacket, SimClient AgentClient) 196 public void AddNewPrim(ObjectAddPacket addPacket, SimClient AgentClient)
188 { 197 {
189 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim"); 198 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim");
190 Primitive prim = new Primitive(); 199 Primitive prim = new Primitive(m_clientThreads, m_regionHandle, this );
191 prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount); 200 prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount);
192 PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z); 201 PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z);
193 PhysicsVector pSize = new PhysicsVector( 0.255f, 0.255f, 0.255f); 202 PhysicsVector pSize = new PhysicsVector( 0.255f, 0.255f, 0.255f);
@@ -210,7 +219,7 @@ namespace OpenSim.world
210 foreach( DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData ) 219 foreach( DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData )
211 { 220 {
212 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); 221 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
213 foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) 222 foreach (Entity ent in this.Entities.Values)
214 { 223 {
215 if (ent.localid == Data.ObjectLocalID) 224 if (ent.localid == Data.ObjectLocalID)
216 { 225 {
@@ -220,7 +229,7 @@ namespace OpenSim.world
220 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; 229 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
221 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); 230 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
222 kill.ObjectData[0].ID = ent.localid; 231 kill.ObjectData[0].ID = ent.localid;
223 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) 232 foreach (SimClient client in m_clientThreads.Values)
224 { 233 {
225 client.OutPacket(kill); 234 client.OutPacket(kill);
226 } 235 }
@@ -234,9 +243,9 @@ namespace OpenSim.world
234 } 243 }
235 foreach( libsecondlife.LLUUID uuid in DeRezEnts ) 244 foreach( libsecondlife.LLUUID uuid in DeRezEnts )
236 { 245 {
237 lock (OpenSimRoot.Instance.LocalWorld.Entities) 246 lock (this.Entities)
238 { 247 {
239 OpenSimRoot.Instance.LocalWorld.Entities.Remove(uuid); 248 this.Entities.Remove(uuid);
240 } 249 }
241 } 250 }
242 251