* Moved some commands from Scene into SceneManager so they could be used with 'root'
* Removed some duplicated commandsafrisby
parent
b3d2f8b8e2
commit
df58154781
|
@ -376,10 +376,25 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
string result = "";
|
string result = "";
|
||||||
|
|
||||||
if ((m_consoleRegion == null) || (command == "change-region") || (command == "shutdown"))
|
|
||||||
{
|
|
||||||
switch (command)
|
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":
|
case "debug":
|
||||||
if (cmdparams.Length > 0)
|
if (cmdparams.Length > 0)
|
||||||
{
|
{
|
||||||
|
@ -440,23 +455,6 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
break;
|
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":
|
case "script":
|
||||||
m_localScenes.SendCommandToScripts(cmdparams);
|
m_localScenes.SendCommandToScripts(cmdparams);
|
||||||
break;
|
break;
|
||||||
|
@ -501,7 +499,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
string regionName = this.CombineParams(cmdparams, 0);
|
string regionName = this.CombineParams(cmdparams, 0);
|
||||||
|
|
||||||
if( m_localScenes.TrySetCurrentRegion( regionName ) )
|
if (m_localScenes.TrySetCurrentRegion(regionName))
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -526,12 +524,7 @@ namespace OpenSim
|
||||||
m_log.Error("Unknown command");
|
m_log.Error("Unknown command");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//let the scene/region handle the command directly.
|
|
||||||
m_consoleRegion.ProcessConsoleCmd(command, cmdparams);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Debug(string[] args)
|
public void Debug(string[] args)
|
||||||
|
@ -579,12 +572,12 @@ namespace OpenSim
|
||||||
|
|
||||||
List<ScenePresence> avatars = m_localScenes.GetAvatars();
|
List<ScenePresence> avatars = m_localScenes.GetAvatars();
|
||||||
|
|
||||||
foreach( ScenePresence avatar in avatars )
|
foreach (ScenePresence avatar in avatars)
|
||||||
{
|
{
|
||||||
RegionInfo regionInfo = m_localScenes.GetRegionInfo( avatar.RegionHandle );
|
RegionInfo regionInfo = m_localScenes.GetRegionInfo(avatar.RegionHandle);
|
||||||
string regionName;
|
string regionName;
|
||||||
|
|
||||||
if( regionInfo == null )
|
if (regionInfo == null)
|
||||||
{
|
{
|
||||||
regionName = "Unresolvable";
|
regionName = "Unresolvable";
|
||||||
}
|
}
|
||||||
|
@ -601,7 +594,7 @@ namespace OpenSim
|
||||||
avatar.ControllingClient.AgentId,
|
avatar.ControllingClient.AgentId,
|
||||||
"Unknown",
|
"Unknown",
|
||||||
"Unknown",
|
"Unknown",
|
||||||
regionName ));
|
regionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1246,7 +1246,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void forceClientUpdate()
|
public void ForceClientUpdate()
|
||||||
{
|
{
|
||||||
foreach (EntityBase ent in this.Entities.Values)
|
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)
|
public void HandleEditCommand(string[] cmmdparams)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Searching for Primitive: '" + cmmdparams[0] + "'");
|
Console.WriteLine("Searching for Primitive: '" + cmmdparams[0] + "'");
|
||||||
|
|
|
@ -198,7 +198,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
foreach (Scene scene in m_localScenes)
|
||||||
{
|
{
|
||||||
if( scene.RegionInfo.RegionHandle == regionHandle )
|
if (scene.RegionInfo.RegionHandle == regionHandle)
|
||||||
{
|
{
|
||||||
return scene.RegionInfo;
|
return scene.RegionInfo;
|
||||||
}
|
}
|
||||||
|
@ -206,5 +206,32 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
return null;
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue