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/Region/Communications/Local | |
parent | * Trying to streamline CommunicationsManager (diff) | |
download | opensim-SC_OLD-1302ef44e3c632159378bc4042c753bcf36e9c63.zip opensim-SC_OLD-1302ef44e3c632159378bc4042c753bcf36e9c63.tar.gz opensim-SC_OLD-1302ef44e3c632159378bc4042c753bcf36e9c63.tar.bz2 opensim-SC_OLD-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/Region/Communications/Local')
4 files changed, 92 insertions, 99 deletions
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 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using libsecondlife; | ||
29 | using OpenSim.Framework.Communications; | 30 | using OpenSim.Framework.Communications; |
30 | using OpenSim.Framework.Communications.Cache; | 31 | using OpenSim.Framework.Communications.Cache; |
31 | using OpenSim.Framework.Types; | ||
32 | using OpenSim.Framework.Servers; | ||
33 | using OpenSim.Framework.Console; | 32 | using OpenSim.Framework.Console; |
34 | using OpenSim.Framework.Utilities; | ||
35 | using OpenSim.Framework.Data; | 33 | using OpenSim.Framework.Data; |
36 | using OpenSim.Framework.UserManagement; | 34 | using OpenSim.Framework.Servers; |
37 | using libsecondlife; | 35 | using OpenSim.Framework.Types; |
36 | using OpenSim.Framework.Utilities; | ||
38 | 37 | ||
39 | namespace OpenSim.Region.Communications.Local | 38 | namespace OpenSim.Region.Communications.Local |
40 | { | 39 | { |
41 | public class CommunicationsLocal : CommunicationsManager | 40 | public class CommunicationsLocal : CommunicationsManager |
42 | { | 41 | { |
43 | public LocalBackEndServices InstanceServices; | 42 | public LocalBackEndServices InstanceServices; |
44 | public LocalUserServices UserServices; | 43 | public IUserServices UserServices; |
45 | public LocalLoginService LoginServices; | 44 | public LocalLoginService LoginServices; |
46 | public LocalInventoryService InvenServices; | 45 | |
47 | |||
48 | protected LocalSettings m_settings; | 46 | protected LocalSettings m_settings; |
49 | 47 | ||
50 | protected CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache) | 48 | protected CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache) |
@@ -58,21 +56,21 @@ namespace OpenSim.Region.Communications.Local | |||
58 | { | 56 | { |
59 | m_settings = settings; | 57 | m_settings = settings; |
60 | 58 | ||
61 | InvenServices = new LocalInventoryService(); | 59 | LocalInventoryService inventoryService = new LocalInventoryService(); |
62 | InvenServices.AddPlugin(m_settings.InventoryPlugin); | 60 | inventoryService.AddPlugin(m_settings.InventoryPlugin); |
63 | m_inventoryServer = InvenServices; | ||
64 | 61 | ||
65 | UserServices = new LocalUserServices(this, serversInfo); | 62 | m_inventoryService = inventoryService; |
66 | UserServices.AddPlugin(m_settings.UserDatabasePlugin); | 63 | |
67 | m_userServer = UserServices; | 64 | LocalUserServices userService = new LocalUserServices(this, serversInfo); |
65 | userService.AddPlugin(m_settings.UserDatabasePlugin); | ||
66 | UserServices = userService; | ||
67 | m_userService = UserServices; | ||
68 | 68 | ||
69 | InstanceServices = new LocalBackEndServices(); | 69 | InstanceServices = new LocalBackEndServices(); |
70 | m_gridServer = InstanceServices; | 70 | m_gridService = InstanceServices; |
71 | m_interRegion = InstanceServices; | 71 | m_interRegion = InstanceServices; |
72 | 72 | ||
73 | //CapsServices = new CAPSService(httpServer); | 73 | LoginServices = new LocalLoginService(userService, m_settings.WelcomeMessage, this, serversInfo, m_settings.AccountAuthentication); |
74 | |||
75 | LoginServices = new LocalLoginService(UserServices, m_settings.WelcomeMessage, this, serversInfo, m_settings.AccountAuthentication); | ||
76 | httpServer.AddXmlRPCHandler("login_to_simulator", LoginServices.XmlRpcLoginMethod); | 74 | httpServer.AddXmlRPCHandler("login_to_simulator", LoginServices.XmlRpcLoginMethod); |
77 | } | 75 | } |
78 | 76 | ||
@@ -121,14 +119,14 @@ namespace OpenSim.Region.Communications.Local | |||
121 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + ""); | 119 | string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + ""); |
122 | 120 | ||
123 | this.UserServices.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY); | 121 | this.UserServices.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY); |
124 | UserProfileData userProf = this.UserServer.GetUserProfile(firstName, lastName); | 122 | UserProfileData userProf = this.UserService.GetUserProfile(firstName, lastName); |
125 | if (userProf == null) | 123 | if (userProf == null) |
126 | { | 124 | { |
127 | return LLUUID.Zero; | 125 | return LLUUID.Zero; |
128 | } | 126 | } |
129 | else | 127 | else |
130 | { | 128 | { |
131 | this.InvenServices.CreateNewUserInventory(userProf.UUID); | 129 | this.m_inventoryService.CreateNewUserInventory(userProf.UUID); |
132 | Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); | 130 | Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); |
133 | return userProf.UUID; | 131 | return userProf.UUID; |
134 | } | 132 | } |
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 @@ | |||
1 | using System; | 1 | using System.Collections.Generic; |
2 | using System.Collections.Generic; | 2 | using libsecondlife; |
3 | using libsecondlife; | 3 | using OpenSim.Framework.Communications; |
4 | using OpenSim.Framework.Communications; | 4 | using OpenSim.Framework.Data; |
5 | using OpenSim.Framework.Data; | 5 | using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder; |
6 | using OpenSim.Framework.Types; | 6 | |
7 | using OpenSim.Framework.UserManagement; | 7 | namespace OpenSim.Region.Communications.Local |
8 | using OpenSim.Framework.Utilities; | 8 | { |
9 | using OpenSim.Framework.InventoryServiceBase; | 9 | public class LocalInventoryService : InventoryServiceBase |
10 | using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; | 10 | { |
11 | 11 | ||
12 | namespace OpenSim.Region.Communications.Local | 12 | public LocalInventoryService() |
13 | { | 13 | { |
14 | public class LocalInventoryService : InventoryServiceBase , IInventoryServices | 14 | |
15 | { | 15 | } |
16 | 16 | ||
17 | public LocalInventoryService() | 17 | public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) |
18 | { | 18 | { |
19 | 19 | List<InventoryFolderBase> folders = this.RequestFirstLevelFolders(userID); | |
20 | } | 20 | InventoryFolder rootFolder = null; |
21 | 21 | ||
22 | public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) | 22 | //need to make sure we send root folder first |
23 | { | 23 | foreach (InventoryFolderBase folder in folders) |
24 | List<InventoryFolderBase> folders = this.RequestFirstLevelFolders(userID); | 24 | { |
25 | InventoryFolder rootFolder = null; | 25 | if (folder.parentID == libsecondlife.LLUUID.Zero) |
26 | 26 | { | |
27 | //need to make sure we send root folder first | 27 | InventoryFolder newfolder = new InventoryFolder(folder); |
28 | foreach (InventoryFolderBase folder in folders) | 28 | rootFolder = newfolder; |
29 | { | 29 | folderCallBack(userID, newfolder); |
30 | if (folder.parentID == libsecondlife.LLUUID.Zero) | 30 | } |
31 | { | 31 | } |
32 | InventoryFolder newfolder = new InventoryFolder(folder); | 32 | |
33 | rootFolder = newfolder; | 33 | if (rootFolder != null) |
34 | folderCallBack(userID, newfolder); | 34 | { |
35 | } | 35 | foreach (InventoryFolderBase folder in folders) |
36 | } | 36 | { |
37 | 37 | if (folder.folderID != rootFolder.folderID) | |
38 | if (rootFolder != null) | 38 | { |
39 | { | 39 | InventoryFolder newfolder = new InventoryFolder(folder); |
40 | foreach (InventoryFolderBase folder in folders) | 40 | folderCallBack(userID, newfolder); |
41 | { | 41 | |
42 | if (folder.folderID != rootFolder.folderID) | 42 | List<InventoryItemBase> items = this.RequestFolderItems(newfolder.folderID); |
43 | { | 43 | foreach (InventoryItemBase item in items) |
44 | InventoryFolder newfolder = new InventoryFolder(folder); | 44 | { |
45 | folderCallBack(userID, newfolder); | 45 | itemCallBack(userID, item); |
46 | 46 | } | |
47 | List<InventoryItemBase> items = this.RequestFolderItems(newfolder.folderID); | 47 | } |
48 | foreach (InventoryItemBase item in items) | 48 | } |
49 | { | 49 | } |
50 | itemCallBack(userID, item); | 50 | } |
51 | } | 51 | |
52 | } | 52 | public override void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) |
53 | } | 53 | { |
54 | } | 54 | this.AddFolder(folder); |
55 | } | 55 | } |
56 | 56 | ||
57 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) | 57 | public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) |
58 | { | 58 | { |
59 | this.AddFolder(folder); | 59 | this.AddItem(item); |
60 | } | 60 | } |
61 | 61 | ||
62 | public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) | 62 | public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) |
63 | { | 63 | { |
64 | this.AddItem(item); | 64 | this.deleteItem(item); |
65 | } | 65 | } |
66 | 66 | } | |
67 | public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) | 67 | } |
68 | { | ||
69 | this.deleteItem(item); | ||
70 | } | ||
71 | } | ||
72 | } | ||
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 | |||
49 | profile = this.m_userManager.GetUserProfile(firstname, lastname); | 49 | profile = this.m_userManager.GetUserProfile(firstname, lastname); |
50 | if (profile != null) | 50 | if (profile != null) |
51 | { | 51 | { |
52 | m_Parent.InvenServices.CreateNewUserInventory(profile.UUID); | 52 | m_Parent.InventoryService.CreateNewUserInventory(profile.UUID); |
53 | } | 53 | } |
54 | 54 | ||
55 | return profile; | 55 | return profile; |
@@ -80,7 +80,7 @@ namespace OpenSim.Region.Communications.Local | |||
80 | public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) | 80 | public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) |
81 | { | 81 | { |
82 | ulong currentRegion = theUser.currentAgent.currentHandle; | 82 | ulong currentRegion = theUser.currentAgent.currentHandle; |
83 | RegionInfo reg = m_Parent.GridServer.RequestNeighbourInfo(currentRegion); | 83 | RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion); |
84 | 84 | ||
85 | if (reg != null) | 85 | if (reg != null) |
86 | { | 86 | { |
@@ -119,7 +119,7 @@ namespace OpenSim.Region.Communications.Local | |||
119 | 119 | ||
120 | protected override InventoryData CreateInventoryData(LLUUID userID) | 120 | protected override InventoryData CreateInventoryData(LLUUID userID) |
121 | { | 121 | { |
122 | List<InventoryFolderBase> folders = this.m_Parent.InvenServices.RequestFirstLevelFolders(userID); | 122 | List<InventoryFolderBase> folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); |
123 | if (folders.Count > 0) | 123 | if (folders.Count > 0) |
124 | { | 124 | { |
125 | LLUUID rootID = LLUUID.Zero; | 125 | 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; | |||
6 | 6 | ||
7 | namespace OpenSim.Region.Communications.Local | 7 | namespace OpenSim.Region.Communications.Local |
8 | { | 8 | { |
9 | public class LocalUserServices : UserManagerBase, IUserServices | 9 | public class LocalUserServices : UserManagerBase |
10 | { | 10 | { |
11 | private readonly CommunicationsLocal m_parent; | 11 | private readonly CommunicationsLocal m_parent; |
12 | 12 | ||
@@ -24,12 +24,12 @@ namespace OpenSim.Region.Communications.Local | |||
24 | m_defaultHomeY = m_serversInfo.DefaultHomeLocY; | 24 | m_defaultHomeY = m_serversInfo.DefaultHomeLocY; |
25 | } | 25 | } |
26 | 26 | ||
27 | public UserProfileData SetupMasterUser(string firstName, string lastName) | 27 | public override UserProfileData SetupMasterUser(string firstName, string lastName) |
28 | { | 28 | { |
29 | return SetupMasterUser(firstName, lastName, ""); | 29 | return SetupMasterUser(firstName, lastName, ""); |
30 | } | 30 | } |
31 | 31 | ||
32 | public UserProfileData SetupMasterUser(string firstName, string lastName, string password) | 32 | public override UserProfileData SetupMasterUser(string firstName, string lastName, string password) |
33 | { | 33 | { |
34 | UserProfileData profile = GetUserProfile(firstName, lastName); | 34 | UserProfileData profile = GetUserProfile(firstName, lastName); |
35 | if (profile != null) | 35 | if (profile != null) |
@@ -48,7 +48,7 @@ namespace OpenSim.Region.Communications.Local | |||
48 | } | 48 | } |
49 | else | 49 | else |
50 | { | 50 | { |
51 | m_parent.InvenServices.CreateNewUserInventory(profile.UUID); | 51 | m_parent.InventoryService.CreateNewUserInventory(profile.UUID); |
52 | } | 52 | } |
53 | 53 | ||
54 | return profile; | 54 | return profile; |