aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authormingchen2007-11-03 17:49:45 +0000
committermingchen2007-11-03 17:49:45 +0000
commitb51a900bebe914650c1c7db7b77f74c5ac107f6d (patch)
treeb93c86b110df48df3c17823358fc2e2185319e0b
parent* Removed unused UDPServerBase (diff)
downloadopensim-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.
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs1
-rw-r--r--OpenSim/Framework/ConfigurationMember.cs55
-rw-r--r--OpenSim/Framework/ConfigurationOption.cs4
-rw-r--r--OpenSim/Framework/IUserService.cs1
-rw-r--r--OpenSim/Framework/RegionInfo.cs19
-rw-r--r--OpenSim/Grid/UserServer/UserManager.cs5
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs13
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs10
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs10
9 files changed, 98 insertions, 20 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;
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs
index 96cdfb3..58e9677 100644
--- a/OpenSim/Grid/UserServer/UserManager.cs
+++ b/OpenSim/Grid/UserServer/UserManager.cs
@@ -168,5 +168,10 @@ namespace OpenSim.Grid.UserServer
168 { 168 {
169 throw new Exception("The method or operation is not implemented."); 169 throw new Exception("The method or operation is not implemented.");
170 } 170 }
171
172 public override UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid)
173 {
174 throw new Exception("The method or operation is not implemented.");
175 }
171 } 176 }
172} \ No newline at end of file 177} \ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 7551bff..6071dcd 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -113,10 +113,19 @@ namespace OpenSim.Region.ClientStack
113 scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D()); 113 scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D());
114 114
115 //Master Avatar Setup 115 //Master Avatar Setup
116 UserProfileData masterAvatar = 116 UserProfileData masterAvatar;
117 m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, 117 if (scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
118 {
119 masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID);
120 }
121 else
122 {
123 masterAvatar =
124 m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName,
118 scene.RegionInfo.MasterAvatarLastName, 125 scene.RegionInfo.MasterAvatarLastName,
119 scene.RegionInfo.MasterAvatarSandboxPassword); 126 scene.RegionInfo.MasterAvatarSandboxPassword);
127 }
128
120 if (masterAvatar != null) 129 if (masterAvatar != null)
121 { 130 {
122 m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]"); 131 m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]");
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index a7687c7..d8c4b1d 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -81,5 +81,15 @@ namespace OpenSim.Region.Communications.Local
81 81
82 return profile; 82 return profile;
83 } 83 }
84
85 public override UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid)
86 {
87 UserProfileData data = GetUserProfile(uuid);
88 if (data == null)
89 {
90 throw new Exception("Unknown master user UUID");
91 }
92 return data;
93 }
84 } 94 }
85} \ No newline at end of file 95} \ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index d00a813..990998e 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -145,6 +145,16 @@ namespace OpenSim.Region.Communications.OGS1
145 return profile; 145 return profile;
146 } 146 }
147 147
148 public UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid)
149 {
150 UserProfileData data = GetUserProfile(uuid);
151 if (data == null)
152 {
153 throw new Exception("Unknown master user UUID");
154 }
155 return data;
156 }
157
148 public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) 158 public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
149 { 159 {
150 throw new Exception("The method or operation is not implemented."); 160 throw new Exception("The method or operation is not implemented.");