more minor cleanup. added some command descriptions to region server help.

afrisby
Jeff Ames 2007-12-06 17:41:21 +00:00
parent 395637acdd
commit a47176ee92
3 changed files with 24 additions and 21 deletions

View File

@ -443,10 +443,11 @@ namespace OpenSim
m_assetCache = new AssetCache(assetServer, m_log); m_assetCache = new AssetCache(assetServer, m_log);
// m_assetCache = new assetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); // m_assetCache = new assetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
m_sceneManager.OnReStartSim += handleReStartRegion; m_sceneManager.OnRestartSim += handleRestartRegion;
} }
public void handleReStartRegion(RegionInfo whichRegion)
public void handleRestartRegion(RegionInfo whichRegion)
{ {
MainLog.Instance.Error("MAIN", "Got Restart Singlal from SceneManager"); MainLog.Instance.Error("MAIN", "Got Restart Singlal from SceneManager");
// Shutting down the UDP server // Shutting down the UDP server
@ -455,7 +456,6 @@ namespace OpenSim
for (int i = 0; i < m_udpServers.Count; i++) for (int i = 0; i < m_udpServers.Count; i++)
{ {
if (m_udpServers[i].RegionHandle == whichRegion.RegionHandle) if (m_udpServers[i].RegionHandle == whichRegion.RegionHandle)
{ {
UDPServerElement = i; UDPServerElement = i;
@ -486,7 +486,6 @@ namespace OpenSim
UDPServer restartingRegion = CreateRegion(whichRegion); UDPServer restartingRegion = CreateRegion(whichRegion);
restartingRegion.ServerListener(); restartingRegion.ServerListener();
//m_sceneManager.SendSimOnlineNotification(restartingRegion.RegionHandle); //m_sceneManager.SendSimOnlineNotification(restartingRegion.RegionHandle);
} }
protected override LogBase CreateLog() protected override LogBase CreateLog()
@ -536,7 +535,6 @@ namespace OpenSim
/// </summary> /// </summary>
public virtual void Shutdown() public virtual void Shutdown()
{ {
if (m_startupCommandsFile != "") if (m_startupCommandsFile != "")
{ {
RunCommandScript(m_shutdownCommandsFile); RunCommandScript(m_shutdownCommandsFile);
@ -609,7 +607,6 @@ namespace OpenSim
m_sceneManager.ForceCurrentSceneClientUpdate(); m_sceneManager.ForceCurrentSceneClientUpdate();
break; break;
case "edit-scale": case "edit-scale":
if (cmdparams.Length == 4) if (cmdparams.Length == 4)
{ {
@ -629,21 +626,27 @@ namespace OpenSim
m_log.Error(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive."); m_log.Error(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive.");
m_log.Error(" alert general [Message] - send an alert to all users."); m_log.Error(" alert general [Message] - send an alert to all users.");
m_log.Error("backup - trigger a simulator backup"); m_log.Error("backup - trigger a simulator backup");
m_log.Error("change-region - sets the region that many of these commands affect.");
m_log.Error("command-script [filename] - Execute command in a file."); m_log.Error("command-script [filename] - Execute command in a file.");
m_log.Error("debug - debugging commands"); m_log.Error("debug - debugging commands");
m_log.Error(" packet 0..255 - print incoming/outgoing packets (0=off)"); m_log.Error(" packet 0..255 - print incoming/outgoing packets (0=off)");
m_log.Error("edit-scale [prim name] [x] [y] [z] - resize given prim");
m_log.Error("export-map [filename] - save image of world map");
m_log.Error("force-update - force an update of prims in the scene"); m_log.Error("force-update - force an update of prims in the scene");
m_log.Error("load-xml [filename] - load prims from XML"); m_log.Error("load-xml [filename] - load prims from XML");
m_log.Error("load-xml2 [filename] - load prims from XML using version 2 format");
m_log.Error("permissions [true/false] - turn on/off permissions on the scene");
m_log.Error("quit - equivalent to shutdown.");
m_log.Error("restart - disconnects all clients and restarts the sims in the instance.");
m_log.Error("save-xml [filename] - save prims to XML"); m_log.Error("save-xml [filename] - save prims to XML");
m_log.Error("save-xml2 [filename] - save prims to XML using version 2 format");
m_log.Error("script - manually trigger scripts? or script commands?"); m_log.Error("script - manually trigger scripts? or script commands?");
m_log.Error("set-time [x] - set the current scene time phase");
m_log.Error("show uptime - show simulator startup and uptime."); m_log.Error("show uptime - show simulator startup and uptime.");
m_log.Error("show users - show info about connected users."); m_log.Error("show users - show info about connected users.");
m_log.Error("show modules - shows info aboutloaded modules."); m_log.Error("show modules - shows info aboutloaded modules.");
m_log.Error("change-region - sets the region that many of these commands affect.");
m_log.Error("restart - disconnects all clients and restarts the sims in the instance.");
m_log.Error("shutdown - disconnect all clients and shutdown."); m_log.Error("shutdown - disconnect all clients and shutdown.");
m_log.Error("terrain help - show help for terrain commands."); m_log.Error("terrain help - show help for terrain commands.");
m_log.Error("quit - equivalent to shutdown.");
break; break;
case "show": case "show":
@ -734,9 +737,7 @@ namespace OpenSim
case "permissions": case "permissions":
// Treats each user as a super-admin when disabled // Treats each user as a super-admin when disabled
bool permissions = Convert.ToBoolean(cmdparams[0]); bool permissions = Convert.ToBoolean(cmdparams[0]);
m_sceneManager.SetBypassPermissionsOnCurrentScene(!permissions); m_sceneManager.SetBypassPermissionsOnCurrentScene(!permissions);
break; break;
case "backup": case "backup":
@ -778,6 +779,7 @@ namespace OpenSim
case "shutdown": case "shutdown":
Shutdown(); Shutdown();
break; break;
case "restart": case "restart":
m_sceneManager.RestartCurrentScene(); m_sceneManager.RestartCurrentScene();
break; break;

View File

@ -34,11 +34,11 @@ using OpenSim.Framework.Console;
namespace OpenSim.Region.Environment.Scenes namespace OpenSim.Region.Environment.Scenes
{ {
public delegate void ReStartSim(RegionInfo thisregion); public delegate void RestartSim(RegionInfo thisregion);
public class SceneManager public class SceneManager
{ {
public event ReStartSim OnReStartSim; public event RestartSim OnRestartSim;
private readonly List<Scene> m_localScenes; private readonly List<Scene> m_localScenes;
private Scene m_currentScene = null; private Scene m_currentScene = null;
@ -103,7 +103,6 @@ namespace OpenSim.Region.Environment.Scenes
int RegionSceneElement = -1; int RegionSceneElement = -1;
for (int i = 0; i < m_localScenes.Count; i++) for (int i = 0; i < m_localScenes.Count; i++)
{ {
if (rdata.RegionName == m_localScenes[i].RegionInfo.RegionName) if (rdata.RegionName == m_localScenes[i].RegionInfo.RegionName)
{ {
RegionSceneElement = i; RegionSceneElement = i;
@ -111,7 +110,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
// Now we make sure the region is no longer known about by the SceneManager // Now we make sure the region is no longer known about by the SceneManager
// Prevents Duplicates. // Prevents duplicates.
if (RegionSceneElement >= 0) if (RegionSceneElement >= 0)
{ {
@ -119,7 +118,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
// Send signal to main that we're restarting this sim. // Send signal to main that we're restarting this sim.
OnReStartSim(rdata); OnRestartSim(rdata);
} }
public void SendSimOnlineNotification(ulong regionHandle) public void SendSimOnlineNotification(ulong regionHandle)
@ -131,7 +130,6 @@ namespace OpenSim.Region.Environment.Scenes
if (m_localScenes[i].RegionInfo.RegionHandle == regionHandle) if (m_localScenes[i].RegionInfo.RegionHandle == regionHandle)
{ {
// Inform other regions to tell their avatar about me // Inform other regions to tell their avatar about me
Result = m_localScenes[i].RegionInfo; Result = m_localScenes[i].RegionInfo;
} }
@ -140,10 +138,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
for (int i = 0; i < m_localScenes.Count; i++) for (int i = 0; i < m_localScenes.Count; i++)
{ {
if (m_localScenes[i].RegionInfo.RegionHandle != regionHandle) if (m_localScenes[i].RegionInfo.RegionHandle != regionHandle)
{ {
// Inform other regions to tell their avatar about me // Inform other regions to tell their avatar about me
//m_localScenes[i].OtherRegionUp(Result); //m_localScenes[i].OtherRegionUp(Result);
} }
@ -221,7 +217,6 @@ namespace OpenSim.Region.Environment.Scenes
public void RestartCurrentScene() public void RestartCurrentScene()
{ {
ForEachCurrentScene(delegate(Scene scene) { scene.RestartNow(); }); ForEachCurrentScene(delegate(Scene scene) { scene.RestartNow(); });
} }
public void BackupCurrentScene() public void BackupCurrentScene()

View File

@ -48,6 +48,9 @@ namespace SimpleApp
private ModuleLoader m_moduleLoader; private ModuleLoader m_moduleLoader;
private IConfigSource m_config; private IConfigSource m_config;
private string m_userPlugin = "OpenSim.Framework.Data.SQLite.dll";
private string m_inventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
protected override LogBase CreateLog() protected override LogBase CreateLog()
{ {
return new LogBase(null, "SimpleApp", this, true); return new LogBase(null, "SimpleApp", this, true);
@ -70,11 +73,14 @@ namespace SimpleApp
StartUp(); StartUp();
LocalInventoryService inventoryService = new LocalInventoryService(); LocalInventoryService inventoryService = new LocalInventoryService();
inventoryService.AddPlugin(m_inventoryPlugin);
LocalUserServices userService = LocalUserServices userService =
new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX,
m_networkServersInfo.DefaultHomeLocY, inventoryService); m_networkServersInfo.DefaultHomeLocY, inventoryService);
userService.AddPlugin(m_userPlugin);
LocalBackEndServices backendService = new LocalBackEndServices(); LocalBackEndServices backendService = new LocalBackEndServices();
userService.AddPlugin("OpenSim.Framework.Data.SQLite.dll");
CommunicationsLocal localComms = CommunicationsLocal localComms =
new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService,