From b5eaea7b0c627c55544f4099b50e9ac1a504fe17 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 2 Oct 2007 00:00:12 +0000 Subject: [PATCH] * Moved setup of LocalInventoryService and LocalUserServices to the app layer * Killed off 'parent' relation from LocalUserServices to CommunicationsLocal * Deleted obsolete project InventoryServiceBase * Deleted superfluous createCol function --- .../Data.SQLite/SQLiteInventoryStore.cs | 8 +---- .../Properties/AssemblyInfo.cs | 35 ------------------- OpenSim/Region/Application/OpenSimMain.cs | 9 +++-- .../Local/CommunicationsLocal.cs | 8 ++--- .../Communications/Local/LocalUserServices.cs | 14 ++++---- OpenSim/Region/Examples/SimpleApp/Program.cs | 8 +++-- 6 files changed, 23 insertions(+), 59 deletions(-) delete mode 100644 OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs diff --git a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs index 99fa740983..d664e982a1 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs @@ -350,13 +350,7 @@ namespace OpenSim.Framework.Data.SQLite * **********************************************************************/ - private void createCol(DataTable dt, string name, System.Type type) - { - DataColumn col = new DataColumn(name, type); - dt.Columns.Add(col); - } - - private DataTable createInventoryItemsTable() + private static DataTable createInventoryItemsTable() { DataTable inv = new DataTable("inventoryitems"); diff --git a/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs b/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs deleted file mode 100644 index daf20b2b15..0000000000 --- a/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("InventoryServiceBase")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("InventoryServiceBase")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7e1fbd0b-4a25-4804-a01f-89b04eb5b349")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index dad6afdd5d..e0ea21269f 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -157,8 +157,13 @@ namespace OpenSim if (m_sandbox) { - CommunicationsLocal.LocalSettings settings = new CommunicationsLocal.LocalSettings(standaloneWelcomeMessage, standaloneAuthenticate, standaloneInventoryPlugin, standaloneUserPlugin); - CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, settings); + CommunicationsLocal.LocalSettings settings = new CommunicationsLocal.LocalSettings(standaloneWelcomeMessage, standaloneAuthenticate, standaloneInventoryPlugin); + + LocalInventoryService inventoryService = new LocalInventoryService(); + LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService ); + userService.AddPlugin( standaloneUserPlugin ); + + CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, settings, userService); m_commsManager = localComms; if (standaloneAuthenticate) { diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index a00b35f79a..76814cf220 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -39,15 +39,13 @@ namespace OpenSim.Region.Communications.Local { public class CommunicationsLocal : CommunicationsManager { - public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings) + public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings, LocalUserServices userService) : base(serversInfo, httpServer, assetCache) { LocalInventoryService inventoryService = new LocalInventoryService(); inventoryService.AddPlugin(settings.InventoryPlugin); m_inventoryService = inventoryService; - LocalUserServices userService = new LocalUserServices(this, serversInfo); - userService.AddPlugin(settings.UserDatabasePlugin); m_userService = userService; LocalBackEndServices backendService = new LocalBackEndServices(); @@ -118,14 +116,12 @@ namespace OpenSim.Region.Communications.Local public string WelcomeMessage; public bool AccountAuthentication = false; public string InventoryPlugin; - public string UserDatabasePlugin; - public LocalSettings(string welcomeMessage, bool accountsAuthenticate, string inventoryPlugin, string userPlugin) + public LocalSettings(string welcomeMessage, bool accountsAuthenticate, string inventoryPlugin) { WelcomeMessage = welcomeMessage; AccountAuthentication = accountsAuthenticate; InventoryPlugin = inventoryPlugin; - UserDatabasePlugin = userPlugin; } } diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 3bc4301c3d..9e81fb8e44 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -8,20 +8,20 @@ namespace OpenSim.Region.Communications.Local { public class LocalUserServices : UserManagerBase { - private readonly CommunicationsLocal m_parent; - private readonly NetworkServersInfo m_serversInfo; private readonly uint m_defaultHomeX; private readonly uint m_defaultHomeY; + private IInventoryServices m_inventoryService; - public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo) + public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY, IInventoryServices inventoryService) { - m_parent = parent; m_serversInfo = serversInfo; - m_defaultHomeX = m_serversInfo.DefaultHomeLocX; - m_defaultHomeY = m_serversInfo.DefaultHomeLocY; + m_defaultHomeX = defaultHomeLocX; + m_defaultHomeY = defaultHomeLocY; + + m_inventoryService = inventoryService; } public override UserProfileData SetupMasterUser(string firstName, string lastName) @@ -48,7 +48,7 @@ namespace OpenSim.Region.Communications.Local } else { - m_parent.InventoryService.CreateNewUserInventory(profile.UUID); + m_inventoryService.CreateNewUserInventory(profile.UUID); } return profile; diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index d693cce948..eafa500548 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -41,8 +41,12 @@ namespace SimpleApp { base.StartUp(); - CommunicationsLocal.LocalSettings settings = new CommunicationsLocal.LocalSettings("", false, "", ""); - m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, settings); + CommunicationsLocal.LocalSettings settings = new CommunicationsLocal.LocalSettings("", false, ""); + + LocalInventoryService inventoryService = new LocalInventoryService(); + LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); + + m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, settings, userService ); m_log.Notice(m_log.LineInfo);