diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 059bfd7..2bc3f8c 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -26,27 +26,23 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using libsecondlife; | ||
30 | using libsecondlife.Packets; | ||
31 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
32 | using System.Text; | ||
33 | using System.Reflection; | ||
34 | using System.IO; | ||
35 | using System.Threading; | 30 | using System.Threading; |
36 | using System.Timers; | 31 | using System.Timers; |
37 | using OpenSim.Physics.Manager; | 32 | using libsecondlife; |
38 | using OpenSim.Framework.Interfaces; | 33 | using libsecondlife.Packets; |
39 | using OpenSim.Framework.Types; | ||
40 | using OpenSim.Framework.Inventory; | ||
41 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
42 | using OpenSim.Region.Terrain; | ||
43 | using OpenSim.Framework.Communications; | 35 | using OpenSim.Framework.Communications; |
44 | using OpenSim.Region.Caches; | 36 | using OpenSim.Framework.Console; |
45 | using OpenSim.Region.Environment; | 37 | using OpenSim.Framework.Interfaces; |
46 | using OpenSim.Framework.Servers; | 38 | using OpenSim.Framework.Servers; |
39 | using OpenSim.Framework.Types; | ||
40 | using OpenSim.Physics.Manager; | ||
41 | using OpenSim.Region.Caches; | ||
47 | using OpenSim.Region.Enviorment.Scripting; | 42 | using OpenSim.Region.Enviorment.Scripting; |
48 | using OpenSim.Region.Capabilities; | 43 | using OpenSim.Region.Terrain; |
49 | using Caps = OpenSim.Region.Capabilities.Caps; | 44 | using Caps=OpenSim.Region.Capabilities.Caps; |
45 | using Timer=System.Timers.Timer; | ||
50 | 46 | ||
51 | namespace OpenSim.Region.Environment.Scenes | 47 | namespace OpenSim.Region.Environment.Scenes |
52 | { | 48 | { |
@@ -54,9 +50,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
54 | 50 | ||
55 | public partial class Scene : SceneBase, ILocalStorageReceiver | 51 | public partial class Scene : SceneBase, ILocalStorageReceiver |
56 | { | 52 | { |
57 | protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer(); | 53 | protected Timer m_heartbeatTimer = new Timer(); |
58 | protected Dictionary<libsecondlife.LLUUID, ScenePresence> Avatars; | 54 | protected Dictionary<LLUUID, ScenePresence> Avatars; |
59 | protected Dictionary<libsecondlife.LLUUID, SceneObject> Prims; | 55 | protected Dictionary<LLUUID, SceneObject> Prims; |
60 | private PhysicsScene phyScene; | 56 | private PhysicsScene phyScene; |
61 | private float timeStep = 0.1f; | 57 | private float timeStep = 0.1f; |
62 | private Random Rand = new Random(); | 58 | private Random Rand = new Random(); |
@@ -119,12 +115,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
119 | scriptManager = new ScriptManager(this); | 115 | scriptManager = new ScriptManager(this); |
120 | eventManager = new EventManager(); | 116 | eventManager = new EventManager(); |
121 | 117 | ||
122 | OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs - creating new entitities instance"); | 118 | MainLog.Instance.Verbose("World.cs - creating new entitities instance"); |
123 | Entities = new Dictionary<libsecondlife.LLUUID, EntityBase>(); | 119 | Entities = new Dictionary<LLUUID, EntityBase>(); |
124 | Avatars = new Dictionary<LLUUID, ScenePresence>(); | 120 | Avatars = new Dictionary<LLUUID, ScenePresence>(); |
125 | Prims = new Dictionary<LLUUID, SceneObject>(); | 121 | Prims = new Dictionary<LLUUID, SceneObject>(); |
126 | 122 | ||
127 | OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs - creating LandMap"); | 123 | MainLog.Instance.Verbose("World.cs - creating LandMap"); |
128 | Terrain = new TerrainEngine(); | 124 | Terrain = new TerrainEngine(); |
129 | 125 | ||
130 | ScenePresence.LoadAnims(); | 126 | ScenePresence.LoadAnims(); |
@@ -151,7 +147,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
151 | /// </summary> | 147 | /// </summary> |
152 | /// <param name="sender"></param> | 148 | /// <param name="sender"></param> |
153 | /// <param name="e"></param> | 149 | /// <param name="e"></param> |
154 | void Heartbeat(object sender, System.EventArgs e) | 150 | void Heartbeat(object sender, EventArgs e) |
155 | { | 151 | { |
156 | this.Update(); | 152 | this.Update(); |
157 | } | 153 | } |
@@ -170,7 +166,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
170 | 166 | ||
171 | } | 167 | } |
172 | 168 | ||
173 | foreach (libsecondlife.LLUUID UUID in Entities.Keys) | 169 | foreach (LLUUID UUID in Entities.Keys) |
174 | { | 170 | { |
175 | Entities[UUID].updateMovement(); | 171 | Entities[UUID].updateMovement(); |
176 | } | 172 | } |
@@ -180,7 +176,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
180 | this.phyScene.Simulate(timeStep); | 176 | this.phyScene.Simulate(timeStep); |
181 | } | 177 | } |
182 | 178 | ||
183 | foreach (libsecondlife.LLUUID UUID in Entities.Keys) | 179 | foreach (LLUUID UUID in Entities.Keys) |
184 | { | 180 | { |
185 | Entities[UUID].update(); | 181 | Entities[UUID].update(); |
186 | } | 182 | } |
@@ -198,7 +194,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
198 | } | 194 | } |
199 | catch (Exception e) | 195 | catch (Exception e) |
200 | { | 196 | { |
201 | OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: Update() - Failed with exception " + e.ToString()); | 197 | MainLog.Instance.Warn("World.cs: Update() - Failed with exception " + e.ToString()); |
202 | } | 198 | } |
203 | updateLock.ReleaseMutex(); | 199 | updateLock.ReleaseMutex(); |
204 | 200 | ||
@@ -237,14 +233,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
237 | this.SendLayerData(client); | 233 | this.SendLayerData(client); |
238 | } | 234 | } |
239 | 235 | ||
240 | foreach (libsecondlife.LLUUID UUID in Entities.Keys) | 236 | foreach (LLUUID UUID in Entities.Keys) |
241 | { | 237 | { |
242 | Entities[UUID].LandRenegerated(); | 238 | Entities[UUID].LandRenegerated(); |
243 | } | 239 | } |
244 | } | 240 | } |
245 | catch (Exception e) | 241 | catch (Exception e) |
246 | { | 242 | { |
247 | OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); | 243 | MainLog.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); |
248 | } | 244 | } |
249 | } | 245 | } |
250 | 246 | ||
@@ -268,14 +264,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
268 | this.SendLayerData(client); | 264 | this.SendLayerData(client); |
269 | } | 265 | } |
270 | 266 | ||
271 | foreach (libsecondlife.LLUUID UUID in Entities.Keys) | 267 | foreach (LLUUID UUID in Entities.Keys) |
272 | { | 268 | { |
273 | Entities[UUID].LandRenegerated(); | 269 | Entities[UUID].LandRenegerated(); |
274 | } | 270 | } |
275 | } | 271 | } |
276 | catch (Exception e) | 272 | catch (Exception e) |
277 | { | 273 | { |
278 | OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); | 274 | MainLog.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); |
279 | } | 275 | } |
280 | } | 276 | } |
281 | 277 | ||
@@ -301,7 +297,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
301 | } | 297 | } |
302 | catch (Exception e) | 298 | catch (Exception e) |
303 | { | 299 | { |
304 | OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); | 300 | MainLog.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); |
305 | } | 301 | } |
306 | } | 302 | } |
307 | 303 | ||
@@ -351,7 +347,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
351 | } | 347 | } |
352 | catch (Exception e) | 348 | catch (Exception e) |
353 | { | 349 | { |
354 | OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: LoadWorldMap() - Failed with exception " + e.ToString()); | 350 | MainLog.Instance.Warn("World.cs: LoadWorldMap() - Failed with exception " + e.ToString()); |
355 | } | 351 | } |
356 | } | 352 | } |
357 | 353 | ||
@@ -382,12 +378,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
382 | { | 378 | { |
383 | try | 379 | try |
384 | { | 380 | { |
385 | OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives"); | 381 | MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives"); |
386 | this.localStorage.LoadPrimitives(this); | 382 | this.localStorage.LoadPrimitives(this); |
387 | } | 383 | } |
388 | catch (Exception e) | 384 | catch (Exception e) |
389 | { | 385 | { |
390 | OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: LoadPrimsFromStorage() - Failed with exception " + e.ToString()); | 386 | MainLog.Instance.Warn("World.cs: LoadPrimsFromStorage() - Failed with exception " + e.ToString()); |
391 | } | 387 | } |
392 | } | 388 | } |
393 | 389 | ||
@@ -428,7 +424,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
428 | } | 424 | } |
429 | catch (Exception e) | 425 | catch (Exception e) |
430 | { | 426 | { |
431 | OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: AddNewPrim() - Failed with exception " + e.ToString()); | 427 | MainLog.Instance.Warn("World.cs: AddNewPrim() - Failed with exception " + e.ToString()); |
432 | } | 428 | } |
433 | } | 429 | } |
434 | 430 | ||
@@ -482,10 +478,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
482 | { | 478 | { |
483 | ScenePresence newAvatar = null; | 479 | ScenePresence newAvatar = null; |
484 | 480 | ||
485 | OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); | 481 | MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); |
486 | newAvatar = new ScenePresence(client, this, this.m_regInfo); | 482 | newAvatar = new ScenePresence(client, this, this.m_regInfo); |
487 | OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Adding new avatar to world"); | 483 | MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Adding new avatar to world"); |
488 | OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Starting RegionHandshake "); | 484 | MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Starting RegionHandshake "); |
489 | 485 | ||
490 | PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); | 486 | PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); |
491 | lock (this.m_syncRoot) | 487 | lock (this.m_syncRoot) |
@@ -638,7 +634,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
638 | } | 634 | } |
639 | } | 635 | } |
640 | 636 | ||
641 | public void AgentCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) | 637 | public void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position) |
642 | { | 638 | { |
643 | if (regionHandle == this.m_regInfo.RegionHandle) | 639 | if (regionHandle == this.m_regInfo.RegionHandle) |
644 | { | 640 | { |