diff options
Diffstat (limited to 'OpenSim/OpenSim.Region/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/OpenSim.Region/Scenes/Scene.cs | 85 |
1 files changed, 6 insertions, 79 deletions
diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs index 62edc4b..426dd50 100644 --- a/OpenSim/OpenSim.Region/Scenes/Scene.cs +++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs | |||
@@ -57,19 +57,18 @@ namespace OpenSim.Region.Scenes | |||
57 | protected Dictionary<libsecondlife.LLUUID, Primitive> Prims; | 57 | protected Dictionary<libsecondlife.LLUUID, Primitive> Prims; |
58 | private PhysicsScene phyScene; | 58 | private PhysicsScene phyScene; |
59 | private float timeStep = 0.1f; | 59 | private float timeStep = 0.1f; |
60 | public ILocalStorage localStorage; | ||
61 | private Random Rand = new Random(); | 60 | private Random Rand = new Random(); |
62 | private uint _primCount = 702000; | 61 | private uint _primCount = 702000; |
63 | private int storageCount; | 62 | private int storageCount; |
64 | private Dictionary<LLUUID, ScriptHandler> m_scriptHandlers; | 63 | private Dictionary<LLUUID, ScriptHandler> m_scriptHandlers; |
65 | private Dictionary<string, ScriptFactory> m_scripts; | 64 | private Dictionary<string, ScriptFactory> m_scripts; |
66 | private Mutex updateLock; | 65 | private Mutex updateLock; |
67 | public string m_datastore; | 66 | |
68 | protected AuthenticateSessionsBase authenticateHandler; | 67 | protected AuthenticateSessionsBase authenticateHandler; |
69 | protected RegionCommsListener regionCommsHost; | 68 | protected RegionCommsListener regionCommsHost; |
70 | protected CommunicationsManager commsManager; | 69 | protected CommunicationsManager commsManager; |
71 | 70 | ||
72 | protected List<Caps> capsHandlers = new List<Caps>(); | 71 | protected Dictionary<LLUUID, Caps> capsHandlers = new Dictionary<LLUUID, Caps>(); |
73 | protected BaseHttpServer httpListener; | 72 | protected BaseHttpServer httpListener; |
74 | 73 | ||
75 | public ParcelManager parcelManager; | 74 | public ParcelManager parcelManager; |
@@ -127,7 +126,6 @@ namespace OpenSim.Region.Scenes | |||
127 | Prims = new Dictionary<LLUUID, Primitive>(); | 126 | Prims = new Dictionary<LLUUID, Primitive>(); |
128 | 127 | ||
129 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs - creating LandMap"); | 128 | OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs - creating LandMap"); |
130 | TerrainManager = new TerrainManager(new SecondLife()); | ||
131 | Terrain = new TerrainEngine(); | 129 | Terrain = new TerrainEngine(); |
132 | 130 | ||
133 | ScenePresence.LoadAnims(); | 131 | ScenePresence.LoadAnims(); |
@@ -271,53 +269,6 @@ namespace OpenSim.Region.Scenes | |||
271 | } | 269 | } |
272 | #endregion | 270 | #endregion |
273 | 271 | ||
274 | #region Setup Methods | ||
275 | /// <summary> | ||
276 | /// Loads a new storage subsystem from a named library | ||
277 | /// </summary> | ||
278 | /// <param name="dllName">Storage Library</param> | ||
279 | /// <returns>Successful or not</returns> | ||
280 | public bool LoadStorageDLL(string dllName) | ||
281 | { | ||
282 | try | ||
283 | { | ||
284 | Assembly pluginAssembly = Assembly.LoadFrom(dllName); | ||
285 | ILocalStorage store = null; | ||
286 | |||
287 | foreach (Type pluginType in pluginAssembly.GetTypes()) | ||
288 | { | ||
289 | if (pluginType.IsPublic) | ||
290 | { | ||
291 | if (!pluginType.IsAbstract) | ||
292 | { | ||
293 | Type typeInterface = pluginType.GetInterface("ILocalStorage", true); | ||
294 | |||
295 | if (typeInterface != null) | ||
296 | { | ||
297 | ILocalStorage plug = (ILocalStorage)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
298 | store = plug; | ||
299 | |||
300 | store.Initialise(this.m_datastore); | ||
301 | break; | ||
302 | } | ||
303 | |||
304 | typeInterface = null; | ||
305 | } | ||
306 | } | ||
307 | } | ||
308 | pluginAssembly = null; | ||
309 | this.localStorage = store; | ||
310 | return (store == null); | ||
311 | } | ||
312 | catch (Exception e) | ||
313 | { | ||
314 | OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: LoadStorageDLL() - Failed with exception " + e.ToString()); | ||
315 | return false; | ||
316 | } | ||
317 | } | ||
318 | |||
319 | #endregion | ||
320 | |||
321 | #region Regenerate Terrain | 272 | #region Regenerate Terrain |
322 | 273 | ||
323 | /// <summary> | 274 | /// <summary> |
@@ -558,6 +509,8 @@ namespace OpenSim.Region.Scenes | |||
558 | remoteClient.OnUpdatePrimPosition += this.UpdatePrimPosition; | 509 | remoteClient.OnUpdatePrimPosition += this.UpdatePrimPosition; |
559 | remoteClient.OnRequestMapBlocks += this.RequestMapBlocks; | 510 | remoteClient.OnRequestMapBlocks += this.RequestMapBlocks; |
560 | remoteClient.OnTeleportLocationRequest += this.RequestTeleportLocation; | 511 | remoteClient.OnTeleportLocationRequest += this.RequestTeleportLocation; |
512 | //remoteClient.OnObjectSelect += this.SelectPrim; | ||
513 | remoteClient.OnGrapUpdate += this.MoveObject; | ||
561 | 514 | ||
562 | /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest); | 515 | /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest); |
563 | remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest); | 516 | remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest); |
@@ -680,22 +633,6 @@ namespace OpenSim.Region.Scenes | |||
680 | } | 633 | } |
681 | #endregion | 634 | #endregion |
682 | 635 | ||
683 | #region ShutDown | ||
684 | /// <summary> | ||
685 | /// Tidy before shutdown | ||
686 | /// </summary> | ||
687 | public override void Close() | ||
688 | { | ||
689 | try | ||
690 | { | ||
691 | this.localStorage.ShutDown(); | ||
692 | } | ||
693 | catch (Exception e) | ||
694 | { | ||
695 | OpenSim.Framework.Console.MainLog.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "World.cs: Close() - Failed with exception " + e.ToString()); | ||
696 | } | ||
697 | } | ||
698 | #endregion | ||
699 | 636 | ||
700 | #region RegionCommsHost | 637 | #region RegionCommsHost |
701 | 638 | ||
@@ -729,7 +666,7 @@ namespace OpenSim.Region.Scenes | |||
729 | //Console.WriteLine("new user, so creating caps handler for it"); | 666 | //Console.WriteLine("new user, so creating caps handler for it"); |
730 | Caps cap = new Caps(this.assetCache, httpListener, this.m_regInfo.CommsIPListenAddr, 9000, agent.CapsPath, agent.AgentID); | 667 | Caps cap = new Caps(this.assetCache, httpListener, this.m_regInfo.CommsIPListenAddr, 9000, agent.CapsPath, agent.AgentID); |
731 | cap.RegisterHandlers(); | 668 | cap.RegisterHandlers(); |
732 | this.capsHandlers.Add(cap); | 669 | this.capsHandlers.Add(agent.AgentID, cap); |
733 | } | 670 | } |
734 | this.authenticateHandler.AddNewCircuit(agent.circuitcode, agent); | 671 | this.authenticateHandler.AddNewCircuit(agent.circuitcode, agent); |
735 | } | 672 | } |
@@ -767,6 +704,7 @@ namespace OpenSim.Region.Scenes | |||
767 | agent.child = true; | 704 | agent.child = true; |
768 | this.commsManager.InterRegion.InformRegionOfChildAgent(neighbours[i].RegionHandle, agent); | 705 | this.commsManager.InterRegion.InformRegionOfChildAgent(neighbours[i].RegionHandle, agent); |
769 | remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr), (ushort)neighbours[i].CommsIPListenPort); | 706 | remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr), (ushort)neighbours[i].CommsIPListenPort); |
707 | //this.capsHandlers[remoteClient.AgentId].CreateEstablishAgentComms("", System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr) + ":" + neighbours[i].CommsIPListenPort); | ||
770 | } | 708 | } |
771 | } | 709 | } |
772 | } | 710 | } |
@@ -845,16 +783,5 @@ namespace OpenSim.Region.Scenes | |||
845 | } | 783 | } |
846 | 784 | ||
847 | #endregion | 785 | #endregion |
848 | |||
849 | /// <summary> | ||
850 | /// | ||
851 | /// </summary> | ||
852 | /// <param name="px"></param> | ||
853 | /// <param name="py"></param> | ||
854 | /// <param name="RemoteClient"></param> | ||
855 | public override void SendLayerData(int px, int py, IClientAPI RemoteClient) | ||
856 | { | ||
857 | RemoteClient.SendLayerData(px, py, Terrain.getHeights1D()); | ||
858 | } | ||
859 | } | 786 | } |
860 | } | 787 | } |