diff options
Diffstat (limited to 'OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs')
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs | 69 |
1 files changed, 11 insertions, 58 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 2ec4d10..45188c1 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs | |||
@@ -1,15 +1,8 @@ | |||
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; | ||
7 | using System.Collections.Generic; | 1 | using System.Collections.Generic; |
8 | |||
9 | using libsecondlife; | 2 | using libsecondlife; |
10 | using OpenSim.Framework.Communications; | 3 | using OpenSim.Framework.Communications; |
11 | using OpenSim.Framework.Data; | 4 | using OpenSim.Framework.Data; |
12 | using OpenSim.Framework.Types; | 5 | using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; |
13 | 6 | ||
14 | 7 | ||
15 | namespace OpenSim.Region.Communications.OGS1 | 8 | namespace OpenSim.Region.Communications.OGS1 |
@@ -17,83 +10,43 @@ namespace OpenSim.Region.Communications.OGS1 | |||
17 | public class OGS1InventoryService : IInventoryServices | 10 | public class OGS1InventoryService : IInventoryServices |
18 | { | 11 | { |
19 | 12 | ||
20 | IUserServices _userServices; | 13 | public OGS1InventoryService() |
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) | ||
29 | { | 14 | { |
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 | |||
50 | 15 | ||
51 | |||
52 | string remotingUrl = string.Format("tcp://{0}:{1}/Inventory", serverName, serverPort); | ||
53 | _inventoryServices = (IInventoryServices)Activator.GetObject(typeof(IInventoryServices), remotingUrl); | ||
54 | } | 16 | } |
55 | 17 | ||
56 | #region IInventoryServices Members | 18 | #region IInventoryServices Members |
57 | 19 | ||
58 | public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) | 20 | public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) |
59 | { | 21 | { |
60 | _inventoryServices.RequestInventoryForUser(userID, folderCallBack, itemCallBack); | 22 | |
61 | } | 23 | } |
62 | 24 | ||
63 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) | 25 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) |
64 | { | 26 | { |
65 | _inventoryServices.AddNewInventoryFolder(userID, folder); | 27 | |
66 | } | 28 | } |
67 | 29 | ||
68 | public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) | 30 | public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) |
69 | { | 31 | { |
70 | _inventoryServices.AddNewInventoryItem(userID, item); | 32 | |
71 | } | 33 | } |
72 | 34 | ||
73 | public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) | 35 | public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) |
74 | { | 36 | { |
75 | _inventoryServices.DeleteInventoryItem(userID, item); | 37 | |
76 | } | ||
77 | |||
78 | public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID folderID) | ||
79 | { | ||
80 | return _inventoryServices.RequestFirstLevelFolders(folderID); | ||
81 | } | 38 | } |
82 | 39 | ||
83 | public List<InventoryItemBase> RequestFolderItems(LLUUID folderID) | 40 | public void CreateNewUserInventory(LLUUID user) |
84 | { | 41 | { |
85 | return _inventoryServices.RequestFolderItems(folderID); | 42 | |
86 | } | 43 | } |
87 | 44 | ||
88 | public void GetRootFoldersForUser(LLUUID user, out LLUUID libraryFolder, out LLUUID personalFolder) | 45 | public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID) |
89 | { | 46 | { |
90 | _inventoryServices.GetRootFoldersForUser(user, out libraryFolder, out personalFolder); | 47 | return new List<InventoryFolderBase>(); |
91 | } | 48 | } |
92 | 49 | ||
93 | public void CreateNewUserInventory(LLUUID libraryRootId, LLUUID user) | ||
94 | { | ||
95 | throw new Exception("method not implemented"); | ||
96 | } | ||
97 | #endregion | 50 | #endregion |
98 | } | 51 | } |
99 | } | 52 | } |