aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/world
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim.RegionServer/world')
-rw-r--r--OpenSim.RegionServer/world/Avatar.cs39
-rw-r--r--OpenSim.RegionServer/world/Primitive.cs27
-rw-r--r--OpenSim.RegionServer/world/World.cs33
3 files changed, 36 insertions, 63 deletions
diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs
index 2ae9992..75f2cff 100644
--- a/OpenSim.RegionServer/world/Avatar.cs
+++ b/OpenSim.RegionServer/world/Avatar.cs
@@ -30,23 +30,14 @@ 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;
37 33
38 public Avatar(SimClient TheClient, World world, string regionName, Dictionary<uint, SimClient> clientThreads, ulong regionHandle) 34 public Avatar(SimClient TheClient)
39 { 35 {
40 m_world = world;
41 m_clientThreads = clientThreads;
42 m_regionName = regionName;
43 m_regionHandle = regionHandle;
44
45 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); 36 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)");
46 ControllingClient = TheClient; 37 ControllingClient = TheClient;
47 localid = 8880000 + (m_world._localNumber++); 38 localid = 8880000 + (OpenSimRoot.Instance.LocalWorld._localNumber++);
48 position = new LLVector3(100.0f, 100.0f, 30.0f); 39 position = new LLVector3(100.0f, 100.0f, 30.0f);
49 position.Z = m_world.LandMap[(int)position.Y * 256 + (int)position.X] + 1; 40 position.Z = OpenSimRoot.Instance.LocalWorld.LandMap[(int)position.Y * 256 + (int)position.X] + 1;
50 visualParams = new byte[218]; 41 visualParams = new byte[218];
51 for (int i = 0; i < 218; i++) 42 for (int i = 0; i < 218; i++)
52 { 43 {
@@ -61,7 +52,7 @@ namespace OpenSim.world
61 this.Wearables[0].ItemID = LLUUID.Random(); 52 this.Wearables[0].ItemID = LLUUID.Random();
62 53
63 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); 54 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
64 55
65 } 56 }
66 57
67 public PhysicsActor PhysActor 58 public PhysicsActor PhysActor
@@ -105,11 +96,11 @@ namespace OpenSim.world
105 //use CreateTerseBlock() 96 //use CreateTerseBlock()
106 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); 97 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
107 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 98 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
108 terse.RegionData.RegionHandle = m_regionHandle; // FIXME 99 terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME
109 terse.RegionData.TimeDilation = 64096; 100 terse.RegionData.TimeDilation = 64096;
110 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 101 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
111 terse.ObjectData[0] = terseBlock; 102 terse.ObjectData[0] = terseBlock;
112 foreach (SimClient client in m_clientThreads.Values) 103 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
113 { 104 {
114 client.OutPacket(terse); 105 client.OutPacket(terse);
115 } 106 }
@@ -128,11 +119,11 @@ namespace OpenSim.world
128 //It has been a while since last update was sent so lets send one. 119 //It has been a while since last update was sent so lets send one.
129 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); 120 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
130 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 121 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
131 terse.RegionData.RegionHandle = m_regionHandle; // FIXME 122 terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME
132 terse.RegionData.TimeDilation = 64096; 123 terse.RegionData.TimeDilation = 64096;
133 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 124 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
134 terse.ObjectData[0] = terseBlock; 125 terse.ObjectData[0] = terseBlock;
135 foreach (SimClient client in m_clientThreads.Values) 126 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
136 { 127 {
137 client.OutPacket(terse); 128 client.OutPacket(terse);
138 } 129 }
@@ -181,7 +172,7 @@ namespace OpenSim.world
181 AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); 172 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
182 mov.AgentData.SessionID = this.ControllingClient.SessionID; 173 mov.AgentData.SessionID = this.ControllingClient.SessionID;
183 mov.AgentData.AgentID = this.ControllingClient.AgentID; 174 mov.AgentData.AgentID = this.ControllingClient.AgentID;
184 mov.Data.RegionHandle = m_regionHandle; 175 mov.Data.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle;
185 // TODO - dynamicalise this stuff 176 // TODO - dynamicalise this stuff
186 mov.Data.Timestamp = 1172750370; 177 mov.Data.Timestamp = 1172750370;
187 mov.Data.Position = new LLVector3(100f, 100f, 23f); 178 mov.Data.Position = new LLVector3(100f, 100f, 23f);
@@ -196,7 +187,7 @@ namespace OpenSim.world
196 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 187 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
197 //send a objectupdate packet with information about the clients avatar 188 //send a objectupdate packet with information about the clients avatar
198 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 189 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
199 objupdate.RegionData.RegionHandle = m_regionHandle; 190 objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle;
200 objupdate.RegionData.TimeDilation = 64096; 191 objupdate.RegionData.TimeDilation = 64096;
201 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 192 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
202 193
@@ -211,9 +202,9 @@ namespace OpenSim.world
211 byte[] pb = pos2.GetBytes(); 202 byte[] pb = pos2.GetBytes();
212 203
213 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); 204 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
214 m_world._localNumber++; 205 OpenSimRoot.Instance.LocalWorld._localNumber++;
215 206
216 foreach (SimClient client in m_clientThreads.Values) 207 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
217 { 208 {
218 client.OutPacket(objupdate); 209 client.OutPacket(objupdate);
219 if (client.AgentID != ControllingClient.AgentID) 210 if (client.AgentID != ControllingClient.AgentID)
@@ -250,7 +241,7 @@ namespace OpenSim.world
250 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 241 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
251 //send a objectupdate packet with information about the clients avatar 242 //send a objectupdate packet with information about the clients avatar
252 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 243 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
253 objupdate.RegionData.RegionHandle = m_regionHandle; 244 objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle;
254 objupdate.RegionData.TimeDilation = 64096; 245 objupdate.RegionData.TimeDilation = 64096;
255 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 246 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
256 247
@@ -302,7 +293,7 @@ namespace OpenSim.world
302 this.visualParams[i] = appear.VisualParam[i].ParamValue; 293 this.visualParams[i] = appear.VisualParam[i].ParamValue;
303 } 294 }
304 295
305 foreach (SimClient client in m_clientThreads.Values) 296 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
306 { 297 {
307 if (client.AgentID != ControllingClient.AgentID) 298 if (client.AgentID != ControllingClient.AgentID)
308 { 299 {
@@ -499,7 +490,7 @@ namespace OpenSim.world
499 handshake.RegionInfo.SimAccess = 13; 490 handshake.RegionInfo.SimAccess = 13;
500 handshake.RegionInfo.WaterHeight = 20; 491 handshake.RegionInfo.WaterHeight = 20;
501 handshake.RegionInfo.RegionFlags = 72458694; 492 handshake.RegionInfo.RegionFlags = 72458694;
502 handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0"); 493 handshake.RegionInfo.SimName = _enc.GetBytes(OpenSimRoot.Instance.Cfg.RegionName + "\0");
503 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000"); 494 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
504 handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); 495 handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975");
505 handshake.RegionInfo.TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); 496 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 a185f0b..6ff66a3 100644
--- a/OpenSim.RegionServer/world/Primitive.cs
+++ b/OpenSim.RegionServer/world/Primitive.cs
@@ -22,9 +22,6 @@ 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;
28 25
29 public bool PhysicsEnabled 26 public bool PhysicsEnabled
30 { 27 {
@@ -68,14 +65,10 @@ namespace OpenSim.world
68 } 65 }
69 } 66 }
70 67
71 public Primitive(Dictionary<uint, SimClient> clientThreads, ulong regionHandle, World world) 68 public Primitive()
72 { 69 {
73 mesh_cutbegin = 0.0f; 70 mesh_cutbegin = 0.0f;
74 mesh_cutend = 1.0f; 71 mesh_cutend = 1.0f;
75
76 m_clientThreads = clientThreads;
77 m_regionHandle = regionHandle;
78 m_world = world;
79 } 72 }
80 73
81 public override Mesh getMesh() 74 public override Mesh getMesh()
@@ -106,7 +99,7 @@ namespace OpenSim.world
106 { 99 {
107 if (this.newPrimFlag) 100 if (this.newPrimFlag)
108 { 101 {
109 foreach (SimClient client in m_clientThreads.Values) 102 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
110 { 103 {
111 client.OutPacket(OurPacket); 104 client.OutPacket(OurPacket);
112 } 105 }
@@ -115,11 +108,11 @@ namespace OpenSim.world
115 else if (this.updateFlag) 108 else if (this.updateFlag)
116 { 109 {
117 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 110 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
118 terse.RegionData.RegionHandle = m_regionHandle; // FIXME 111 terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME
119 terse.RegionData.TimeDilation = 64096; 112 terse.RegionData.TimeDilation = 64096;
120 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 113 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
121 terse.ObjectData[0] = this.CreateImprovedBlock(); 114 terse.ObjectData[0] = this.CreateImprovedBlock();
122 foreach (SimClient client in m_clientThreads.Values) 115 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
123 { 116 {
124 client.OutPacket(terse); 117 client.OutPacket(terse);
125 } 118 }
@@ -127,7 +120,7 @@ namespace OpenSim.world
127 } 120 }
128 else if (this.dirtyFlag) 121 else if (this.dirtyFlag)
129 { 122 {
130 foreach (SimClient client in m_clientThreads.Values) 123 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
131 { 124 {
132 UpdateClient(client); 125 UpdateClient(client);
133 } 126 }
@@ -138,11 +131,11 @@ namespace OpenSim.world
138 if (this._physActor != null && this.physicsEnabled) 131 if (this._physActor != null && this.physicsEnabled)
139 { 132 {
140 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); 133 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
141 terse.RegionData.RegionHandle = m_regionHandle; // FIXME 134 terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME
142 terse.RegionData.TimeDilation = 64096; 135 terse.RegionData.TimeDilation = 64096;
143 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 136 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
144 terse.ObjectData[0] = this.CreateImprovedBlock(); 137 terse.ObjectData[0] = this.CreateImprovedBlock();
145 foreach (SimClient client in m_clientThreads.Values) 138 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
146 { 139 {
147 client.OutPacket(terse); 140 client.OutPacket(terse);
148 } 141 }
@@ -262,7 +255,7 @@ namespace OpenSim.world
262 public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) 255 public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID)
263 { 256 {
264 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 257 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
265 objupdate.RegionData.RegionHandle = m_regionHandle; 258 objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle;
266 objupdate.RegionData.TimeDilation = 64096; 259 objupdate.RegionData.TimeDilation = 64096;
267 260
268 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 261 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
@@ -330,7 +323,7 @@ namespace OpenSim.world
330 { 323 {
331 //need to clean this up as it shares a lot of code with CreateFromPacket() 324 //need to clean this up as it shares a lot of code with CreateFromPacket()
332 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 325 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
333 objupdate.RegionData.RegionHandle = m_regionHandle; 326 objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle;
334 objupdate.RegionData.TimeDilation = 64096; 327 objupdate.RegionData.TimeDilation = 64096;
335 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 328 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
336 329
@@ -487,7 +480,7 @@ namespace OpenSim.world
487 this.primData.LocalID = this.localid; 480 this.primData.LocalID = this.localid;
488 this.primData.Position = this.position; 481 this.primData.Position = this.position;
489 this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w); 482 this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w);
490 m_world.localStorage.StorePrim(this.primData); 483 OpenSimRoot.Instance.LocalWorld.localStorage.StorePrim(this.primData);
491 } 484 }
492 } 485 }
493 486
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs
index 7605f9e..e6d8921 100644
--- a/OpenSim.RegionServer/world/World.cs
+++ b/OpenSim.RegionServer/world/World.cs
@@ -25,21 +25,10 @@ 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 World m_world;
31 private string m_regionName;
32 private SimConfig m_cfg;
33 28
34 public World(Dictionary<uint, SimClient> clientThreads, ulong regionHandle, World world, string regionName, SimConfig cfg) 29 public World()
35 { 30 {
36 m_clientThreads = clientThreads; 31 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating new entitities instance");
37 m_regionHandle = regionHandle;
38 m_world = world;
39 m_regionName = regionName;
40 m_cfg = cfg;
41
42 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating new entitities instance");
43 Entities = new Dictionary<libsecondlife.LLUUID, Entity>(); 32 Entities = new Dictionary<libsecondlife.LLUUID, Entity>();
44 33
45 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); 34 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap");
@@ -126,9 +115,9 @@ namespace OpenSim.world
126 HeightmapGenHills hills = new HeightmapGenHills(); 115 HeightmapGenHills hills = new HeightmapGenHills();
127 this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); 116 this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
128 this.phyScene.SetTerrain(this.LandMap); 117 this.phyScene.SetTerrain(this.LandMap);
129 m_cfg.SaveMap(this.LandMap); 118 OpenSimRoot.Instance.Cfg.SaveMap(this.LandMap);
130 119
131 foreach(SimClient client in m_clientThreads.Values) { 120 foreach(SimClient client in OpenSimRoot.Instance.ClientThreads.Values) {
132 this.SendLayerData(client); 121 this.SendLayerData(client);
133 } 122 }
134 } 123 }
@@ -145,7 +134,7 @@ namespace OpenSim.world
145 _primCount = prim.LocalID + 1; 134 _primCount = prim.LocalID + 1;
146 } 135 }
147 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId "+ prim.LocalID+ " ) from storage"); 136 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId "+ prim.LocalID+ " ) from storage");
148 Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, m_world); 137 Primitive nPrim = new Primitive();
149 nPrim.CreateFromStorage(prim); 138 nPrim.CreateFromStorage(prim);
150 this.Entities.Add(nPrim.uuid, nPrim); 139 this.Entities.Add(nPrim.uuid, nPrim);
151 } 140 }
@@ -186,7 +175,7 @@ namespace OpenSim.world
186 175
187 public void AddViewerAgent(SimClient AgentClient) { 176 public void AddViewerAgent(SimClient AgentClient) {
188 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); 177 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
189 Avatar NewAvatar = new Avatar(AgentClient, m_world, m_regionName, m_clientThreads, m_regionHandle ); 178 Avatar NewAvatar = new Avatar(AgentClient);
190 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); 179 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world");
191 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); 180 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake ");
192 NewAvatar.SendRegionHandshake(this); 181 NewAvatar.SendRegionHandshake(this);
@@ -198,7 +187,7 @@ namespace OpenSim.world
198 public void AddNewPrim(ObjectAddPacket addPacket, SimClient AgentClient) 187 public void AddNewPrim(ObjectAddPacket addPacket, SimClient AgentClient)
199 { 188 {
200 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim"); 189 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim");
201 Primitive prim = new Primitive(m_clientThreads, m_regionHandle, m_world ); 190 Primitive prim = new Primitive();
202 prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount); 191 prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount);
203 PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z); 192 PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z);
204 PhysicsVector pSize = new PhysicsVector( 0.255f, 0.255f, 0.255f); 193 PhysicsVector pSize = new PhysicsVector( 0.255f, 0.255f, 0.255f);
@@ -221,7 +210,7 @@ namespace OpenSim.world
221 foreach( DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData ) 210 foreach( DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData )
222 { 211 {
223 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); 212 //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
224 foreach (Entity ent in m_world.Entities.Values) 213 foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values)
225 { 214 {
226 if (ent.localid == Data.ObjectLocalID) 215 if (ent.localid == Data.ObjectLocalID)
227 { 216 {
@@ -231,7 +220,7 @@ namespace OpenSim.world
231 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; 220 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
232 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); 221 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
233 kill.ObjectData[0].ID = ent.localid; 222 kill.ObjectData[0].ID = ent.localid;
234 foreach (SimClient client in m_clientThreads.Values) 223 foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
235 { 224 {
236 client.OutPacket(kill); 225 client.OutPacket(kill);
237 } 226 }
@@ -245,9 +234,9 @@ namespace OpenSim.world
245 } 234 }
246 foreach( libsecondlife.LLUUID uuid in DeRezEnts ) 235 foreach( libsecondlife.LLUUID uuid in DeRezEnts )
247 { 236 {
248 lock (m_world.Entities) 237 lock (OpenSimRoot.Instance.LocalWorld.Entities)
249 { 238 {
250 m_world.Entities.Remove(uuid); 239 OpenSimRoot.Instance.LocalWorld.Entities.Remove(uuid);
251 } 240 }
252 } 241 }
253 242