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.
ThreadPoolClientBranch
Tedd Hansen 2008-02-02 07:35:51 +00:00
parent b1a6f4821b
commit 2db5de3e72
8 changed files with 83 additions and 12 deletions

View File

@ -415,11 +415,12 @@ namespace OpenSim.Framework.Data.MySQL
} }
} }
static Random rnd = new Random();
public void StoreLandObject(Land parcel, LLUUID regionUUID) public void StoreLandObject(Land parcel, LLUUID regionUUID)
{ {
// Does the new locking fix it? // Does the new locking fix it?
//MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))"); MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))");
//System.Threading.Thread.Sleep(3000); System.Threading.Thread.Sleep(2500 + rnd.Next(300, 900));
lock (DBAccessLock) lock (DBAccessLock)
{ {
@ -1469,7 +1470,16 @@ namespace OpenSim.Framework.Data.MySQL
if (conn.State != ConnectionState.Open) if (conn.State != ConnectionState.Open)
{ {
conn.Open(); try
{
conn.Open();
}
catch (Exception ex)
{
MainLog.Instance.Error("MySql", "Error connecting to MySQL server: " + ex.Message);
MainLog.Instance.Error("MySql", "Application is terminating!");
System.Threading.Thread.CurrentThread.Abort();
}
} }
try try

View File

@ -310,7 +310,7 @@ namespace OpenSim.Framework
NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); NetworkServersInfo.DefaultHttpListenerPort.ToString(), false);
configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
"Allow sim to find alternate UDP ports when ports are in use?", "Allow sim to find alternate UDP ports when ports are in use?",
"false", false); "false", true);
configMember.addConfigurationOption("external_host_name", configMember.addConfigurationOption("external_host_name",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"External Host Name", "127.0.0.1", false); "External Host Name", "127.0.0.1", false);

View File

@ -720,6 +720,9 @@ namespace OpenSim
m_log.Error("show modules - shows info aboutloaded modules."); 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("stats - statistical information for this server not displayed in the client");
m_log.Error("shutdown - disconnect all clients and shutdown."); 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."); m_log.Error("terrain help - show help for terrain commands.");
break; break;
@ -912,7 +915,65 @@ namespace OpenSim
} }
break; 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: default:
m_log.Error("Unknown command"); m_log.Error("Unknown command");
break; break;

View File

@ -257,7 +257,7 @@ namespace OpenSim.Region.ClientStack
{ {
uint newPort = listenPort; uint newPort = listenPort;
for (uint i = 0; i < 10; i++) for (uint i = 0; i < 20; i++)
{ {
newPort = listenPort + i; newPort = listenPort + i;
m_log.Verbose("SERVER", "Opening UDP socket on " + listenIP.ToString() + " " + newPort + ". Allow alternate ports: " + Allow_Alternate_Port.ToString()); m_log.Verbose("SERVER", "Opening UDP socket on " + listenIP.ToString() + " " + newPort + ". Allow alternate ports: " + Allow_Alternate_Port.ToString());

View File

@ -134,14 +134,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
#if DEBUG #if DEBUG
Log.Debug(ScriptEngineName, "Refreshing configuration for all modules"); Log.Debug(ScriptEngineName, "Refreshing configuration for all modules");
#endif #endif
RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 0); RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 30);
// Reload from disk // Reload from disk? No!
//ConfigSource.Reload(); //ConfigSource.Reload();
if (File.Exists(OpenSim.Application.iniFilePath)) //if (File.Exists(OpenSim.Application.iniFilePath))
{ //{
//ConfigSource.Merge(new IniConfigSource(OpenSim.Application.iniFilePath)); // //ConfigSource.Merge(new IniConfigSource(OpenSim.Application.iniFilePath));
} //}
// Create a new object (probably not necessary?) // Create a new object (probably not necessary?)

Binary file not shown.

Binary file not shown.

Binary file not shown.