* 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
afrisby
lbsa71 2007-10-02 00:00:12 +00:00
parent 625164d3e2
commit b5eaea7b0c
6 changed files with 23 additions and 59 deletions

View File

@ -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");

View File

@ -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")]

View File

@ -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)
{

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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);