diff options
author | Tedd Hansen | 2008-02-02 07:35:51 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-02-02 07:35:51 +0000 |
commit | 2db5de3e7217ca4bd9fcaf5345ea5672b5d6663f (patch) | |
tree | 933067db00bb5a76447802aadc6405094ed6b673 /OpenSim | |
parent | Updated svn properties. (diff) | |
download | opensim-SC-2db5de3e7217ca4bd9fcaf5345ea5672b5d6663f.zip opensim-SC-2db5de3e7217ca4bd9fcaf5345ea5672b5d6663f.tar.gz opensim-SC-2db5de3e7217ca4bd9fcaf5345ea5672b5d6663f.tar.bz2 opensim-SC-2db5de3e7217ca4bd9fcaf5345ea5672b5d6663f.tar.xz |
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.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 16 | ||||
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 63 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/UDPServer.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | 12 |
5 files changed, 83 insertions, 12 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs index 45d0720..b25924c 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | |||
@@ -415,11 +415,12 @@ namespace OpenSim.Framework.Data.MySQL | |||
415 | } | 415 | } |
416 | } | 416 | } |
417 | 417 | ||
418 | static Random rnd = new Random(); | ||
418 | public void StoreLandObject(Land parcel, LLUUID regionUUID) | 419 | public void StoreLandObject(Land parcel, LLUUID regionUUID) |
419 | { | 420 | { |
420 | // Does the new locking fix it? | 421 | // Does the new locking fix it? |
421 | //MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))"); | 422 | MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))"); |
422 | //System.Threading.Thread.Sleep(3000); | 423 | System.Threading.Thread.Sleep(2500 + rnd.Next(300, 900)); |
423 | 424 | ||
424 | lock (DBAccessLock) | 425 | lock (DBAccessLock) |
425 | { | 426 | { |
@@ -1469,7 +1470,16 @@ namespace OpenSim.Framework.Data.MySQL | |||
1469 | 1470 | ||
1470 | if (conn.State != ConnectionState.Open) | 1471 | if (conn.State != ConnectionState.Open) |
1471 | { | 1472 | { |
1472 | conn.Open(); | 1473 | try |
1474 | { | ||
1475 | conn.Open(); | ||
1476 | } | ||
1477 | catch (Exception ex) | ||
1478 | { | ||
1479 | MainLog.Instance.Error("MySql", "Error connecting to MySQL server: " + ex.Message); | ||
1480 | MainLog.Instance.Error("MySql", "Application is terminating!"); | ||
1481 | System.Threading.Thread.CurrentThread.Abort(); | ||
1482 | } | ||
1473 | } | 1483 | } |
1474 | 1484 | ||
1475 | try | 1485 | try |
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index b843774..be0b3e0 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -310,7 +310,7 @@ namespace OpenSim.Framework | |||
310 | NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); | 310 | NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); |
311 | configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | 311 | configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, |
312 | "Allow sim to find alternate UDP ports when ports are in use?", | 312 | "Allow sim to find alternate UDP ports when ports are in use?", |
313 | "false", false); | 313 | "false", true); |
314 | configMember.addConfigurationOption("external_host_name", | 314 | configMember.addConfigurationOption("external_host_name", |
315 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | 315 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, |
316 | "External Host Name", "127.0.0.1", false); | 316 | "External Host Name", "127.0.0.1", false); |
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 8934be2..223b4a5 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -720,6 +720,9 @@ namespace OpenSim | |||
720 | m_log.Error("show modules - shows info aboutloaded modules."); | 720 | m_log.Error("show modules - shows info aboutloaded modules."); |
721 | m_log.Error("stats - statistical information for this server not displayed in the client"); | 721 | m_log.Error("stats - statistical information for this server not displayed in the client"); |
722 | m_log.Error("shutdown - disconnect all clients and shutdown."); | 722 | m_log.Error("shutdown - disconnect all clients and shutdown."); |
723 | m_log.Error("config set category field value - set a config value"); | ||
724 | m_log.Error("config get category field - get a config value"); | ||
725 | m_log.Error("config save - save OpenSim.ini"); | ||
723 | m_log.Error("terrain help - show help for terrain commands."); | 726 | m_log.Error("terrain help - show help for terrain commands."); |
724 | break; | 727 | break; |
725 | 728 | ||
@@ -911,8 +914,66 @@ namespace OpenSim | |||
911 | MainLog.Instance.Notice("STATS", "Extra statistics collection has not been enabled"); | 914 | MainLog.Instance.Notice("STATS", "Extra statistics collection has not been enabled"); |
912 | } | 915 | } |
913 | break; | 916 | break; |
914 | |||
915 | 917 | ||
918 | case "config": | ||
919 | string n = command.ToUpper(); | ||
920 | if (cmdparams.Length > 0) | ||
921 | { | ||
922 | switch (cmdparams[0].ToLower()) | ||
923 | { | ||
924 | case "set": | ||
925 | if (cmdparams.Length < 4) | ||
926 | { | ||
927 | MainLog.Instance.Notice(n, "SYNTAX: " + n + " SET SECTION KEY VALUE"); | ||
928 | MainLog.Instance.Notice(n, "EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5"); | ||
929 | } | ||
930 | else | ||
931 | { | ||
932 | IConfig c = DefaultConfig().Configs[cmdparams[1]]; | ||
933 | if (c == null) | ||
934 | c = DefaultConfig().AddConfig(cmdparams[1]); | ||
935 | string _value = String.Join(" ", cmdparams, 3, cmdparams.Length - 3); | ||
936 | c.Set(cmdparams[2], _value); | ||
937 | m_config.Merge(c.ConfigSource); | ||
938 | |||
939 | MainLog.Instance.Notice(n, | ||
940 | n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + | ||
941 | _value); | ||
942 | } | ||
943 | break; | ||
944 | case "get": | ||
945 | if (cmdparams.Length < 3) | ||
946 | { | ||
947 | MainLog.Instance.Notice(n, "SYNTAX: " + n + " GET SECTION KEY"); | ||
948 | MainLog.Instance.Notice(n, "EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads"); | ||
949 | } | ||
950 | else | ||
951 | { | ||
952 | IConfig c = DefaultConfig().Configs[cmdparams[1]]; | ||
953 | if (c == null) | ||
954 | { | ||
955 | MainLog.Instance.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist."); | ||
956 | break; | ||
957 | } | ||
958 | else | ||
959 | { | ||
960 | MainLog.Instance.Notice(n, | ||
961 | n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " + | ||
962 | c.GetString(cmdparams[2])); | ||
963 | } | ||
964 | } | ||
965 | |||
966 | break; | ||
967 | case "save": | ||
968 | MainLog.Instance.Notice(n, "Saving configuration file: " + Application.iniFilePath); | ||
969 | m_config.Save(Application.iniFilePath); | ||
970 | break; | ||
971 | } | ||
972 | } | ||
973 | else | ||
974 | { | ||
975 | } | ||
976 | break; | ||
916 | default: | 977 | default: |
917 | m_log.Error("Unknown command"); | 978 | m_log.Error("Unknown command"); |
918 | break; | 979 | break; |
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index e292c2c..0fd3486 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs | |||
@@ -257,7 +257,7 @@ namespace OpenSim.Region.ClientStack | |||
257 | { | 257 | { |
258 | 258 | ||
259 | uint newPort = listenPort; | 259 | uint newPort = listenPort; |
260 | for (uint i = 0; i < 10; i++) | 260 | for (uint i = 0; i < 20; i++) |
261 | { | 261 | { |
262 | newPort = listenPort + i; | 262 | newPort = listenPort + i; |
263 | m_log.Verbose("SERVER", "Opening UDP socket on " + listenIP.ToString() + " " + newPort + ". Allow alternate ports: " + Allow_Alternate_Port.ToString()); | 263 | m_log.Verbose("SERVER", "Opening UDP socket on " + listenIP.ToString() + " " + newPort + ". Allow alternate ports: " + Allow_Alternate_Port.ToString()); |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs index 0b58da0..4cf39b4 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | |||
@@ -134,14 +134,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
134 | #if DEBUG | 134 | #if DEBUG |
135 | Log.Debug(ScriptEngineName, "Refreshing configuration for all modules"); | 135 | Log.Debug(ScriptEngineName, "Refreshing configuration for all modules"); |
136 | #endif | 136 | #endif |
137 | RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 0); | 137 | RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 30); |
138 | 138 | ||
139 | // Reload from disk | 139 | // Reload from disk? No! |
140 | //ConfigSource.Reload(); | 140 | //ConfigSource.Reload(); |
141 | if (File.Exists(OpenSim.Application.iniFilePath)) | 141 | //if (File.Exists(OpenSim.Application.iniFilePath)) |
142 | { | 142 | //{ |
143 | //ConfigSource.Merge(new IniConfigSource(OpenSim.Application.iniFilePath)); | 143 | // //ConfigSource.Merge(new IniConfigSource(OpenSim.Application.iniFilePath)); |
144 | } | 144 | //} |
145 | 145 | ||
146 | 146 | ||
147 | // Create a new object (probably not necessary?) | 147 | // Create a new object (probably not necessary?) |