aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications
diff options
context:
space:
mode:
authorlbsa712007-09-24 07:30:30 +0000
committerlbsa712007-09-24 07:30:30 +0000
commit1302ef44e3c632159378bc4042c753bcf36e9c63 (patch)
tree6b6295ac233ecb05afe6432a903ec616e4fa079a /OpenSim/Region/Communications
parent* Trying to streamline CommunicationsManager (diff)
downloadopensim-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')
-rw-r--r--OpenSim/Region/Communications/Local/CommunicationsLocal.cs38
-rw-r--r--OpenSim/Region/Communications/Local/LocalInventoryService.cs139
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs6
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs8
-rw-r--r--OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs6
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs90
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs5
7 files changed, 152 insertions, 140 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*/
28using System; 28using System;
29using libsecondlife;
29using OpenSim.Framework.Communications; 30using OpenSim.Framework.Communications;
30using OpenSim.Framework.Communications.Cache; 31using OpenSim.Framework.Communications.Cache;
31using OpenSim.Framework.Types;
32using OpenSim.Framework.Servers;
33using OpenSim.Framework.Console; 32using OpenSim.Framework.Console;
34using OpenSim.Framework.Utilities;
35using OpenSim.Framework.Data; 33using OpenSim.Framework.Data;
36using OpenSim.Framework.UserManagement; 34using OpenSim.Framework.Servers;
37using libsecondlife; 35using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities;
38 37
39namespace OpenSim.Region.Communications.Local 38namespace 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 @@
1using System; 1using System.Collections.Generic;
2using System.Collections.Generic; 2using libsecondlife;
3using libsecondlife; 3using OpenSim.Framework.Communications;
4using OpenSim.Framework.Communications; 4using OpenSim.Framework.Data;
5using OpenSim.Framework.Data; 5using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
6using OpenSim.Framework.Types; 6
7using OpenSim.Framework.UserManagement; 7namespace OpenSim.Region.Communications.Local
8using OpenSim.Framework.Utilities; 8{
9using OpenSim.Framework.InventoryServiceBase; 9 public class LocalInventoryService : InventoryServiceBase
10using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; 10 {
11 11
12namespace 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
7namespace OpenSim.Region.Communications.Local 7namespace 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;
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
11 public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache) 11 public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache)
12 { 12 {
13 OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); 13 OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer);
14 m_gridServer = gridInterComms; 14 m_gridService = gridInterComms;
15 m_interRegion = gridInterComms; 15 m_interRegion = gridInterComms;
16 16
17 m_inventoryServer = new OGS1InventoryService(); 17 m_inventoryService = new OGS1InventoryService();
18 m_userServer = new OGS1UserServices(this); 18 m_userService = new OGS1UserServices(this);
19 } 19 }
20 } 20 }
21} 21}
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 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using libsecondlife; 3using libsecondlife;
4using OpenSim.Framework.Communications; 4using OpenSim.Framework.Communications;
5using OpenSim.Framework.Data; 5using OpenSim.Framework.Data;
6using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; 6using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder;
7 7
8namespace OpenSim.Region.Communications.OGS1 8namespace OpenSim.Region.Communications.OGS1
9{ 9{
10 public class OGS1InventoryService : IInventoryServices 10 public class OGS1InventoryService : IInventoryServices
11 { 11 {
12 12
13 public OGS1InventoryService() 13 public OGS1InventoryService()
14 { 14 {
15 15
16 } 16 }
17 17
18 public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) 18 #region IInventoryServices Members
19 { 19
20 20 public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack)
21 } 21 {
22 22 throw new Exception("The method or operation is not implemented.");
23 public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) 23 }
24 { 24
25 25 public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder)
26 } 26 {
27 27 throw new Exception("The method or operation is not implemented.");
28 public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) 28 }
29 { 29
30 30 public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
31 } 31 {
32 32 throw new Exception("The method or operation is not implemented.");
33 public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) 33 }
34 { 34
35 35 public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
36 } 36 {
37 } 37 throw new Exception("The method or operation is not implemented.");
38} 38 }
39
40 public void CreateNewUserInventory(LLUUID user)
41 {
42 throw new Exception("The method or operation is not implemented.");
43 }
44
45 public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID)
46 {
47 throw new Exception("The method or operation is not implemented.");
48 }
49
50 #endregion
51 }
52}
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
101 UserProfileData profile = GetUserProfile(firstName, lastName); 101 UserProfileData profile = GetUserProfile(firstName, lastName);
102 return profile; 102 return profile;
103 } 103 }
104
105 public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
106 {
107 throw new Exception("The method or operation is not implemented.");
108 }
104 } 109 }
105} 110}