mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Added commands to change config file from console:
CONFIG SET section key value value value CONFIG GET section key CONFIG SAVE (it saves, but does it save correctly?:) ScriptEngine will react correctly to any config change made while it is running.
This commit is contained in:
@@ -720,6 +720,9 @@ namespace OpenSim
|
||||
m_log.Error("show modules - shows info aboutloaded modules.");
|
||||
m_log.Error("stats - statistical information for this server not displayed in the client");
|
||||
m_log.Error("shutdown - disconnect all clients and shutdown.");
|
||||
m_log.Error("config set category field value - set a config value");
|
||||
m_log.Error("config get category field - get a config value");
|
||||
m_log.Error("config save - save OpenSim.ini");
|
||||
m_log.Error("terrain help - show help for terrain commands.");
|
||||
break;
|
||||
|
||||
@@ -911,8 +914,66 @@ namespace OpenSim
|
||||
MainLog.Instance.Notice("STATS", "Extra statistics collection has not been enabled");
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case "config":
|
||||
string n = command.ToUpper();
|
||||
if (cmdparams.Length > 0)
|
||||
{
|
||||
switch (cmdparams[0].ToLower())
|
||||
{
|
||||
case "set":
|
||||
if (cmdparams.Length < 4)
|
||||
{
|
||||
MainLog.Instance.Notice(n, "SYNTAX: " + n + " SET SECTION KEY VALUE");
|
||||
MainLog.Instance.Notice(n, "EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5");
|
||||
}
|
||||
else
|
||||
{
|
||||
IConfig c = DefaultConfig().Configs[cmdparams[1]];
|
||||
if (c == null)
|
||||
c = DefaultConfig().AddConfig(cmdparams[1]);
|
||||
string _value = String.Join(" ", cmdparams, 3, cmdparams.Length - 3);
|
||||
c.Set(cmdparams[2], _value);
|
||||
m_config.Merge(c.ConfigSource);
|
||||
|
||||
MainLog.Instance.Notice(n,
|
||||
n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " +
|
||||
_value);
|
||||
}
|
||||
break;
|
||||
case "get":
|
||||
if (cmdparams.Length < 3)
|
||||
{
|
||||
MainLog.Instance.Notice(n, "SYNTAX: " + n + " GET SECTION KEY");
|
||||
MainLog.Instance.Notice(n, "EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads");
|
||||
}
|
||||
else
|
||||
{
|
||||
IConfig c = DefaultConfig().Configs[cmdparams[1]];
|
||||
if (c == null)
|
||||
{
|
||||
MainLog.Instance.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist.");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Notice(n,
|
||||
n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " +
|
||||
c.GetString(cmdparams[2]));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case "save":
|
||||
MainLog.Instance.Notice(n, "Saving configuration file: " + Application.iniFilePath);
|
||||
m_config.Save(Application.iniFilePath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
break;
|
||||
default:
|
||||
m_log.Error("Unknown command");
|
||||
break;
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace OpenSim.Region.ClientStack
|
||||
{
|
||||
|
||||
uint newPort = listenPort;
|
||||
for (uint i = 0; i < 10; i++)
|
||||
for (uint i = 0; i < 20; i++)
|
||||
{
|
||||
newPort = listenPort + i;
|
||||
m_log.Verbose("SERVER", "Opening UDP socket on " + listenIP.ToString() + " " + newPort + ". Allow alternate ports: " + Allow_Alternate_Port.ToString());
|
||||
|
||||
@@ -134,14 +134,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
#if DEBUG
|
||||
Log.Debug(ScriptEngineName, "Refreshing configuration for all modules");
|
||||
#endif
|
||||
RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 0);
|
||||
RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 30);
|
||||
|
||||
// Reload from disk
|
||||
// Reload from disk? No!
|
||||
//ConfigSource.Reload();
|
||||
if (File.Exists(OpenSim.Application.iniFilePath))
|
||||
{
|
||||
//ConfigSource.Merge(new IniConfigSource(OpenSim.Application.iniFilePath));
|
||||
}
|
||||
//if (File.Exists(OpenSim.Application.iniFilePath))
|
||||
//{
|
||||
// //ConfigSource.Merge(new IniConfigSource(OpenSim.Application.iniFilePath));
|
||||
//}
|
||||
|
||||
|
||||
// Create a new object (probably not necessary?)
|
||||
|
||||
Reference in New Issue
Block a user