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/Region/Application/OpenSimMain.cs | |
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/Region/Application/OpenSimMain.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 63 |
1 files changed, 62 insertions, 1 deletions
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; |