diff options
author | lbsa71 | 2007-03-27 19:12:55 +0000 |
---|---|---|
committer | lbsa71 | 2007-03-27 19:12:55 +0000 |
commit | ccfddd1775fe2786ad54b7bbfe528e7eb65170b1 (patch) | |
tree | e9f60b7bdb0b84917ed060159814357ea80321c4 /OpenSim.RegionServer/world/World.cs | |
parent | * Introduced BaseHttpServer (doing nothing at the moment) (diff) | |
download | opensim-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/World.cs')
-rw-r--r-- | OpenSim.RegionServer/world/World.cs | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs index e6d8921..7605f9e 100644 --- a/OpenSim.RegionServer/world/World.cs +++ b/OpenSim.RegionServer/world/World.cs | |||
@@ -25,10 +25,21 @@ 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; | ||
28 | 33 | ||
29 | public World() | 34 | public World(Dictionary<uint, SimClient> clientThreads, ulong regionHandle, World world, string regionName, SimConfig cfg) |
30 | { | 35 | { |
31 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating new entitities instance"); | 36 | m_clientThreads = clientThreads; |
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"); | ||
32 | Entities = new Dictionary<libsecondlife.LLUUID, Entity>(); | 43 | Entities = new Dictionary<libsecondlife.LLUUID, Entity>(); |
33 | 44 | ||
34 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); | 45 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs - creating LandMap"); |
@@ -115,9 +126,9 @@ namespace OpenSim.world | |||
115 | HeightmapGenHills hills = new HeightmapGenHills(); | 126 | HeightmapGenHills hills = new HeightmapGenHills(); |
116 | this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); | 127 | this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); |
117 | this.phyScene.SetTerrain(this.LandMap); | 128 | this.phyScene.SetTerrain(this.LandMap); |
118 | OpenSimRoot.Instance.Cfg.SaveMap(this.LandMap); | 129 | m_cfg.SaveMap(this.LandMap); |
119 | 130 | ||
120 | foreach(SimClient client in OpenSimRoot.Instance.ClientThreads.Values) { | 131 | foreach(SimClient client in m_clientThreads.Values) { |
121 | this.SendLayerData(client); | 132 | this.SendLayerData(client); |
122 | } | 133 | } |
123 | } | 134 | } |
@@ -134,7 +145,7 @@ namespace OpenSim.world | |||
134 | _primCount = prim.LocalID + 1; | 145 | _primCount = prim.LocalID + 1; |
135 | } | 146 | } |
136 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId "+ prim.LocalID+ " ) from storage"); | 147 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: PrimFromStorage() - Reloading prim (localId "+ prim.LocalID+ " ) from storage"); |
137 | Primitive nPrim = new Primitive(); | 148 | Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, m_world); |
138 | nPrim.CreateFromStorage(prim); | 149 | nPrim.CreateFromStorage(prim); |
139 | this.Entities.Add(nPrim.uuid, nPrim); | 150 | this.Entities.Add(nPrim.uuid, nPrim); |
140 | } | 151 | } |
@@ -175,7 +186,7 @@ namespace OpenSim.world | |||
175 | 186 | ||
176 | public void AddViewerAgent(SimClient AgentClient) { | 187 | public void AddViewerAgent(SimClient AgentClient) { |
177 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); | 188 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); |
178 | Avatar NewAvatar = new Avatar(AgentClient); | 189 | Avatar NewAvatar = new Avatar(AgentClient, m_world, m_regionName, m_clientThreads, m_regionHandle ); |
179 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); | 190 | 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 "); | 191 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); |
181 | NewAvatar.SendRegionHandshake(this); | 192 | NewAvatar.SendRegionHandshake(this); |
@@ -187,7 +198,7 @@ namespace OpenSim.world | |||
187 | public void AddNewPrim(ObjectAddPacket addPacket, SimClient AgentClient) | 198 | public void AddNewPrim(ObjectAddPacket addPacket, SimClient AgentClient) |
188 | { | 199 | { |
189 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim"); | 200 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim"); |
190 | Primitive prim = new Primitive(); | 201 | Primitive prim = new Primitive(m_clientThreads, m_regionHandle, m_world ); |
191 | prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount); | 202 | prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount); |
192 | PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z); | 203 | PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z); |
193 | PhysicsVector pSize = new PhysicsVector( 0.255f, 0.255f, 0.255f); | 204 | PhysicsVector pSize = new PhysicsVector( 0.255f, 0.255f, 0.255f); |
@@ -210,7 +221,7 @@ namespace OpenSim.world | |||
210 | foreach( DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData ) | 221 | foreach( DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData ) |
211 | { | 222 | { |
212 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); | 223 | //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString()); |
213 | foreach (Entity ent in OpenSimRoot.Instance.LocalWorld.Entities.Values) | 224 | foreach (Entity ent in m_world.Entities.Values) |
214 | { | 225 | { |
215 | if (ent.localid == Data.ObjectLocalID) | 226 | if (ent.localid == Data.ObjectLocalID) |
216 | { | 227 | { |
@@ -220,7 +231,7 @@ namespace OpenSim.world | |||
220 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; | 231 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; |
221 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); | 232 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); |
222 | kill.ObjectData[0].ID = ent.localid; | 233 | kill.ObjectData[0].ID = ent.localid; |
223 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) | 234 | foreach (SimClient client in m_clientThreads.Values) |
224 | { | 235 | { |
225 | client.OutPacket(kill); | 236 | client.OutPacket(kill); |
226 | } | 237 | } |
@@ -234,9 +245,9 @@ namespace OpenSim.world | |||
234 | } | 245 | } |
235 | foreach( libsecondlife.LLUUID uuid in DeRezEnts ) | 246 | foreach( libsecondlife.LLUUID uuid in DeRezEnts ) |
236 | { | 247 | { |
237 | lock (OpenSimRoot.Instance.LocalWorld.Entities) | 248 | lock (m_world.Entities) |
238 | { | 249 | { |
239 | OpenSimRoot.Instance.LocalWorld.Entities.Remove(uuid); | 250 | m_world.Entities.Remove(uuid); |
240 | } | 251 | } |
241 | } | 252 | } |
242 | 253 | ||