| Attached Files | ffoliveira.estates.diff [^] (8,497 bytes) 2012-03-07 04:20 [Show Content] [Hide Content]diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index f482d8f..65a9818 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -67,6 +67,9 @@ namespace OpenSim
private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache";
private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient";
+ // OpenSim.ini Section name for ESTATES Settings
+ public const string ESTATE_SECTION_NAME = "Estates";
+
protected string proxyUrl;
protected int proxyOffset = 0;
@@ -443,10 +446,39 @@ namespace OpenSim
{
RegionInfo regionInfo = scene.RegionInfo;
+ string estateFirstName = "", estateLastName = "", estateOwnerEMail = "", estateOwnerPassword = "", estateOwnerUUID = "";
+
+ if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
+ {
+ string defaultEstateOwnerName = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerName", "").Trim();
+ string[] ownerNames = defaultEstateOwnerName.Split(' ');
+
+ if (ownerNames.Length == 2)
+ {
+ estateFirstName = ownerNames[0];
+ estateLastName = ownerNames[1];
+ }
+ // Info to be used only on Standalone Mode
+ estateOwnerUUID = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerUUID", "");
+ estateOwnerEMail = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerEMail", "");
+ estateOwnerPassword = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerPassword", "");
+ }
+
MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName);
List<char> excluded = new List<char>(new char[1]{' '});
- string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
- string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
+
+ string first, last;
+
+ if ((estateFirstName != "") && (estateLastName != ""))
+ {
+ first = estateFirstName;
+ last = estateLastName;
+ }
+ else
+ {
+ first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
+ last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
+ }
UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last);
@@ -467,10 +499,22 @@ namespace OpenSim
if (scene.UserAccountService is UserAccountService)
{
- string password = MainConsole.Instance.PasswdPrompt("Password");
- string email = MainConsole.Instance.CmdPrompt("Email", "");
+ string password = "", email = "", rawPrincipalId = "";
+
+ if (estateOwnerPassword != "")
+ password = estateOwnerPassword;
+ else
+ MainConsole.Instance.PasswdPrompt("Password");
+
+ if (estateOwnerEMail != "")
+ email = estateOwnerEMail;
+ else
+ email = MainConsole.Instance.CmdPrompt("Email", "");
- string rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
+ if (estateOwnerUUID != "")
+ rawPrincipalId = estateOwnerUUID;
+ else
+ rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
UUID principalId = UUID.Zero;
if (!UUID.TryParse(rawPrincipalId, out principalId))
@@ -885,11 +929,20 @@ namespace OpenSim
/// <param name="regInfo"></param>
/// <param name="existingName">A list of estate names that already exist.</param>
/// <returns>true if the estate was created, false otherwise</returns>
- public bool CreateEstate(RegionInfo regInfo, List<string> existingNames)
+ public bool CreateEstate(RegionInfo regInfo, List<string> existingNames, string estateName)
{
// Create a new estate
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
- string newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
+
+ string newName;
+ if (estateName != null && estateName != "")
+ {
+ newName = estateName;
+ }
+ else
+ {
+ newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
+ }
if (existingNames.Contains(newName))
{
@@ -925,18 +978,30 @@ namespace OpenSim
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
List<string> estateNames = new List<string>();
foreach (EstateSettings estate in estates)
- estateNames.Add(estate.EstateName);
-
+ estateNames.Add(estate.EstateName);
+
+ string estateName = "";
+ string estateOwner = "";
+
+ if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
+ {
+ estateName = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateName", "");
+ estateOwner = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerName", "");
+ }
+
while (true)
{
if (estates.Count == 0)
{
m_log.Info("[ESTATE] No existing estates found. You must create a new one.");
-
- if (CreateEstate(regInfo, estateNames))
- break;
+
+ if (CreateEstate(regInfo, estateNames, estateName))
+ break;
else
+ {
+ estateName = "";
continue;
+ }
}
else
{
@@ -949,10 +1014,13 @@ namespace OpenSim
if (response == "no")
{
- if (CreateEstate(regInfo, estateNames))
+ if (CreateEstate(regInfo, estateNames, estateName))
break;
else
+ {
+ estateName = "";
continue;
+ }
}
else
{
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index a820ddf..414cdb0 100755
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -754,7 +754,19 @@
; XmlRpcServiceReadKey = 1234
; XmlRpcServiceWriteKey = 1234
-
+[Estates]
+ ;#
+ ;; This section inform to simulator the default values for the Estate creation. You don't need to enter estate info at console.
+ ;; * Note this info don't change the pre-existing estate owner and names or the other data
+
+ ; DefaultEstateName=EstateName
+ ; DefaultEstateOwnerName=FirstName LastName
+
+ ;; Info only used on Standalone Mode
+ ; DefaultEstateOwnerUUID = 00000000-0000-0000-0000-000000000000
+ ; DefaultEstateOwnerEMail = owner@domain.com
+ ; DefaultEstateOwnerPassword = password
+
[InterestManagement]
;# {UpdatePrioritizationScheme} {} {Update prioritization scheme?} {BestAvatarResponsiveness Time Distance SimpleAngularDistance FrontBack} BestAvatarResponsiveness
;; This section controls how state updates are prioritized for each client
|