* Moved some commands from Scene into SceneManager so they could be used with 'root'

* Removed some duplicated commands
afrisby
lbsa71 2007-09-17 07:31:15 +00:00
parent b3d2f8b8e2
commit df58154781
3 changed files with 171 additions and 225 deletions

View File

@ -376,10 +376,25 @@ namespace OpenSim
{
string result = "";
if ((m_consoleRegion == null) || (command == "change-region") || (command == "shutdown"))
{
switch (command)
{
case "set-time":
m_localScenes.SetTimePhase(Convert.ToInt32(cmdparams[0]));
break;
case "force-update":
Console.WriteLine("Updating all clients");
m_localScenes.ForceClientUpdate();
break;
case "edit-scale":
if (cmdparams.Length == 4)
{
m_localScenes.HandleEditCommand(cmdparams);
}
break;
case "debug":
if (cmdparams.Length > 0)
{
@ -440,23 +455,6 @@ namespace OpenSim
}
break;
// terrain-sim now obsolete: do change-region first, then terrain as usual
//case "terrain-sim":
// foreach (Scene scene in m_localScenes)
// {
// if (scene.RegionInfo.RegionName.ToLower() == cmdparams[0].ToLower())
// {
// string[] tmpCmdparams = new string[cmdparams.Length - 1];
// cmdparams.CopyTo(tmpCmdparams, 1);
// if (!scene.Terrain.RunTerrainCmd(tmpCmdparams, ref result, scene.RegionInfo.RegionName))
// {
// m_log.Error(result);
// }
// }
// }
// break;
case "script":
m_localScenes.SendCommandToScripts(cmdparams);
break;
@ -526,12 +524,7 @@ namespace OpenSim
m_log.Error("Unknown command");
break;
}
}
else
{
//let the scene/region handle the command directly.
m_consoleRegion.ProcessConsoleCmd(command, cmdparams);
}
}
public void Debug(string[] args)

View File

@ -1246,7 +1246,7 @@ namespace OpenSim.Region.Environment.Scenes
}
#endregion
private void forceClientUpdate()
public void ForceClientUpdate()
{
foreach (EntityBase ent in this.Entities.Values)
{
@ -1257,80 +1257,6 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void ProcessConsoleCmd(string command, string[] cmdparams)
{
switch (command)
{
case "help":
MainLog.Instance.Error("alert - send alert to a designated user or all users.");
MainLog.Instance.Error(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive.");
MainLog.Instance.Error(" alert general [Message] - send an alert to all users.");
MainLog.Instance.Error("backup - trigger a region backup");
MainLog.Instance.Error("load-xml [filename] - load prims from a XML file into current region");
MainLog.Instance.Error("save-xml [filename] - save prims from current region to a XML file");
MainLog.Instance.Error("show users - show info about connected users in the current region.");
MainLog.Instance.Error("shutdown - disconnect all clients and shutdown.");
break;
case "show":
if (cmdparams.Length > 0)
{
Show(cmdparams[0]);
}
break;
case "save-xml":
if (cmdparams.Length > 0)
{
SavePrimsToXml(cmdparams[0]);
}
else
{
SavePrimsToXml("test.xml");
}
break;
case "load-xml":
if (cmdparams.Length > 0)
{
LoadPrimsFromXml(cmdparams[0]);
}
else
{
LoadPrimsFromXml("test.xml");
}
break;
case "set-time":
this.SetTimePhase(Convert.ToInt32(cmdparams[0]));
break;
case "force-update":
Console.WriteLine("Updating all clients");
this.forceClientUpdate();
break;
case "backup":
Backup();
break;
case "alert":
HandleAlertCommand(cmdparams);
break;
case "edit-scale":
if (cmdparams.Length == 4)
{
HandleEditCommand(cmdparams);
}
break;
default:
MainLog.Instance.Error("Unknown command: " + command);
break;
}
}
public void HandleEditCommand(string[] cmmdparams)
{
Console.WriteLine("Searching for Primitive: '" + cmmdparams[0] + "'");

View File

@ -206,5 +206,32 @@ namespace OpenSim.Region.Environment.Scenes
return null;
}
public void SetTimePhase(int timePhase)
{
ForEach(delegate(Scene scene)
{
scene.SetTimePhase(
timePhase)
;
});
}
public void ForceClientUpdate()
{
ForEach(delegate(Scene scene)
{
scene.ForceClientUpdate();
});
}
public void HandleEditCommand(string[] cmdparams)
{
ForEach(delegate(Scene scene)
{
scene.HandleEditCommand(cmdparams);
});
}
}
}