diff options
plumbing for multiple inventory servers. Mostly done on the region server side.
TODO next is to make the login server read/write a users inventory from the correct server (the inventory url set in a userprofile)
On the region side, although not tested with multiple servers it should work if that inventory url was set, and the inventory servers urls have been added to the CommunicationsManager, using CommunicationsManager.AddInventoryService(string hostUrl)
Diffstat (limited to 'OpenSim/Framework/Communications/CommunicationsManager.cs')
-rw-r--r-- | OpenSim/Framework/Communications/CommunicationsManager.cs | 72 |
1 files changed, 65 insertions, 7 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 5de0c71..0410f0e 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -55,12 +55,6 @@ namespace OpenSim.Framework.Communications | |||
55 | get { return m_gridService; } | 55 | get { return m_gridService; } |
56 | } | 56 | } |
57 | 57 | ||
58 | protected IInventoryServices m_inventoryService; | ||
59 | |||
60 | public IInventoryServices InventoryService | ||
61 | { | ||
62 | get { return m_inventoryService; } | ||
63 | } | ||
64 | 58 | ||
65 | protected IInterRegionCommunications m_interRegion; | 59 | protected IInterRegionCommunications m_interRegion; |
66 | 60 | ||
@@ -106,6 +100,70 @@ namespace OpenSim.Framework.Communications | |||
106 | // m_transactionsManager = new AgentAssetTransactionsManager(this, dumpAssetsToFile); | 100 | // m_transactionsManager = new AgentAssetTransactionsManager(this, dumpAssetsToFile); |
107 | } | 101 | } |
108 | 102 | ||
103 | #region Inventory | ||
104 | protected string m_defaultInventoryHost = "default"; | ||
105 | |||
106 | protected List<IInventoryServices> m_inventoryServices = new List<IInventoryServices>(); | ||
107 | // protected IInventoryServices m_inventoryService; | ||
108 | |||
109 | public IInventoryServices InventoryService | ||
110 | { | ||
111 | get | ||
112 | { | ||
113 | if (m_inventoryServices.Count > 0) | ||
114 | { | ||
115 | // return m_inventoryServices[0]; | ||
116 | IInventoryServices invService; | ||
117 | if (TryGetInventoryService(m_defaultInventoryHost, out invService)) | ||
118 | { | ||
119 | return invService; | ||
120 | } | ||
121 | |||
122 | } | ||
123 | |||
124 | return null; | ||
125 | } | ||
126 | } | ||
127 | |||
128 | public bool TryGetInventoryService(string host, out IInventoryServices inventoryService) | ||
129 | { | ||
130 | if ((host == string.Empty) | (host == "default")) | ||
131 | { | ||
132 | host = m_defaultInventoryHost; | ||
133 | } | ||
134 | |||
135 | |||
136 | lock (m_inventoryServices) | ||
137 | { | ||
138 | foreach (IInventoryServices service in m_inventoryServices) | ||
139 | { | ||
140 | if (service.Host == host) | ||
141 | { | ||
142 | inventoryService = service; | ||
143 | return true; | ||
144 | } | ||
145 | } | ||
146 | } | ||
147 | |||
148 | inventoryService = null; | ||
149 | return false; | ||
150 | } | ||
151 | |||
152 | public virtual void AddInventoryService(string hostUrl) | ||
153 | { | ||
154 | |||
155 | } | ||
156 | |||
157 | public virtual void AddInventoryService(IInventoryServices service) | ||
158 | { | ||
159 | lock (m_inventoryServices) | ||
160 | { | ||
161 | m_inventoryServices.Add(service); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | #endregion | ||
166 | |||
109 | public void doCreate(string[] cmmdParams) | 167 | public void doCreate(string[] cmmdParams) |
110 | { | 168 | { |
111 | switch (cmmdParams[0]) | 169 | switch (cmmdParams[0]) |
@@ -167,7 +225,7 @@ namespace OpenSim.Framework.Communications | |||
167 | } | 225 | } |
168 | else | 226 | else |
169 | { | 227 | { |
170 | m_inventoryService.CreateNewUserInventory(userProf.ID); | 228 | InventoryService.CreateNewUserInventory(userProf.ID); |
171 | m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName); | 229 | m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName); |
172 | return userProf.ID; | 230 | return userProf.ID; |
173 | } | 231 | } |