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 | |
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')
-rw-r--r-- | OpenSim.RegionServer/world/Avatar.cs | 39 | ||||
-rw-r--r-- | OpenSim.RegionServer/world/Primitive.cs | 27 | ||||
-rw-r--r-- | OpenSim.RegionServer/world/World.cs | 33 |
3 files changed, 63 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..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 | ||