diff options
author | mingchen | 2007-11-03 17:49:45 +0000 |
---|---|---|
committer | mingchen | 2007-11-03 17:49:45 +0000 |
commit | b51a900bebe914650c1c7db7b77f74c5ac107f6d (patch) | |
tree | b93c86b110df48df3c17823358fc2e2185319e0b /OpenSim/Framework | |
parent | * Removed unused UDPServerBase (diff) | |
download | opensim-SC_OLD-b51a900bebe914650c1c7db7b77f74c5ac107f6d.zip opensim-SC_OLD-b51a900bebe914650c1c7db7b77f74c5ac107f6d.tar.gz opensim-SC_OLD-b51a900bebe914650c1c7db7b77f74c5ac107f6d.tar.bz2 opensim-SC_OLD-b51a900bebe914650c1c7db7b77f74c5ac107f6d.tar.xz |
*Master Avatar can be specified by a previous UUID in either grid mode or standalone mode by specifying a master_avatar_uuid attribute in the place of master_avatar_xxxx_name and master_avatar_password.You will not be asked for the name and password if a valid UUID is specified.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Communications/UserManagerBase.cs | 1 | ||||
-rw-r--r-- | OpenSim/Framework/ConfigurationMember.cs | 55 | ||||
-rw-r--r-- | OpenSim/Framework/ConfigurationOption.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/IUserService.cs | 1 | ||||
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 19 |
5 files changed, 62 insertions, 18 deletions
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index cdc3baf..408f37c 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -376,5 +376,6 @@ namespace OpenSim.Framework.UserManagement | |||
376 | 376 | ||
377 | public abstract UserProfileData SetupMasterUser(string firstName, string lastName); | 377 | public abstract UserProfileData SetupMasterUser(string firstName, string lastName); |
378 | public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password); | 378 | public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password); |
379 | public abstract UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid); | ||
379 | } | 380 | } |
380 | } \ No newline at end of file | 381 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/ConfigurationMember.cs b/OpenSim/Framework/ConfigurationMember.cs index 19275b3..e4cd9d8 100644 --- a/OpenSim/Framework/ConfigurationMember.cs +++ b/OpenSim/Framework/ConfigurationMember.cs | |||
@@ -92,6 +92,21 @@ namespace OpenSim.Framework | |||
92 | { | 92 | { |
93 | configurationPluginFilename = dll_filename; | 93 | configurationPluginFilename = dll_filename; |
94 | } | 94 | } |
95 | private void checkAndAddConfigOption(ConfigurationOption option) | ||
96 | { | ||
97 | if ((option.configurationKey != "" && option.configurationQuestion != "") || (option.configurationKey != "" && option.configurationUseDefaultNoPrompt)) | ||
98 | { | ||
99 | if (!configurationOptions.Contains(option)) | ||
100 | { | ||
101 | configurationOptions.Add(option); | ||
102 | } | ||
103 | } | ||
104 | else | ||
105 | { | ||
106 | MainLog.Instance.Notice("Required fields for adding a configuration option is invalid. Will not add this option (" + option.configurationKey + ")"); | ||
107 | } | ||
108 | } | ||
109 | |||
95 | public void addConfigurationOption(string configuration_key, ConfigurationOption.ConfigurationTypes configuration_type, string configuration_question, string configuration_default, bool use_default_no_prompt) | 110 | public void addConfigurationOption(string configuration_key, ConfigurationOption.ConfigurationTypes configuration_type, string configuration_question, string configuration_default, bool use_default_no_prompt) |
96 | { | 111 | { |
97 | ConfigurationOption configOption = new ConfigurationOption(); | 112 | ConfigurationOption configOption = new ConfigurationOption(); |
@@ -100,18 +115,20 @@ namespace OpenSim.Framework | |||
100 | configOption.configurationDefault = configuration_default; | 115 | configOption.configurationDefault = configuration_default; |
101 | configOption.configurationType = configuration_type; | 116 | configOption.configurationType = configuration_type; |
102 | configOption.configurationUseDefaultNoPrompt = use_default_no_prompt; | 117 | configOption.configurationUseDefaultNoPrompt = use_default_no_prompt; |
118 | configOption.shouldIBeAsked = null; //Assumes true, I can ask whenever | ||
119 | checkAndAddConfigOption(configOption); | ||
120 | } | ||
103 | 121 | ||
104 | if ((configuration_key != "" && configuration_question != "") || (configuration_key != "" && use_default_no_prompt)) | 122 | public void addConfigurationOption(string configuration_key, ConfigurationOption.ConfigurationTypes configuration_type, string configuration_question, string configuration_default, bool use_default_no_prompt, ConfigurationOption.ConfigurationOptionShouldBeAsked shouldIBeAskedDelegate) |
105 | { | 123 | { |
106 | if (!configurationOptions.Contains(configOption)) | 124 | ConfigurationOption configOption = new ConfigurationOption(); |
107 | { | 125 | configOption.configurationKey = configuration_key; |
108 | configurationOptions.Add(configOption); | 126 | configOption.configurationQuestion = configuration_question; |
109 | } | 127 | configOption.configurationDefault = configuration_default; |
110 | } | 128 | configOption.configurationType = configuration_type; |
111 | else | 129 | configOption.configurationUseDefaultNoPrompt = use_default_no_prompt; |
112 | { | 130 | configOption.shouldIBeAsked = shouldIBeAskedDelegate; |
113 | MainLog.Instance.Notice("Required fields for adding a configuration option is invalid. Will not add this option (" + configuration_key + ")"); | 131 | checkAndAddConfigOption(configOption); |
114 | } | ||
115 | } | 132 | } |
116 | 133 | ||
117 | public void performConfigurationRetrieve() | 134 | public void performConfigurationRetrieve() |
@@ -195,15 +212,23 @@ namespace OpenSim.Framework | |||
195 | } | 212 | } |
196 | else | 213 | else |
197 | { | 214 | { |
198 | 215 | if ((configOption.shouldIBeAsked != null && configOption.shouldIBeAsked(configOption.configurationKey)) || configOption.shouldIBeAsked == null) | |
199 | if (configurationDescription.Trim() != "") | ||
200 | { | 216 | { |
201 | console_result = MainLog.Instance.CmdPrompt(configurationDescription + ": " + configOption.configurationQuestion, configOption.configurationDefault); | 217 | if (configurationDescription.Trim() != "") |
218 | { | ||
219 | console_result = MainLog.Instance.CmdPrompt(configurationDescription + ": " + configOption.configurationQuestion, configOption.configurationDefault); | ||
220 | } | ||
221 | else | ||
222 | { | ||
223 | console_result = MainLog.Instance.CmdPrompt(configOption.configurationQuestion, configOption.configurationDefault); | ||
224 | } | ||
202 | } | 225 | } |
203 | else | 226 | else |
204 | { | 227 | { |
205 | console_result = MainLog.Instance.CmdPrompt(configOption.configurationQuestion, configOption.configurationDefault); | 228 | //Dont Ask! Just use default |
229 | console_result = configOption.configurationDefault; | ||
206 | } | 230 | } |
231 | |||
207 | } | 232 | } |
208 | } | 233 | } |
209 | else | 234 | else |
diff --git a/OpenSim/Framework/ConfigurationOption.cs b/OpenSim/Framework/ConfigurationOption.cs index ec39d3d..b83be5e 100644 --- a/OpenSim/Framework/ConfigurationOption.cs +++ b/OpenSim/Framework/ConfigurationOption.cs | |||
@@ -30,6 +30,9 @@ namespace OpenSim.Framework | |||
30 | { | 30 | { |
31 | public class ConfigurationOption | 31 | public class ConfigurationOption |
32 | { | 32 | { |
33 | |||
34 | public delegate bool ConfigurationOptionShouldBeAsked(string configuration_key); | ||
35 | |||
33 | public enum ConfigurationTypes | 36 | public enum ConfigurationTypes |
34 | { | 37 | { |
35 | TYPE_STRING, | 38 | TYPE_STRING, |
@@ -56,5 +59,6 @@ namespace OpenSim.Framework | |||
56 | 59 | ||
57 | public ConfigurationTypes configurationType = ConfigurationTypes.TYPE_STRING; | 60 | public ConfigurationTypes configurationType = ConfigurationTypes.TYPE_STRING; |
58 | public bool configurationUseDefaultNoPrompt = false; | 61 | public bool configurationUseDefaultNoPrompt = false; |
62 | public ConfigurationOptionShouldBeAsked shouldIBeAsked; //Should I be asked now? Based on previous answers | ||
59 | } | 63 | } |
60 | } \ No newline at end of file | 64 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/IUserService.cs b/OpenSim/Framework/IUserService.cs index ed9032b..6465a48 100644 --- a/OpenSim/Framework/IUserService.cs +++ b/OpenSim/Framework/IUserService.cs | |||
@@ -38,6 +38,7 @@ namespace OpenSim.Framework.Interfaces | |||
38 | 38 | ||
39 | UserProfileData SetupMasterUser(string firstName, string lastName); | 39 | UserProfileData SetupMasterUser(string firstName, string lastName); |
40 | UserProfileData SetupMasterUser(string firstName, string lastName, string password); | 40 | UserProfileData SetupMasterUser(string firstName, string lastName, string password); |
41 | UserProfileData SetupMasterUser(LLUUID userId); | ||
41 | 42 | ||
42 | /// <summary> | 43 | /// <summary> |
43 | /// | 44 | /// |
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index a32b43c..2a75dbc 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -293,9 +293,19 @@ namespace OpenSim.Framework | |||
293 | configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); | 293 | configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); |
294 | configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); | 294 | configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); |
295 | configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); | 295 | configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); |
296 | configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", "Test", false); | 296 | configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Master Avatar UUID", LLUUID.Zero.ToString(), true); |
297 | configMember.addConfigurationOption("master_avatar_last", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Name of Master Avatar", "User", false); | 297 | configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", "Test", false,(ConfigurationOption.ConfigurationOptionShouldBeAsked)shouldMasterAvatarDetailsBeAsked); |
298 | configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", "test", false); | 298 | configMember.addConfigurationOption("master_avatar_last", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Name of Master Avatar", "User", false, (ConfigurationOption.ConfigurationOptionShouldBeAsked)shouldMasterAvatarDetailsBeAsked); |
299 | configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", "test", false, (ConfigurationOption.ConfigurationOptionShouldBeAsked)shouldMasterAvatarDetailsBeAsked); | ||
300 | } | ||
301 | |||
302 | public bool shouldMasterAvatarDetailsBeAsked(string configuration_key) | ||
303 | { | ||
304 | if (MasterAvatarAssignedUUID == null || MasterAvatarAssignedUUID.ToStringHyphenated() == LLUUID.Zero.ToStringHyphenated()) | ||
305 | { | ||
306 | return true; | ||
307 | } | ||
308 | return false; | ||
299 | } | 309 | } |
300 | 310 | ||
301 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | 311 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) |
@@ -334,6 +344,9 @@ namespace OpenSim.Framework | |||
334 | this.m_externalHostName = Util.GetLocalHost().ToString(); | 344 | this.m_externalHostName = Util.GetLocalHost().ToString(); |
335 | } | 345 | } |
336 | break; | 346 | break; |
347 | case "master_avatar_uuid": | ||
348 | this.MasterAvatarAssignedUUID = (LLUUID)configuration_result; | ||
349 | break; | ||
337 | case "master_avatar_first": | 350 | case "master_avatar_first": |
338 | this.MasterAvatarFirstName = (string)configuration_result; | 351 | this.MasterAvatarFirstName = (string)configuration_result; |
339 | break; | 352 | break; |