aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs23
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs65
2 files changed, 64 insertions, 24 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
index fcb6991..1d63d26 100644
--- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
+++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
@@ -115,6 +115,8 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
115 Environment.Exit(1); 115 Environment.Exit(1);
116 } 116 }
117 117
118 List<IScene> createdScenes = new List<IScene>();
119
118 for (int i = 0; i < regionsToLoad.Length; i++) 120 for (int i = 0; i < regionsToLoad.Length; i++)
119 { 121 {
120 IScene scene; 122 IScene scene;
@@ -123,17 +125,22 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
123 ")"); 125 ")");
124 126
125 bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]); 127 bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
128
126 m_openSim.CreateRegion(regionsToLoad[i], true, out scene); 129 m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
130 createdScenes.Add(scene);
131
127 if (changed) 132 if (changed)
128 regionsToLoad[i].EstateSettings.Save(); 133 regionsToLoad[i].EstateSettings.Save();
129 134 }
130 if (scene != null) 135
136 foreach (IScene scene in createdScenes)
137 {
138 scene.Start();
139
140 m_newRegionCreatedHandler = OnNewRegionCreated;
141 if (m_newRegionCreatedHandler != null)
131 { 142 {
132 m_newRegionCreatedHandler = OnNewRegionCreated; 143 m_newRegionCreatedHandler(scene);
133 if (m_newRegionCreatedHandler != null)
134 {
135 m_newRegionCreatedHandler(scene);
136 }
137 } 144 }
138 } 145 }
139 } 146 }
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index e50dac6..f3490fb 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -161,6 +161,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
161 availableMethods["admin_acl_add"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListAdd); 161 availableMethods["admin_acl_add"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListAdd);
162 availableMethods["admin_acl_remove"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListRemove); 162 availableMethods["admin_acl_remove"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListRemove);
163 availableMethods["admin_acl_list"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListList); 163 availableMethods["admin_acl_list"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListList);
164 availableMethods["admin_estate_reload"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcEstateReload);
164 165
165 // Misc 166 // Misc
166 availableMethods["admin_refresh_search"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshSearch); 167 availableMethods["admin_refresh_search"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRefreshSearch);
@@ -438,18 +439,26 @@ namespace OpenSim.ApplicationPlugins.RemoteController
438 // k, (string)requestData[k], ((string)requestData[k]).Length); 439 // k, (string)requestData[k], ((string)requestData[k]).Length);
439 // } 440 // }
440 441
441 CheckStringParameters(requestData, responseData, new string[] {"filename", "regionid"}); 442 CheckStringParameters(requestData, responseData, new string[] { "filename" });
442 CheckRegionParams(requestData, responseData); 443 CheckRegionParams(requestData, responseData);
443 444
444 Scene scene = null; 445 Scene scene = null;
445 GetSceneFromRegionParams(requestData, responseData, out scene); 446 GetSceneFromRegionParams(requestData, responseData, out scene);
446 string file = (string)requestData["filename"];
447 447
448 responseData["accepted"] = true; 448 if (scene != null)
449 {
450 string file = (string)requestData["filename"];
449 451
450 LoadHeightmap(file, scene.RegionInfo.RegionID); 452 responseData["accepted"] = true;
451 453
452 responseData["success"] = true; 454 LoadHeightmap(file, scene.RegionInfo.RegionID);
455
456 responseData["success"] = true;
457 }
458 else
459 {
460 responseData["success"] = false;
461 }
453 462
454 m_log.Info("[RADMIN]: Load height maps request complete"); 463 m_log.Info("[RADMIN]: Load height maps request complete");
455 } 464 }
@@ -463,23 +472,30 @@ namespace OpenSim.ApplicationPlugins.RemoteController
463 472
464// m_log.DebugFormat("[RADMIN]: Save Terrain: XmlRpc {0}", request.ToString()); 473// m_log.DebugFormat("[RADMIN]: Save Terrain: XmlRpc {0}", request.ToString());
465 474
466 CheckStringParameters(requestData, responseData, new string[] { "filename", "regionid" }); 475 CheckStringParameters(requestData, responseData, new string[] { "filename" });
467 CheckRegionParams(requestData, responseData); 476 CheckRegionParams(requestData, responseData);
468 477
469 Scene region = null; 478 Scene scene = null;
470 GetSceneFromRegionParams(requestData, responseData, out region); 479 GetSceneFromRegionParams(requestData, responseData, out scene);
471 480
472 string file = (string)requestData["filename"]; 481 if (scene != null)
473 m_log.InfoFormat("[RADMIN]: Terrain Saving: {0}", file); 482 {
483 string file = (string)requestData["filename"];
484 m_log.InfoFormat("[RADMIN]: Terrain Saving: {0}", file);
474 485
475 responseData["accepted"] = true; 486 responseData["accepted"] = true;
476 487
477 ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>(); 488 ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();
478 if (null == terrainModule) throw new Exception("terrain module not available"); 489 if (null == terrainModule) throw new Exception("terrain module not available");
479 490
480 terrainModule.SaveToFile(file); 491 terrainModule.SaveToFile(file);
481 492
482 responseData["success"] = true; 493 responseData["success"] = true;
494 }
495 else
496 {
497 responseData["success"] = false;
498 }
483 499
484 m_log.Info("[RADMIN]: Save height maps request complete"); 500 m_log.Info("[RADMIN]: Save height maps request complete");
485 } 501 }
@@ -831,6 +847,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
831 847
832 IScene newScene; 848 IScene newScene;
833 m_application.CreateRegion(region, out newScene); 849 m_application.CreateRegion(region, out newScene);
850 newScene.Start();
834 851
835 // If an access specification was provided, use it. 852 // If an access specification was provided, use it.
836 // Otherwise accept the default. 853 // Otherwise accept the default.
@@ -1225,7 +1242,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1225 { 1242 {
1226 GridUserInfo userInfo = m_application.SceneManager.CurrentOrFirstScene.GridUserService.GetGridUserInfo(account.PrincipalID.ToString()); 1243 GridUserInfo userInfo = m_application.SceneManager.CurrentOrFirstScene.GridUserService.GetGridUserInfo(account.PrincipalID.ToString());
1227 if (userInfo != null) 1244 if (userInfo != null)
1228 responseData["lastlogin"] = userInfo.Login; 1245 responseData["lastlogin"] = Util.ToUnixTime(userInfo.Login);
1229 else 1246 else
1230 responseData["lastlogin"] = 0; 1247 responseData["lastlogin"] = 0;
1231 1248
@@ -1902,6 +1919,22 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1902 m_log.Info("[RADMIN]: Access List List Request complete"); 1919 m_log.Info("[RADMIN]: Access List List Request complete");
1903 } 1920 }
1904 1921
1922 private void XmlRpcEstateReload(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
1923 {
1924 m_log.Info("[RADMIN]: Received Estate Reload Request");
1925
1926 Hashtable responseData = (Hashtable)response.Value;
1927// Hashtable requestData = (Hashtable)request.Params[0];
1928
1929 m_application.SceneManager.ForEachScene(s =>
1930 s.RegionInfo.EstateSettings = m_application.EstateDataService.LoadEstateSettings(s.RegionInfo.RegionID, false)
1931 );
1932
1933 responseData["success"] = true;
1934
1935 m_log.Info("[RADMIN]: Estate Reload Request complete");
1936 }
1937
1905 private void XmlRpcGetAgentsMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) 1938 private void XmlRpcGetAgentsMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
1906 { 1939 {
1907 Hashtable responseData = (Hashtable)response.Value; 1940 Hashtable responseData = (Hashtable)response.Value;