diff options
author | lbsa71 | 2007-09-27 13:25:45 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-27 13:25:45 +0000 |
commit | 8143c597fc5f62ec0d931d2d5b887730e06aec04 (patch) | |
tree | ae67873a5f801b2b7bdf9a7b088db98beb97b5ac /OpenSim/Region/Communications | |
parent | Terrain: (diff) | |
download | opensim-SC-8143c597fc5f62ec0d931d2d5b887730e06aec04.zip opensim-SC-8143c597fc5f62ec0d931d2d5b887730e06aec04.tar.gz opensim-SC-8143c597fc5f62ec0d931d2d5b887730e06aec04.tar.bz2 opensim-SC-8143c597fc5f62ec0d931d2d5b887730e06aec04.tar.xz |
* Tleiades grid mode inventory (#444) - thanx Tleiades!
* updated to rev 1413 on libsecondlife.dll and libsecondlife.dll.config (#423)
Diffstat (limited to 'OpenSim/Region/Communications')
7 files changed, 85 insertions, 67 deletions
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index a00b35f..7e08297 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs | |||
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Communications.Local | |||
107 | } | 107 | } |
108 | else | 108 | else |
109 | { | 109 | { |
110 | this.m_inventoryService.CreateNewUserInventory(userProf.UUID); | 110 | this.m_inventoryService.CreateNewUserInventory(LLUUID.Zero, userProf.UUID); |
111 | Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); | 111 | Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); |
112 | return userProf.UUID; | 112 | return userProf.UUID; |
113 | } | 113 | } |
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index 53f6ffa..5bd3277 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs | |||
@@ -3,6 +3,7 @@ using libsecondlife; | |||
3 | using OpenSim.Framework.Communications; | 3 | using OpenSim.Framework.Communications; |
4 | using OpenSim.Framework.Data; | 4 | using OpenSim.Framework.Data; |
5 | using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder; | 5 | using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder; |
6 | using InventoryCategory = OpenSim.Framework.Data.InventoryCategory; | ||
6 | 7 | ||
7 | namespace OpenSim.Region.Communications.Local | 8 | namespace OpenSim.Region.Communications.Local |
8 | { | 9 | { |
@@ -49,7 +50,7 @@ namespace OpenSim.Region.Communications.Local | |||
49 | } | 50 | } |
50 | } | 51 | } |
51 | 52 | ||
52 | public override void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) | 53 | public override void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) |
53 | { | 54 | { |
54 | this.AddFolder(folder); | 55 | this.AddFolder(folder); |
55 | } | 56 | } |
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index ab8e397..95fdf5a 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs | |||
@@ -7,7 +7,6 @@ using OpenSim.Framework.Data; | |||
7 | using OpenSim.Framework.Types; | 7 | using OpenSim.Framework.Types; |
8 | using OpenSim.Framework.UserManagement; | 8 | using OpenSim.Framework.UserManagement; |
9 | using OpenSim.Framework.Utilities; | 9 | using OpenSim.Framework.Utilities; |
10 | using OpenSim.Framework.Inventory; | ||
11 | 10 | ||
12 | namespace OpenSim.Region.Communications.Local | 11 | namespace OpenSim.Region.Communications.Local |
13 | { | 12 | { |
@@ -25,7 +24,7 @@ namespace OpenSim.Region.Communications.Local | |||
25 | public event LoginToRegionEvent OnLoginToRegion; | 24 | public event LoginToRegionEvent OnLoginToRegion; |
26 | 25 | ||
27 | public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate) | 26 | public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate) |
28 | : base(userManager, welcomeMess) | 27 | : base(userManager, parent.InventoryService, welcomeMess) |
29 | { | 28 | { |
30 | m_Parent = parent; | 29 | m_Parent = parent; |
31 | this.serversInfo = serversInfo; | 30 | this.serversInfo = serversInfo; |
@@ -53,7 +52,7 @@ namespace OpenSim.Region.Communications.Local | |||
53 | profile = this.m_userManager.GetUserProfile(firstname, lastname); | 52 | profile = this.m_userManager.GetUserProfile(firstname, lastname); |
54 | if (profile != null) | 53 | if (profile != null) |
55 | { | 54 | { |
56 | m_Parent.InventoryService.CreateNewUserInventory(profile.UUID); | 55 | m_Parent.InventoryService.CreateNewUserInventory(LLUUID.Zero, profile.UUID); |
57 | } | 56 | } |
58 | 57 | ||
59 | return profile; | 58 | return profile; |
@@ -123,51 +122,5 @@ namespace OpenSim.Region.Communications.Local | |||
123 | } | 122 | } |
124 | 123 | ||
125 | } | 124 | } |
126 | |||
127 | protected override InventoryData CreateInventoryData(LLUUID userID) | ||
128 | { | ||
129 | List<InventoryFolderBase> folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); | ||
130 | if (folders.Count > 0) | ||
131 | { | ||
132 | LLUUID rootID = LLUUID.Zero; | ||
133 | ArrayList AgentInventoryArray = new ArrayList(); | ||
134 | Hashtable TempHash; | ||
135 | foreach (InventoryFolderBase InvFolder in folders) | ||
136 | { | ||
137 | if (InvFolder.parentID == LLUUID.Zero) | ||
138 | { | ||
139 | rootID = InvFolder.folderID; | ||
140 | } | ||
141 | TempHash = new Hashtable(); | ||
142 | TempHash["name"] = InvFolder.name; | ||
143 | TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated(); | ||
144 | TempHash["version"] = (Int32)InvFolder.version; | ||
145 | TempHash["type_default"] = (Int32)InvFolder.type; | ||
146 | TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated(); | ||
147 | AgentInventoryArray.Add(TempHash); | ||
148 | } | ||
149 | return new InventoryData(AgentInventoryArray, rootID); | ||
150 | } | ||
151 | else | ||
152 | { | ||
153 | AgentInventory userInventory = new AgentInventory(); | ||
154 | userInventory.CreateRootFolder(userID, false); | ||
155 | |||
156 | ArrayList AgentInventoryArray = new ArrayList(); | ||
157 | Hashtable TempHash; | ||
158 | foreach (OpenSim.Framework.Inventory.InventoryFolder InvFolder in userInventory.InventoryFolders.Values) | ||
159 | { | ||
160 | TempHash = new Hashtable(); | ||
161 | TempHash["name"] = InvFolder.FolderName; | ||
162 | TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); | ||
163 | TempHash["version"] = (Int32)InvFolder.Version; | ||
164 | TempHash["type_default"] = (Int32)InvFolder.DefaultType; | ||
165 | TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); | ||
166 | AgentInventoryArray.Add(TempHash); | ||
167 | } | ||
168 | |||
169 | return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID); | ||
170 | } | ||
171 | } | ||
172 | } | 125 | } |
173 | } | 126 | } |
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 3bc4301..61b8633 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs | |||
@@ -1,4 +1,5 @@ | |||
1 | using System; | 1 | using System; |
2 | using libsecondlife; | ||
2 | using OpenSim.Framework.Communications; | 3 | using OpenSim.Framework.Communications; |
3 | using OpenSim.Framework.Data; | 4 | using OpenSim.Framework.Data; |
4 | using OpenSim.Framework.Types; | 5 | using OpenSim.Framework.Types; |
@@ -48,10 +49,10 @@ namespace OpenSim.Region.Communications.Local | |||
48 | } | 49 | } |
49 | else | 50 | else |
50 | { | 51 | { |
51 | m_parent.InventoryService.CreateNewUserInventory(profile.UUID); | 52 | m_parent.InventoryService.CreateNewUserInventory(LLUUID.Zero, profile.UUID); |
52 | } | 53 | } |
53 | 54 | ||
54 | return profile; | 55 | return profile; |
55 | } | 56 | } |
56 | } | 57 | } |
57 | } \ No newline at end of file | 58 | } |
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs index 96f1933..1aa6498 100644 --- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs | |||
@@ -14,8 +14,8 @@ namespace OpenSim.Region.Communications.OGS1 | |||
14 | m_gridService = gridInterComms; | 14 | m_gridService = gridInterComms; |
15 | m_interRegion = gridInterComms; | 15 | m_interRegion = gridInterComms; |
16 | 16 | ||
17 | m_inventoryService = new OGS1InventoryService(); | ||
18 | m_userService = new OGS1UserServices(this); | 17 | m_userService = new OGS1UserServices(this); |
18 | m_inventoryService = new OGS1InventoryService(serversInfo, m_userService); | ||
19 | } | 19 | } |
20 | } | 20 | } |
21 | } | 21 | } |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 1b4b54c..0b78c83 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -5,6 +5,7 @@ using System.Net; | |||
5 | using System.Runtime.Remoting; | 5 | using System.Runtime.Remoting; |
6 | using System.Runtime.Remoting.Channels; | 6 | using System.Runtime.Remoting.Channels; |
7 | using System.Runtime.Remoting.Channels.Tcp; | 7 | using System.Runtime.Remoting.Channels.Tcp; |
8 | using System.Runtime.Serialization.Formatters; | ||
8 | using libsecondlife; | 9 | using libsecondlife; |
9 | using Nwc.XmlRpc; | 10 | using Nwc.XmlRpc; |
10 | using OpenSim.Framework; | 11 | using OpenSim.Framework; |
@@ -302,8 +303,23 @@ namespace OpenSim.Region.Communications.OGS1 | |||
302 | /// </summary> | 303 | /// </summary> |
303 | private void StartRemoting() | 304 | private void StartRemoting() |
304 | { | 305 | { |
305 | TcpChannel ch = new TcpChannel(this.serversInfo.RemotingListenerPort); | 306 | // we only need to register the tcp channel once, and we don't know which other modules use remoting |
306 | ChannelServices.RegisterChannel(ch, true); | 307 | if (ChannelServices.GetChannel("tcp") == null) |
308 | { | ||
309 | // Creating a custom formatter for a TcpChannel sink chain. | ||
310 | BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider(); | ||
311 | serverProvider.TypeFilterLevel = TypeFilterLevel.Full; | ||
312 | |||
313 | BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider(); | ||
314 | |||
315 | IDictionary props = new Hashtable(); | ||
316 | props["port"] = this.serversInfo.RemotingListenerPort; | ||
317 | props["typeFilterLevel"] = TypeFilterLevel.Full; | ||
318 | |||
319 | TcpChannel ch = new TcpChannel(props, clientProvider, serverProvider); | ||
320 | |||
321 | ChannelServices.RegisterChannel(ch, true); | ||
322 | } | ||
307 | 323 | ||
308 | WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton); | 324 | WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton); |
309 | RemotingConfiguration.RegisterWellKnownServiceType(wellType); | 325 | RemotingConfiguration.RegisterWellKnownServiceType(wellType); |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 45188c1..2ec4d10 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs | |||
@@ -1,8 +1,15 @@ | |||
1 | using System; | ||
2 | using System.Runtime.Remoting; | ||
3 | using System.Runtime.Remoting.Channels; | ||
4 | using System.Runtime.Remoting.Channels.Tcp; | ||
5 | using System.Runtime.Serialization.Formatters; | ||
6 | using System.Collections; | ||
1 | using System.Collections.Generic; | 7 | using System.Collections.Generic; |
8 | |||
2 | using libsecondlife; | 9 | using libsecondlife; |
3 | using OpenSim.Framework.Communications; | 10 | using OpenSim.Framework.Communications; |
4 | using OpenSim.Framework.Data; | 11 | using OpenSim.Framework.Data; |
5 | using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; | 12 | using OpenSim.Framework.Types; |
6 | 13 | ||
7 | 14 | ||
8 | namespace OpenSim.Region.Communications.OGS1 | 15 | namespace OpenSim.Region.Communications.OGS1 |
@@ -10,43 +17,83 @@ namespace OpenSim.Region.Communications.OGS1 | |||
10 | public class OGS1InventoryService : IInventoryServices | 17 | public class OGS1InventoryService : IInventoryServices |
11 | { | 18 | { |
12 | 19 | ||
13 | public OGS1InventoryService() | 20 | IUserServices _userServices; |
21 | IInventoryServices _inventoryServices; | ||
22 | |||
23 | public OGS1InventoryService(NetworkServersInfo networkConfig, IUserServices userServices) : | ||
24 | this(networkConfig.InventoryServerName, networkConfig.InventoryServerPort, userServices) | ||
25 | { | ||
26 | } | ||
27 | |||
28 | public OGS1InventoryService(string serverName, int serverPort, IUserServices userServices) | ||
14 | { | 29 | { |
30 | _userServices = userServices; | ||
31 | |||
32 | // we only need to register the tcp channel once, and we don't know which other modules use remoting | ||
33 | if (ChannelServices.GetChannel("tcp") == null) | ||
34 | { | ||
35 | // Creating a custom formatter for a TcpChannel sink chain. | ||
36 | BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider(); | ||
37 | serverProvider.TypeFilterLevel = TypeFilterLevel.Full; | ||
38 | |||
39 | BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider(); | ||
40 | |||
41 | IDictionary props = new Hashtable(); | ||
42 | props["typeFilterLevel"] = TypeFilterLevel.Full; | ||
43 | |||
44 | // Pass the properties for the port setting and the server provider in the server chain argument. (Client remains null here.) | ||
45 | TcpChannel chan = new TcpChannel(props, clientProvider, serverProvider); | ||
46 | |||
47 | ChannelServices.RegisterChannel(chan, true); | ||
48 | } | ||
49 | |||
15 | 50 | ||
51 | |||
52 | string remotingUrl = string.Format("tcp://{0}:{1}/Inventory", serverName, serverPort); | ||
53 | _inventoryServices = (IInventoryServices)Activator.GetObject(typeof(IInventoryServices), remotingUrl); | ||
16 | } | 54 | } |
17 | 55 | ||
18 | #region IInventoryServices Members | 56 | #region IInventoryServices Members |
19 | 57 | ||
20 | public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) | 58 | public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) |
21 | { | 59 | { |
22 | 60 | _inventoryServices.RequestInventoryForUser(userID, folderCallBack, itemCallBack); | |
23 | } | 61 | } |
24 | 62 | ||
25 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) | 63 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) |
26 | { | 64 | { |
27 | 65 | _inventoryServices.AddNewInventoryFolder(userID, folder); | |
28 | } | 66 | } |
29 | 67 | ||
30 | public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) | 68 | public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) |
31 | { | 69 | { |
32 | 70 | _inventoryServices.AddNewInventoryItem(userID, item); | |
33 | } | 71 | } |
34 | 72 | ||
35 | public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) | 73 | public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) |
36 | { | 74 | { |
37 | 75 | _inventoryServices.DeleteInventoryItem(userID, item); | |
76 | } | ||
77 | |||
78 | public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID folderID) | ||
79 | { | ||
80 | return _inventoryServices.RequestFirstLevelFolders(folderID); | ||
38 | } | 81 | } |
39 | 82 | ||
40 | public void CreateNewUserInventory(LLUUID user) | 83 | public List<InventoryItemBase> RequestFolderItems(LLUUID folderID) |
41 | { | 84 | { |
42 | 85 | return _inventoryServices.RequestFolderItems(folderID); | |
43 | } | 86 | } |
44 | 87 | ||
45 | public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID) | 88 | public void GetRootFoldersForUser(LLUUID user, out LLUUID libraryFolder, out LLUUID personalFolder) |
46 | { | 89 | { |
47 | return new List<InventoryFolderBase>(); | 90 | _inventoryServices.GetRootFoldersForUser(user, out libraryFolder, out personalFolder); |
48 | } | 91 | } |
49 | 92 | ||
93 | public void CreateNewUserInventory(LLUUID libraryRootId, LLUUID user) | ||
94 | { | ||
95 | throw new Exception("method not implemented"); | ||
96 | } | ||
50 | #endregion | 97 | #endregion |
51 | } | 98 | } |
52 | } | 99 | } |