From 1302ef44e3c632159378bc4042c753bcf36e9c63 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 24 Sep 2007 07:30:30 +0000 Subject: * Started major restructusing of comms to prepare for better grid and region functionality * Working towards one shared set of services * Killed off two projects with very little functionality --- .../Communications/Local/CommunicationsLocal.cs | 38 +++--- .../Communications/Local/LocalInventoryService.cs | 139 ++++++++++----------- .../Communications/Local/LocalLoginService.cs | 6 +- .../Communications/Local/LocalUserServices.cs | 8 +- .../Communications/OGS1/CommunicationsOGS1.cs | 6 +- .../Communications/OGS1/OGS1InventoryService.cs | 90 +++++++------ .../Region/Communications/OGS1/OGS1UserServices.cs | 5 + 7 files changed, 152 insertions(+), 140 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 15167fb..ea972dc 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -26,25 +26,23 @@ * */ using System; +using libsecondlife; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; -using OpenSim.Framework.Types; -using OpenSim.Framework.Servers; using OpenSim.Framework.Console; -using OpenSim.Framework.Utilities; using OpenSim.Framework.Data; -using OpenSim.Framework.UserManagement; -using libsecondlife; +using OpenSim.Framework.Servers; +using OpenSim.Framework.Types; +using OpenSim.Framework.Utilities; namespace OpenSim.Region.Communications.Local { public class CommunicationsLocal : CommunicationsManager { public LocalBackEndServices InstanceServices; - public LocalUserServices UserServices; + public IUserServices UserServices; public LocalLoginService LoginServices; - public LocalInventoryService InvenServices; - + protected LocalSettings m_settings; protected CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache) @@ -58,21 +56,21 @@ namespace OpenSim.Region.Communications.Local { m_settings = settings; - InvenServices = new LocalInventoryService(); - InvenServices.AddPlugin(m_settings.InventoryPlugin); - m_inventoryServer = InvenServices; + LocalInventoryService inventoryService = new LocalInventoryService(); + inventoryService.AddPlugin(m_settings.InventoryPlugin); - UserServices = new LocalUserServices(this, serversInfo); - UserServices.AddPlugin(m_settings.UserDatabasePlugin); - m_userServer = UserServices; + m_inventoryService = inventoryService; + + LocalUserServices userService = new LocalUserServices(this, serversInfo); + userService.AddPlugin(m_settings.UserDatabasePlugin); + UserServices = userService; + m_userService = UserServices; InstanceServices = new LocalBackEndServices(); - m_gridServer = InstanceServices; + m_gridService = InstanceServices; m_interRegion = InstanceServices; - //CapsServices = new CAPSService(httpServer); - - LoginServices = new LocalLoginService(UserServices, m_settings.WelcomeMessage, this, serversInfo, m_settings.AccountAuthentication); + LoginServices = new LocalLoginService(userService, m_settings.WelcomeMessage, this, serversInfo, m_settings.AccountAuthentication); httpServer.AddXmlRPCHandler("login_to_simulator", LoginServices.XmlRpcLoginMethod); } @@ -121,14 +119,14 @@ namespace OpenSim.Region.Communications.Local string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + ""); this.UserServices.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY); - UserProfileData userProf = this.UserServer.GetUserProfile(firstName, lastName); + UserProfileData userProf = this.UserService.GetUserProfile(firstName, lastName); if (userProf == null) { return LLUUID.Zero; } else { - this.InvenServices.CreateNewUserInventory(userProf.UUID); + this.m_inventoryService.CreateNewUserInventory(userProf.UUID); Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); return userProf.UUID; } diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index b8f57f6..53f6ffa 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs @@ -1,72 +1,67 @@ -using System; -using System.Collections.Generic; -using libsecondlife; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Data; -using OpenSim.Framework.Types; -using OpenSim.Framework.UserManagement; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.InventoryServiceBase; -using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; - -namespace OpenSim.Region.Communications.Local -{ - public class LocalInventoryService : InventoryServiceBase , IInventoryServices - { - - public LocalInventoryService() - { - - } - - public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) - { - List folders = this.RequestFirstLevelFolders(userID); - InventoryFolder rootFolder = null; - - //need to make sure we send root folder first - foreach (InventoryFolderBase folder in folders) - { - if (folder.parentID == libsecondlife.LLUUID.Zero) - { - InventoryFolder newfolder = new InventoryFolder(folder); - rootFolder = newfolder; - folderCallBack(userID, newfolder); - } - } - - if (rootFolder != null) - { - foreach (InventoryFolderBase folder in folders) - { - if (folder.folderID != rootFolder.folderID) - { - InventoryFolder newfolder = new InventoryFolder(folder); - folderCallBack(userID, newfolder); - - List items = this.RequestFolderItems(newfolder.folderID); - foreach (InventoryItemBase item in items) - { - itemCallBack(userID, item); - } - } - } - } - } - - public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) - { - this.AddFolder(folder); - } - - public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) - { - this.AddItem(item); - } - - public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) - { - this.deleteItem(item); - } - } -} +using System.Collections.Generic; +using libsecondlife; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Data; +using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder; + +namespace OpenSim.Region.Communications.Local +{ + public class LocalInventoryService : InventoryServiceBase + { + + public LocalInventoryService() + { + + } + + public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) + { + List folders = this.RequestFirstLevelFolders(userID); + InventoryFolder rootFolder = null; + + //need to make sure we send root folder first + foreach (InventoryFolderBase folder in folders) + { + if (folder.parentID == libsecondlife.LLUUID.Zero) + { + InventoryFolder newfolder = new InventoryFolder(folder); + rootFolder = newfolder; + folderCallBack(userID, newfolder); + } + } + + if (rootFolder != null) + { + foreach (InventoryFolderBase folder in folders) + { + if (folder.folderID != rootFolder.folderID) + { + InventoryFolder newfolder = new InventoryFolder(folder); + folderCallBack(userID, newfolder); + + List items = this.RequestFolderItems(newfolder.folderID); + foreach (InventoryItemBase item in items) + { + itemCallBack(userID, item); + } + } + } + } + } + + public override void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) + { + this.AddFolder(folder); + } + + public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) + { + this.AddItem(item); + } + + public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) + { + this.deleteItem(item); + } + } +} diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 9c15742..ed1858d 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.Communications.Local profile = this.m_userManager.GetUserProfile(firstname, lastname); if (profile != null) { - m_Parent.InvenServices.CreateNewUserInventory(profile.UUID); + m_Parent.InventoryService.CreateNewUserInventory(profile.UUID); } return profile; @@ -80,7 +80,7 @@ namespace OpenSim.Region.Communications.Local public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) { ulong currentRegion = theUser.currentAgent.currentHandle; - RegionInfo reg = m_Parent.GridServer.RequestNeighbourInfo(currentRegion); + RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion); if (reg != null) { @@ -119,7 +119,7 @@ namespace OpenSim.Region.Communications.Local protected override InventoryData CreateInventoryData(LLUUID userID) { - List folders = this.m_Parent.InvenServices.RequestFirstLevelFolders(userID); + List folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); if (folders.Count > 0) { LLUUID rootID = LLUUID.Zero; diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index a7cefcb..3bc4301 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -6,7 +6,7 @@ using OpenSim.Framework.UserManagement; namespace OpenSim.Region.Communications.Local { - public class LocalUserServices : UserManagerBase, IUserServices + public class LocalUserServices : UserManagerBase { private readonly CommunicationsLocal m_parent; @@ -24,12 +24,12 @@ namespace OpenSim.Region.Communications.Local m_defaultHomeY = m_serversInfo.DefaultHomeLocY; } - public UserProfileData SetupMasterUser(string firstName, string lastName) + public override UserProfileData SetupMasterUser(string firstName, string lastName) { return SetupMasterUser(firstName, lastName, ""); } - public UserProfileData SetupMasterUser(string firstName, string lastName, string password) + public override UserProfileData SetupMasterUser(string firstName, string lastName, string password) { UserProfileData profile = GetUserProfile(firstName, lastName); if (profile != null) @@ -48,7 +48,7 @@ namespace OpenSim.Region.Communications.Local } else { - m_parent.InvenServices.CreateNewUserInventory(profile.UUID); + m_parent.InventoryService.CreateNewUserInventory(profile.UUID); } return profile; diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs index ca9c34b..96f1933 100644 --- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs @@ -11,11 +11,11 @@ namespace OpenSim.Region.Communications.OGS1 public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache) { OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); - m_gridServer = gridInterComms; + m_gridService = gridInterComms; m_interRegion = gridInterComms; - m_inventoryServer = new OGS1InventoryService(); - m_userServer = new OGS1UserServices(this); + m_inventoryService = new OGS1InventoryService(); + m_userService = new OGS1UserServices(this); } } } diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 1428639..d5dbc46 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -1,38 +1,52 @@ -using System; -using System.Collections.Generic; -using libsecondlife; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Data; -using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; - -namespace OpenSim.Region.Communications.OGS1 -{ - public class OGS1InventoryService : IInventoryServices - { - - public OGS1InventoryService() - { - - } - - public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) - { - - } - - public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) - { - - } - - public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) - { - - } - - public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) - { - - } - } -} +using System; +using System.Collections.Generic; +using libsecondlife; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Data; +using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; + +namespace OpenSim.Region.Communications.OGS1 +{ + public class OGS1InventoryService : IInventoryServices + { + + public OGS1InventoryService() + { + + } + + #region IInventoryServices Members + + public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) + { + throw new Exception("The method or operation is not implemented."); + } + + public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) + { + throw new Exception("The method or operation is not implemented."); + } + + public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) + { + throw new Exception("The method or operation is not implemented."); + } + + public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) + { + throw new Exception("The method or operation is not implemented."); + } + + public void CreateNewUserInventory(LLUUID user) + { + throw new Exception("The method or operation is not implemented."); + } + + public List RequestFirstLevelFolders(LLUUID userID) + { + throw new Exception("The method or operation is not implemented."); + } + + #endregion + } +} diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 71b3752..d376d1c 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -101,5 +101,10 @@ namespace OpenSim.Region.Communications.OGS1 UserProfileData profile = GetUserProfile(firstName, lastName); return profile; } + + public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) + { + throw new Exception("The method or operation is not implemented."); + } } } -- cgit v1.1