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 --- .../Region/ClientStack/RegionApplicationBase.cs | 2 +- .../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 + .../Region/Environment/Scenes/Scene.Inventory.cs | 14 +-- OpenSim/Region/Environment/Scenes/Scene.cs | 18 +-- 10 files changed, 169 insertions(+), 157 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index f5253ba..48e1f3f 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -112,7 +112,7 @@ namespace OpenSim.Region.ClientStack scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D()); //Master Avatar Setup - UserProfileData masterAvatar = m_commsManager.UserServer.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarSandboxPassword); + UserProfileData masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarSandboxPassword); if (masterAvatar != null) { m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]"); 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."); + } } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index a6e47f3..81c0b73 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -27,7 +27,7 @@ namespace OpenSim.Region.Environment.Scenes public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) { - CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { userInfo.AddItem(remoteClient.AgentId, item); @@ -49,7 +49,7 @@ namespace OpenSim.Region.Environment.Scenes public LLUUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data) { - CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { if (userInfo.RootFolder != null) @@ -89,7 +89,7 @@ namespace OpenSim.Region.Environment.Scenes public void UDPUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID, LLUUID itemID) { - CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { if (userInfo.RootFolder != null) @@ -154,7 +154,7 @@ namespace OpenSim.Region.Environment.Scenes { if (transActionID == LLUUID.Zero) { - CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { AssetBase asset = new AssetBase(); @@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Scenes public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) { - CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); LLUUID copyID = LLUUID.Random(); if (userInfo != null) { @@ -335,7 +335,7 @@ namespace OpenSim.Region.Environment.Scenes if (PermissionsMngr.CanDeRezObject(remoteClient.AgentId, ((SceneObjectGroup) selectedEnt).UUID)) { string sceneObjectXml = ((SceneObjectGroup) selectedEnt).ToXmlString(); - CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { AssetBase asset = new AssetBase(); @@ -391,7 +391,7 @@ namespace OpenSim.Region.Environment.Scenes public void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos) { - CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { if (userInfo.RootFolder != null) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 90736f4..8fc477a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -649,7 +649,7 @@ namespace OpenSim.Region.Environment.Scenes CreateAndAddScenePresence(client, child); m_LandManager.sendParcelOverlay(client); - commsManager.UserProfiles.AddNewUser(client.AgentId); + commsManager.UserProfileCache.AddNewUser(client.AgentId); commsManager.TransactionsManager.AddUser(client.AgentId); } @@ -697,10 +697,10 @@ namespace OpenSim.Region.Environment.Scenes client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); client.OnCreateNewInventoryItem += CreateNewInventoryItem; - client.OnCreateNewInventoryFolder += commsManager.UserProfiles.HandleCreateInventoryFolder; - client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents; + client.OnCreateNewInventoryFolder += commsManager.UserProfileCache.HandleCreateInventoryFolder; + client.OnFetchInventoryDescendents += commsManager.UserProfileCache.HandleFecthInventoryDescendents; client.OnRequestTaskInventory += RequestTaskInventory; - client.OnFetchInventory += commsManager.UserProfiles.HandleFetchInventory; + client.OnFetchInventory += commsManager.UserProfileCache.HandleFetchInventory; client.OnUpdateInventoryItem += UDPUpdateInventoryItemAsset; client.OnAssetUploadRequest += commsManager.TransactionsManager.HandleUDPUploadRequest; client.OnXferReceive += commsManager.TransactionsManager.HandleXfer; @@ -796,7 +796,7 @@ namespace OpenSim.Region.Environment.Scenes avatar.Close(); // Remove client agent from profile, so new logins will work - commsManager.UserServer.clearUserAgent(agentID); + commsManager.UserService.clearUserAgent(agentID); return; } @@ -927,7 +927,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void RegisterRegionWithComms() { - regionCommsHost = commsManager.GridServer.RegisterRegion(m_regInfo); + regionCommsHost = commsManager.GridService.RegisterRegion(m_regInfo); if (regionCommsHost != null) { regionCommsHost.OnExpectUser += NewUserConnection; @@ -989,7 +989,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void InformClientOfNeighbours(IClientAPI remoteClient) { - List neighbours = commsManager.GridServer.RequestNeighbours(m_regInfo); + List neighbours = commsManager.GridService.RequestNeighbours(m_regInfo); if (neighbours != null) { @@ -1014,7 +1014,7 @@ namespace OpenSim.Region.Environment.Scenes /// public RegionInfo RequestNeighbouringRegionInfo(ulong regionHandle) { - return commsManager.GridServer.RequestNeighbourInfo(regionHandle); + return commsManager.GridService.RequestNeighbourInfo(regionHandle); } /// @@ -1027,7 +1027,7 @@ namespace OpenSim.Region.Environment.Scenes public void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY) { List mapBlocks; - mapBlocks = commsManager.GridServer.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); + mapBlocks = commsManager.GridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); remoteClient.SendMapBlock(mapBlocks); } -- cgit v1.1