diff options
author | Adam Frisby | 2007-05-04 07:23:41 +0000 |
---|---|---|
committer | Adam Frisby | 2007-05-04 07:23:41 +0000 |
commit | d12c2be492cc962c171635abd9b39f29f192dad0 (patch) | |
tree | 838374130b66aeab51eaf9cf754b5aecd9a449b0 | |
parent | Part 1/2 - loading sim datafiles from remote servers. (Floating grid, here we... (diff) | |
download | opensim-SC_OLD-d12c2be492cc962c171635abd9b39f29f192dad0.zip opensim-SC_OLD-d12c2be492cc962c171635abd9b39f29f192dad0.tar.gz opensim-SC_OLD-d12c2be492cc962c171635abd9b39f29f192dad0.tar.bz2 opensim-SC_OLD-d12c2be492cc962c171635abd9b39f29f192dad0.tar.xz |
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.
-rw-r--r-- | OpenGridServices.GridServer/GridManager.cs | 2 | ||||
-rw-r--r-- | OpenSim.RegionServer/OpenSimMain.cs | 48 |
2 files changed, 29 insertions, 21 deletions
diff --git a/OpenGridServices.GridServer/GridManager.cs b/OpenGridServices.GridServer/GridManager.cs index cfd34f5..8de752d 100644 --- a/OpenGridServices.GridServer/GridManager.cs +++ b/OpenGridServices.GridServer/GridManager.cs | |||
@@ -168,7 +168,7 @@ namespace OpenGridServices.GridServer | |||
168 | responseData["authkey"] = TheSim.regionSecret; | 168 | responseData["authkey"] = TheSim.regionSecret; |
169 | 169 | ||
170 | // New! If set, use as URL to local sim storage (ie http://remotehost/region.yap) | 170 | // New! If set, use as URL to local sim storage (ie http://remotehost/region.yap) |
171 | responseData["datauri"] = TheSim.regionDataURI; | 171 | responseData["data_uri"] = TheSim.regionDataURI; |
172 | } | 172 | } |
173 | 173 | ||
174 | return response; | 174 | return response; |
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 | |||
159 | 159 | ||
160 | PacketServer packetServer = new PacketServer(this); | 160 | PacketServer packetServer = new PacketServer(this); |
161 | 161 | ||
162 | |||
163 | //should be passing a IGenericConfig object to these so they can read the config data they want from it | ||
164 | GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); | ||
165 | IGridServer gridServer = GridServers.GridServer; | ||
166 | gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey); | ||
167 | |||
168 | if (!m_sandbox) | ||
169 | { | ||
170 | if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort)) | ||
171 | { | ||
172 | m_console.WriteLine("Main.cs:Startup() - Success: Got a grid connection OK!"); | ||
173 | } | ||
174 | else | ||
175 | { | ||
176 | m_console.WriteLine("Main.cs:Startup() - FAILED: Unable to get connection to grid. Shutting down."); | ||
177 | Shutdown(); | ||
178 | } | ||
179 | |||
180 | GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]); | ||
181 | |||
182 | // If we are being told to load a file, load it. | ||
183 | if (((string)((RemoteGridBase)GridServers.GridServer).GridData["data_uri"]) != "") | ||
184 | { | ||
185 | this.LocalWorld.m_datastore = ((string)((RemoteGridBase)GridServers.GridServer).GridData["data_uri"]); | ||
186 | } | ||
187 | } | ||
188 | |||
189 | |||
162 | m_console.WriteLine("Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString()); | 190 | m_console.WriteLine("Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString()); |
163 | m_console.WriteLine("Initialising world"); | 191 | m_console.WriteLine("Initialising world"); |
164 | LocalWorld = new World(this._packetServer.ClientThreads, regionData.RegionHandle, regionData.RegionName); | 192 | LocalWorld = new World(this._packetServer.ClientThreads, regionData.RegionHandle, regionData.RegionName); |
@@ -180,26 +208,6 @@ namespace OpenSim | |||
180 | LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); //should be reading from the config file what physics engine to use | 208 | LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); //should be reading from the config file what physics engine to use |
181 | LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D()); | 209 | LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D()); |
182 | 210 | ||
183 | //should be passing a IGenericConfig object to these so they can read the config data they want from it | ||
184 | GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); | ||
185 | IGridServer gridServer = GridServers.GridServer; | ||
186 | gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey); | ||
187 | |||
188 | if (!m_sandbox) | ||
189 | { | ||
190 | if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort)) | ||
191 | { | ||
192 | m_console.WriteLine("Main.cs:Startup() - Got a grid connection OK!"); | ||
193 | } | ||
194 | else | ||
195 | { | ||
196 | m_console.WriteLine("AAAAAAAAAAAAARRRRRRRRRRGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!"); | ||
197 | m_console.WriteLine("I LOST MY GRID!!!!!!!!!!!!! AAAAAAAARRRRRRRRGGGGGGGGHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!"); | ||
198 | Shutdown(); | ||
199 | } | ||
200 | |||
201 | GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]); | ||
202 | } | ||
203 | 211 | ||
204 | LocalWorld.LoadPrimsFromStorage(); | 212 | LocalWorld.LoadPrimsFromStorage(); |
205 | 213 | ||