From d12c2be492cc962c171635abd9b39f29f192dad0 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 4 May 2007 07:23:41 +0000 Subject: Sims can now load their datastore (their localworld class - prims/terrain/etc) from a file indicated by the grid server. This allows you to have a floating pool of regions tasked to whichever region they need to be at any time. --- OpenSim.RegionServer/OpenSimMain.cs | 48 +++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 20 deletions(-) (limited to 'OpenSim.RegionServer/OpenSimMain.cs') diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs index 0be9d83..836f57f 100644 --- a/OpenSim.RegionServer/OpenSimMain.cs +++ b/OpenSim.RegionServer/OpenSimMain.cs @@ -159,6 +159,34 @@ namespace OpenSim PacketServer packetServer = new PacketServer(this); + + //should be passing a IGenericConfig object to these so they can read the config data they want from it + GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); + IGridServer gridServer = GridServers.GridServer; + gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey); + + if (!m_sandbox) + { + if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort)) + { + m_console.WriteLine("Main.cs:Startup() - Success: Got a grid connection OK!"); + } + else + { + m_console.WriteLine("Main.cs:Startup() - FAILED: Unable to get connection to grid. Shutting down."); + Shutdown(); + } + + GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]); + + // If we are being told to load a file, load it. + if (((string)((RemoteGridBase)GridServers.GridServer).GridData["data_uri"]) != "") + { + this.LocalWorld.m_datastore = ((string)((RemoteGridBase)GridServers.GridServer).GridData["data_uri"]); + } + } + + m_console.WriteLine("Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString()); m_console.WriteLine("Initialising world"); LocalWorld = new World(this._packetServer.ClientThreads, regionData.RegionHandle, regionData.RegionName); @@ -180,26 +208,6 @@ namespace OpenSim LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); //should be reading from the config file what physics engine to use LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D()); - //should be passing a IGenericConfig object to these so they can read the config data they want from it - GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); - IGridServer gridServer = GridServers.GridServer; - gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey); - - if (!m_sandbox) - { - if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort)) - { - m_console.WriteLine("Main.cs:Startup() - Got a grid connection OK!"); - } - else - { - m_console.WriteLine("AAAAAAAAAAAAARRRRRRRRRRGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!"); - m_console.WriteLine("I LOST MY GRID!!!!!!!!!!!!! AAAAAAAARRRRRRRRGGGGGGGGHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!"); - Shutdown(); - } - - GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]); - } LocalWorld.LoadPrimsFromStorage(); -- cgit v1.1