From 044446821b7d1d4550e43b0351c2611026874755 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 22 Jun 2009 12:18:04 +0000 Subject: [PATCH] Committing the meat of the user server interface and the bones of the service implementation --- OpenSim/Framework/RegionInfo.cs | 10 +++++ .../Services/AssetService/AssetServiceBase.cs | 24 +++++----- OpenSim/Services/Interfaces/IUserService.cs | 45 +++++++++++++++++++ OpenSim/Services/UserService/UserService.cs | 24 ++++++++++ 4 files changed, 92 insertions(+), 11 deletions(-) diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 7b65504477..db23af9731 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -71,6 +71,7 @@ namespace OpenSim.Framework protected uint m_remotingPort; public UUID RegionID = UUID.Zero; public string RemotingAddress; + public UUID ScopeID = UUID.Zero; public SimpleRegionInfo() { @@ -470,6 +471,9 @@ namespace OpenSim.Framework configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", m_objectCapacity.ToString(), true); + + configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, + "Scope ID for this region", ScopeID.ToString(), true); } public void loadConfigurationOptions() @@ -530,6 +534,9 @@ namespace OpenSim.Framework configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", "0", true); + + configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, + "Scope ID for this region", UUID.Zero.ToString(), true); } public bool shouldMasterAvatarDetailsBeAsked(string configuration_key) @@ -607,6 +614,9 @@ namespace OpenSim.Framework case "object_capacity": m_objectCapacity = (int)configuration_result; break; + case "scope_id": + ScopeID = (UUID)configuration_result; + break; } return true; diff --git a/OpenSim/Services/AssetService/AssetServiceBase.cs b/OpenSim/Services/AssetService/AssetServiceBase.cs index c42d469629..c60dd1ffd4 100644 --- a/OpenSim/Services/AssetService/AssetServiceBase.cs +++ b/OpenSim/Services/AssetService/AssetServiceBase.cs @@ -46,17 +46,7 @@ namespace OpenSim.Services.AssetService string connString = String.Empty; // - // Try reading the [DatabaseService] section first, if it exists - // - IConfig dbConfig = config.Configs["DatabaseService"]; - if (dbConfig != null) - { - dllName = dbConfig.GetString("StorageProvider", String.Empty); - connString = dbConfig.GetString("ConnectionString", String.Empty); - } - - // - // Try reading the more specific [AssetService] section, if it exists + // Try reading the [AssetService] section first, if it exists // IConfig assetConfig = config.Configs["AssetService"]; if (assetConfig != null) @@ -65,6 +55,18 @@ namespace OpenSim.Services.AssetService connString = assetConfig.GetString("ConnectionString", connString); } + // + // Try reading the [DatabaseService] section, if it exists + // + IConfig dbConfig = config.Configs["DatabaseService"]; + if (dbConfig != null) + { + if (dllName != String.Empty) + dllName = dbConfig.GetString("StorageProvider", String.Empty); + if (connString != String.Empty) + connString = dbConfig.GetString("ConnectionString", String.Empty); + } + // // We tried, but this doesn't exist. We can't proceed. // diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index 051ee9a8ff..823a86d830 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -25,9 +25,54 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Collections.Generic; +using OpenMetaverse; + namespace OpenSim.Services.Interfaces { + public class UserData + { + public string FirstName; + public string LastName; + public UUID UserID; + public UUID scopeID; + + // For informational purposes only! + // + public string HomeRegionName; + + public UUID HomeRegionID; + public float HomePositionX; + public float HomePositionY; + public float HomePositionZ; + public float HomeLookAtX; + public float HomeLookAtY; + public float HomeLookAtZ; + + // There are here because they + // concern the account rather than + // the profile. They just happen to + // be used in the Linden profile as well + // + public int GodLevel; + public int UserFlags; + public string AccountType; + }; + public interface IUserService { + UserData GetUserData(UUID scopeID, UUID userID); + UserData GetUserData(UUID scopeID, string FirstName, string LastName); + + // This will set only the home region portion of the data! + // Can't be used to set god level, flags, type or change the name! + // + bool SetUserData(UserData data); + + // Returns the list of avatars that matches both the search + // criterion and the scope ID passed + // ONLY THE NAME, SCOPE ID and UUID will be filled in! + // + List GetAvatarPickerData(UUID scopeID, string query); } } diff --git a/OpenSim/Services/UserService/UserService.cs b/OpenSim/Services/UserService/UserService.cs index a72568331c..3443643d6d 100644 --- a/OpenSim/Services/UserService/UserService.cs +++ b/OpenSim/Services/UserService/UserService.cs @@ -30,6 +30,8 @@ using System.Reflection; using Nini.Config; using OpenSim.Data; using OpenSim.Services.Interfaces; +using System.Collections.Generic; +using OpenMetaverse; namespace OpenSim.Services.UserService { @@ -38,5 +40,27 @@ namespace OpenSim.Services.UserService public UserService(IConfigSource config) : base(config) { } + + public UserData GetUserData(UUID scopeID, string firstName, + string lastName) + { + return null; + } + + public UserData GetUserData(UUID scopeID, UUID userID) + { + return null; + } + + public bool SetUserData(UserData data) + { + return false; + } + + public List GetAvatarPickerData(UUID scopeID, + string query) + { + return null; + } } }