*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.
parent
5b4e4cb3ac
commit
b51a900beb
|
@ -376,5 +376,6 @@ namespace OpenSim.Framework.UserManagement
|
|||
|
||||
public abstract UserProfileData SetupMasterUser(string firstName, string lastName);
|
||||
public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password);
|
||||
public abstract UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid);
|
||||
}
|
||||
}
|
|
@ -92,6 +92,21 @@ namespace OpenSim.Framework
|
|||
{
|
||||
configurationPluginFilename = dll_filename;
|
||||
}
|
||||
private void checkAndAddConfigOption(ConfigurationOption option)
|
||||
{
|
||||
if ((option.configurationKey != "" && option.configurationQuestion != "") || (option.configurationKey != "" && option.configurationUseDefaultNoPrompt))
|
||||
{
|
||||
if (!configurationOptions.Contains(option))
|
||||
{
|
||||
configurationOptions.Add(option);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Notice("Required fields for adding a configuration option is invalid. Will not add this option (" + option.configurationKey + ")");
|
||||
}
|
||||
}
|
||||
|
||||
public void addConfigurationOption(string configuration_key, ConfigurationOption.ConfigurationTypes configuration_type, string configuration_question, string configuration_default, bool use_default_no_prompt)
|
||||
{
|
||||
ConfigurationOption configOption = new ConfigurationOption();
|
||||
|
@ -100,18 +115,20 @@ namespace OpenSim.Framework
|
|||
configOption.configurationDefault = configuration_default;
|
||||
configOption.configurationType = configuration_type;
|
||||
configOption.configurationUseDefaultNoPrompt = use_default_no_prompt;
|
||||
configOption.shouldIBeAsked = null; //Assumes true, I can ask whenever
|
||||
checkAndAddConfigOption(configOption);
|
||||
}
|
||||
|
||||
if ((configuration_key != "" && configuration_question != "") || (configuration_key != "" && use_default_no_prompt))
|
||||
{
|
||||
if (!configurationOptions.Contains(configOption))
|
||||
{
|
||||
configurationOptions.Add(configOption);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Notice("Required fields for adding a configuration option is invalid. Will not add this option (" + configuration_key + ")");
|
||||
}
|
||||
public void addConfigurationOption(string configuration_key, ConfigurationOption.ConfigurationTypes configuration_type, string configuration_question, string configuration_default, bool use_default_no_prompt, ConfigurationOption.ConfigurationOptionShouldBeAsked shouldIBeAskedDelegate)
|
||||
{
|
||||
ConfigurationOption configOption = new ConfigurationOption();
|
||||
configOption.configurationKey = configuration_key;
|
||||
configOption.configurationQuestion = configuration_question;
|
||||
configOption.configurationDefault = configuration_default;
|
||||
configOption.configurationType = configuration_type;
|
||||
configOption.configurationUseDefaultNoPrompt = use_default_no_prompt;
|
||||
configOption.shouldIBeAsked = shouldIBeAskedDelegate;
|
||||
checkAndAddConfigOption(configOption);
|
||||
}
|
||||
|
||||
public void performConfigurationRetrieve()
|
||||
|
@ -195,15 +212,23 @@ namespace OpenSim.Framework
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (configurationDescription.Trim() != "")
|
||||
if ((configOption.shouldIBeAsked != null && configOption.shouldIBeAsked(configOption.configurationKey)) || configOption.shouldIBeAsked == null)
|
||||
{
|
||||
console_result = MainLog.Instance.CmdPrompt(configurationDescription + ": " + configOption.configurationQuestion, configOption.configurationDefault);
|
||||
if (configurationDescription.Trim() != "")
|
||||
{
|
||||
console_result = MainLog.Instance.CmdPrompt(configurationDescription + ": " + configOption.configurationQuestion, configOption.configurationDefault);
|
||||
}
|
||||
else
|
||||
{
|
||||
console_result = MainLog.Instance.CmdPrompt(configOption.configurationQuestion, configOption.configurationDefault);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
console_result = MainLog.Instance.CmdPrompt(configOption.configurationQuestion, configOption.configurationDefault);
|
||||
//Dont Ask! Just use default
|
||||
console_result = configOption.configurationDefault;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -30,6 +30,9 @@ namespace OpenSim.Framework
|
|||
{
|
||||
public class ConfigurationOption
|
||||
{
|
||||
|
||||
public delegate bool ConfigurationOptionShouldBeAsked(string configuration_key);
|
||||
|
||||
public enum ConfigurationTypes
|
||||
{
|
||||
TYPE_STRING,
|
||||
|
@ -56,5 +59,6 @@ namespace OpenSim.Framework
|
|||
|
||||
public ConfigurationTypes configurationType = ConfigurationTypes.TYPE_STRING;
|
||||
public bool configurationUseDefaultNoPrompt = false;
|
||||
public ConfigurationOptionShouldBeAsked shouldIBeAsked; //Should I be asked now? Based on previous answers
|
||||
}
|
||||
}
|
|
@ -38,6 +38,7 @@ namespace OpenSim.Framework.Interfaces
|
|||
|
||||
UserProfileData SetupMasterUser(string firstName, string lastName);
|
||||
UserProfileData SetupMasterUser(string firstName, string lastName, string password);
|
||||
UserProfileData SetupMasterUser(LLUUID userId);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
|
|
@ -293,9 +293,19 @@ namespace OpenSim.Framework
|
|||
configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false);
|
||||
configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", NetworkServersInfo.DefaultHttpListenerPort.ToString(), false);
|
||||
configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false);
|
||||
configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", "Test", false);
|
||||
configMember.addConfigurationOption("master_avatar_last", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Name of Master Avatar", "User", false);
|
||||
configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", "test", false);
|
||||
configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Master Avatar UUID", LLUUID.Zero.ToString(), true);
|
||||
configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", "Test", false,(ConfigurationOption.ConfigurationOptionShouldBeAsked)shouldMasterAvatarDetailsBeAsked);
|
||||
configMember.addConfigurationOption("master_avatar_last", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Name of Master Avatar", "User", false, (ConfigurationOption.ConfigurationOptionShouldBeAsked)shouldMasterAvatarDetailsBeAsked);
|
||||
configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", "test", false, (ConfigurationOption.ConfigurationOptionShouldBeAsked)shouldMasterAvatarDetailsBeAsked);
|
||||
}
|
||||
|
||||
public bool shouldMasterAvatarDetailsBeAsked(string configuration_key)
|
||||
{
|
||||
if (MasterAvatarAssignedUUID == null || MasterAvatarAssignedUUID.ToStringHyphenated() == LLUUID.Zero.ToStringHyphenated())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
|
||||
|
@ -334,6 +344,9 @@ namespace OpenSim.Framework
|
|||
this.m_externalHostName = Util.GetLocalHost().ToString();
|
||||
}
|
||||
break;
|
||||
case "master_avatar_uuid":
|
||||
this.MasterAvatarAssignedUUID = (LLUUID)configuration_result;
|
||||
break;
|
||||
case "master_avatar_first":
|
||||
this.MasterAvatarFirstName = (string)configuration_result;
|
||||
break;
|
||||
|
|
|
@ -168,5 +168,10 @@ namespace OpenSim.Grid.UserServer
|
|||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
public override UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid)
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -113,10 +113,19 @@ namespace OpenSim.Region.ClientStack
|
|||
scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D());
|
||||
|
||||
//Master Avatar Setup
|
||||
UserProfileData masterAvatar =
|
||||
m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName,
|
||||
UserProfileData masterAvatar;
|
||||
if (scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
|
||||
{
|
||||
masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID);
|
||||
}
|
||||
else
|
||||
{
|
||||
masterAvatar =
|
||||
m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName,
|
||||
scene.RegionInfo.MasterAvatarLastName,
|
||||
scene.RegionInfo.MasterAvatarSandboxPassword);
|
||||
}
|
||||
|
||||
if (masterAvatar != null)
|
||||
{
|
||||
m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]");
|
||||
|
|
|
@ -81,5 +81,15 @@ namespace OpenSim.Region.Communications.Local
|
|||
|
||||
return profile;
|
||||
}
|
||||
|
||||
public override UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid)
|
||||
{
|
||||
UserProfileData data = GetUserProfile(uuid);
|
||||
if (data == null)
|
||||
{
|
||||
throw new Exception("Unknown master user UUID");
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -145,6 +145,16 @@ namespace OpenSim.Region.Communications.OGS1
|
|||
return profile;
|
||||
}
|
||||
|
||||
public UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid)
|
||||
{
|
||||
UserProfileData data = GetUserProfile(uuid);
|
||||
if (data == null)
|
||||
{
|
||||
throw new Exception("Unknown master user UUID");
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
|
|
Loading…
Reference in New Issue