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 /OpenSim.RegionServer/OpenSimMain.cs | |
parent | Part 1/2 - loading sim datafiles from remote servers. (Floating grid, here we... (diff) | |
download | opensim-SC-d12c2be492cc962c171635abd9b39f29f192dad0.zip opensim-SC-d12c2be492cc962c171635abd9b39f29f192dad0.tar.gz opensim-SC-d12c2be492cc962c171635abd9b39f29f192dad0.tar.bz2 opensim-SC-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.
Diffstat (limited to 'OpenSim.RegionServer/OpenSimMain.cs')
-rw-r--r-- | OpenSim.RegionServer/OpenSimMain.cs | 48 |
1 files changed, 28 insertions, 20 deletions
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 | ||