diff options
author | lbsa71 | 2007-09-24 07:30:30 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-24 07:30:30 +0000 |
commit | 1302ef44e3c632159378bc4042c753bcf36e9c63 (patch) | |
tree | 6b6295ac233ecb05afe6432a903ec616e4fa079a /OpenSim/Framework | |
parent | * Trying to streamline CommunicationsManager (diff) | |
download | opensim-SC-1302ef44e3c632159378bc4042c753bcf36e9c63.zip opensim-SC-1302ef44e3c632159378bc4042c753bcf36e9c63.tar.gz opensim-SC-1302ef44e3c632159378bc4042c753bcf36e9c63.tar.bz2 opensim-SC-1302ef44e3c632159378bc4042c753bcf36e9c63.tar.xz |
* 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
Diffstat (limited to 'OpenSim/Framework')
11 files changed, 60 insertions, 45 deletions
diff --git a/OpenSim/Framework/UserManager/CAPSService.cs b/OpenSim/Framework/Communications/CAPSService.cs index a8eac26..a8eac26 100644 --- a/OpenSim/Framework/UserManager/CAPSService.cs +++ b/OpenSim/Framework/Communications/CAPSService.cs | |||
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs index 59a9e00..d0507d0 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs | |||
@@ -316,7 +316,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
316 | { | 316 | { |
317 | //really need to fix this call, if lbsa71 saw this he would die. | 317 | //really need to fix this call, if lbsa71 saw this he would die. |
318 | this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset); | 318 | this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset); |
319 | CachedUserInfo userInfo = m_userTransactions.Manager.CommsManager.UserProfiles.GetUserDetails(ourClient.AgentId); | 319 | CachedUserInfo userInfo = m_userTransactions.Manager.CommsManager.UserProfileCache.GetUserDetails(ourClient.AgentId); |
320 | if (userInfo != null) | 320 | if (userInfo != null) |
321 | { | 321 | { |
322 | InventoryItemBase item = new InventoryItemBase(); | 322 | InventoryItemBase item = new InventoryItemBase(); |
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index acdb6db..99dc45a 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -101,7 +101,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
101 | if ((userID == this.UserProfile.UUID) && (this.RootFolder != null)) | 101 | if ((userID == this.UserProfile.UUID) && (this.RootFolder != null)) |
102 | { | 102 | { |
103 | this.ItemReceive(userID, itemInfo); | 103 | this.ItemReceive(userID, itemInfo); |
104 | this.m_parentCommsManager.InventoryServer.AddNewInventoryItem(userID, itemInfo); | 104 | this.m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); |
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
@@ -109,7 +109,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
109 | { | 109 | { |
110 | if ((userID == this.UserProfile.UUID) && (this.RootFolder != null)) | 110 | if ((userID == this.UserProfile.UUID) && (this.RootFolder != null)) |
111 | { | 111 | { |
112 | this.m_parentCommsManager.InventoryServer.AddNewInventoryItem(userID, itemInfo); | 112 | this.m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
@@ -121,7 +121,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
121 | result = RootFolder.DeleteItem(item.inventoryID); | 121 | result = RootFolder.DeleteItem(item.inventoryID); |
122 | if (result) | 122 | if (result) |
123 | { | 123 | { |
124 | this.m_parentCommsManager.InventoryServer.DeleteInventoryItem(userID, item); | 124 | this.m_parentCommsManager.InventoryService.DeleteInventoryItem(userID, item); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | return result; | 127 | return result; |
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs index 0c8c0f9..390b938 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs | |||
@@ -106,7 +106,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
106 | InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType); | 106 | InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType); |
107 | if (createdFolder != null) | 107 | if (createdFolder != null) |
108 | { | 108 | { |
109 | this.m_parent.InventoryServer.AddNewInventoryFolder(remoteClient.AgentId, createdFolder); | 109 | this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder); |
110 | } | 110 | } |
111 | } | 111 | } |
112 | else | 112 | else |
@@ -181,7 +181,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
181 | /// <param name="userID"></param> | 181 | /// <param name="userID"></param> |
182 | private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) | 182 | private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) |
183 | { | 183 | { |
184 | this.m_parent.InventoryServer.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); | 184 | this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); |
185 | } | 185 | } |
186 | 186 | ||
187 | /// <summary> | 187 | /// <summary> |
@@ -190,7 +190,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
190 | /// <param name="userID"></param> | 190 | /// <param name="userID"></param> |
191 | private UserProfileData RequestUserProfileForUser(LLUUID userID) | 191 | private UserProfileData RequestUserProfileForUser(LLUUID userID) |
192 | { | 192 | { |
193 | return this.m_parent.UserServer.GetUserProfile(userID); | 193 | return this.m_parent.UserService.GetUserProfile(userID); |
194 | } | 194 | } |
195 | 195 | ||
196 | /// <summary> | 196 | /// <summary> |
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 2a87306..6ea3c29 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -37,81 +37,74 @@ namespace OpenSim.Framework.Communications | |||
37 | { | 37 | { |
38 | public class CommunicationsManager | 38 | public class CommunicationsManager |
39 | { | 39 | { |
40 | protected AssetCache m_assetCache; | 40 | protected IUserServices m_userService; |
41 | protected IGridServices m_gridServer; | 41 | public IUserServices UserService |
42 | protected IInterRegionCommunications m_interRegion; | ||
43 | protected IInventoryServices m_inventoryServer; | ||
44 | protected AssetTransactionManager m_transactionsManager; | ||
45 | protected UserProfileCache m_userProfiles; | ||
46 | protected IUserServices m_userServer; | ||
47 | protected NetworkServersInfo m_networkServersInfo; | ||
48 | |||
49 | public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache) | ||
50 | { | ||
51 | m_networkServersInfo = serversInfo; | ||
52 | m_assetCache = assetCache; | ||
53 | m_userProfiles = new UserProfileCache(this); | ||
54 | m_transactionsManager = new AssetTransactionManager(this); | ||
55 | } | ||
56 | |||
57 | public IUserServices UserServer | ||
58 | { | 42 | { |
59 | get { return m_userServer; } | 43 | get { return m_userService; } |
60 | set { m_userServer = value; } | ||
61 | } | 44 | } |
62 | 45 | ||
63 | public IGridServices GridServer | 46 | protected IGridServices m_gridService; |
47 | public IGridServices GridService | ||
64 | { | 48 | { |
65 | get { return m_gridServer; } | 49 | get { return m_gridService; } |
66 | } | 50 | } |
67 | 51 | ||
68 | public IInventoryServices InventoryServer | 52 | protected IInventoryServices m_inventoryService; |
53 | public IInventoryServices InventoryService | ||
69 | { | 54 | { |
70 | get { return m_inventoryServer; } | 55 | get { return m_inventoryService; } |
71 | set { m_inventoryServer = value; } | ||
72 | } | 56 | } |
73 | 57 | ||
58 | protected IInterRegionCommunications m_interRegion; | ||
74 | public IInterRegionCommunications InterRegion | 59 | public IInterRegionCommunications InterRegion |
75 | { | 60 | { |
76 | get { return m_interRegion; } | 61 | get { return m_interRegion; } |
77 | set { m_interRegion = value; } | ||
78 | } | 62 | } |
79 | 63 | ||
80 | public UserProfileCache UserProfiles | 64 | protected UserProfileCache m_userProfileCache; |
65 | public UserProfileCache UserProfileCache | ||
81 | { | 66 | { |
82 | get { return m_userProfiles; } | 67 | get { return m_userProfileCache; } |
83 | set { m_userProfiles = value; } | ||
84 | } | 68 | } |
85 | 69 | ||
70 | protected AssetTransactionManager m_transactionsManager; | ||
86 | public AssetTransactionManager TransactionsManager | 71 | public AssetTransactionManager TransactionsManager |
87 | { | 72 | { |
88 | get { return m_transactionsManager; } | 73 | get { return m_transactionsManager; } |
89 | set { m_transactionsManager = value; } | ||
90 | } | 74 | } |
91 | 75 | ||
76 | protected AssetCache m_assetCache; | ||
92 | public AssetCache AssetCache | 77 | public AssetCache AssetCache |
93 | { | 78 | { |
94 | get { return m_assetCache; } | 79 | get { return m_assetCache; } |
95 | set { m_assetCache = value; } | ||
96 | } | 80 | } |
97 | 81 | ||
82 | protected NetworkServersInfo m_networkServersInfo; | ||
98 | public NetworkServersInfo NetworkServersInfo | 83 | public NetworkServersInfo NetworkServersInfo |
99 | { | 84 | { |
100 | get { return m_networkServersInfo; } | 85 | get { return m_networkServersInfo; } |
101 | set { m_networkServersInfo = value; } | ||
102 | } | 86 | } |
103 | 87 | ||
88 | public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache) | ||
89 | { | ||
90 | m_networkServersInfo = serversInfo; | ||
91 | m_assetCache = assetCache; | ||
92 | m_userProfileCache = new UserProfileCache(this); | ||
93 | m_transactionsManager = new AssetTransactionManager(this); | ||
94 | } | ||
95 | |||
96 | |||
104 | #region Packet Handlers | 97 | #region Packet Handlers |
105 | 98 | ||
106 | public void HandleUUIDNameRequest(LLUUID uuid, IClientAPI remote_client) | 99 | public void HandleUUIDNameRequest(LLUUID uuid, IClientAPI remote_client) |
107 | { | 100 | { |
108 | if (uuid == m_userProfiles.libraryRoot.agentID) | 101 | if (uuid == m_userProfileCache.libraryRoot.agentID) |
109 | { | 102 | { |
110 | remote_client.SendNameReply(uuid, "Mr", "OpenSim"); | 103 | remote_client.SendNameReply(uuid, "Mr", "OpenSim"); |
111 | } | 104 | } |
112 | else | 105 | else |
113 | { | 106 | { |
114 | UserProfileData profileData = m_userServer.GetUserProfile(uuid); | 107 | UserProfileData profileData = m_userService.GetUserProfile(uuid); |
115 | if (profileData != null) | 108 | if (profileData != null) |
116 | { | 109 | { |
117 | LLUUID profileId = profileData.UUID; | 110 | LLUUID profileId = profileData.UUID; |
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index bd58756..80c2e64 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs | |||
@@ -17,5 +17,13 @@ namespace OpenSim.Framework.Communications | |||
17 | void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder); | 17 | void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder); |
18 | void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); | 18 | void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); |
19 | void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); | 19 | void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); |
20 | void CreateNewUserInventory(LLUUID user); | ||
21 | |||
22 | /// <summary> | ||
23 | /// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree) | ||
24 | /// </summary> | ||
25 | /// <param name="userID"></param> | ||
26 | /// <returns></returns> | ||
27 | List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID); | ||
20 | } | 28 | } |
21 | } | 29 | } |
diff --git a/OpenSim/Framework/Communications/IUserServices.cs b/OpenSim/Framework/Communications/IUserServices.cs index c1bea48..13dd378 100644 --- a/OpenSim/Framework/Communications/IUserServices.cs +++ b/OpenSim/Framework/Communications/IUserServices.cs | |||
@@ -40,5 +40,10 @@ namespace OpenSim.Framework.Communications | |||
40 | UserProfileData SetupMasterUser(string firstName, string lastName); | 40 | UserProfileData SetupMasterUser(string firstName, string lastName); |
41 | UserProfileData SetupMasterUser(string firstName, string lastName, string password); | 41 | UserProfileData SetupMasterUser(string firstName, string lastName, string password); |
42 | 42 | ||
43 | /// <summary> | ||
44 | /// | ||
45 | /// </summary> | ||
46 | /// <param name="user"></param> | ||
47 | void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY); | ||
43 | } | 48 | } |
44 | } | 49 | } |
diff --git a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index d76fac5..da7a0ce 100644 --- a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs | |||
@@ -2,12 +2,14 @@ using System; | |||
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Reflection; | 3 | using System.Reflection; |
4 | using libsecondlife; | 4 | using libsecondlife; |
5 | using OpenSim.Framework.Communications; | ||
5 | using OpenSim.Framework.Console; | 6 | using OpenSim.Framework.Console; |
6 | using OpenSim.Framework.Data; | 7 | using OpenSim.Framework.Data; |
8 | using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder; | ||
7 | 9 | ||
8 | namespace OpenSim.Framework.InventoryServiceBase | 10 | namespace OpenSim.Framework.Communications |
9 | { | 11 | { |
10 | public class InventoryServiceBase | 12 | public abstract class InventoryServiceBase : IInventoryServices |
11 | { | 13 | { |
12 | protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>(); | 14 | protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>(); |
13 | //protected IAssetServer m_assetServer; | 15 | //protected IAssetServer m_assetServer; |
@@ -200,5 +202,10 @@ namespace OpenSim.Framework.InventoryServiceBase | |||
200 | Folders.Add(folder.folderID, folder); | 202 | Folders.Add(folder.folderID, folder); |
201 | } | 203 | } |
202 | } | 204 | } |
205 | |||
206 | public abstract void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); | ||
207 | public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder); | ||
208 | public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); | ||
209 | public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); | ||
203 | } | 210 | } |
204 | } \ No newline at end of file | 211 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/UserManager/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs index b5a4184..b5a4184 100644 --- a/OpenSim/Framework/UserManager/LoginResponse.cs +++ b/OpenSim/Framework/Communications/LoginResponse.cs | |||
diff --git a/OpenSim/Framework/UserManager/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 8e7cf80..8e7cf80 100644 --- a/OpenSim/Framework/UserManager/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs | |||
diff --git a/OpenSim/Framework/UserManager/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 4a2870b..d1bbde1 100644 --- a/OpenSim/Framework/UserManager/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -33,6 +33,7 @@ using System.Reflection; | |||
33 | using System.Security.Cryptography; | 33 | using System.Security.Cryptography; |
34 | using libsecondlife; | 34 | using libsecondlife; |
35 | using Nwc.XmlRpc; | 35 | using Nwc.XmlRpc; |
36 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Framework.Configuration; | 37 | using OpenSim.Framework.Configuration; |
37 | using OpenSim.Framework.Console; | 38 | using OpenSim.Framework.Console; |
38 | using OpenSim.Framework.Data; | 39 | using OpenSim.Framework.Data; |
@@ -40,7 +41,7 @@ using OpenSim.Framework.Utilities; | |||
40 | 41 | ||
41 | namespace OpenSim.Framework.UserManagement | 42 | namespace OpenSim.Framework.UserManagement |
42 | { | 43 | { |
43 | public abstract class UserManagerBase | 44 | public abstract class UserManagerBase : IUserServices |
44 | { | 45 | { |
45 | public UserConfig _config; | 46 | public UserConfig _config; |
46 | Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>(); | 47 | Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>(); |
@@ -372,6 +373,7 @@ namespace OpenSim.Framework.UserManagement | |||
372 | } | 373 | } |
373 | } | 374 | } |
374 | 375 | ||
375 | // Rest and XML-RPC methods. (have moved them to a sub class in the user server) | 376 | public abstract UserProfileData SetupMasterUser(string firstName, string lastName); |
377 | public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password); | ||
376 | } | 378 | } |
377 | } | 379 | } |