aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/world/World.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim.RegionServer/world/World.cs')
-rw-r--r--OpenSim.RegionServer/world/World.cs33
1 files changed, 11 insertions, 22 deletions
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