aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/CommunicationsManager.cs
diff options
context:
space:
mode:
authorMW2008-06-28 15:13:17 +0000
committerMW2008-06-28 15:13:17 +0000
commit86defd0a69d53df6d352b7d4b9a5b9d6621c19e8 (patch)
tree111e3144f54437d74650704d0a299451ed1a0e7a /OpenSim/Framework/Communications/CommunicationsManager.cs
parentRemove one warning. We are now down to 16 warnings in (diff)
downloadopensim-SC_OLD-86defd0a69d53df6d352b7d4b9a5b9d6621c19e8.zip
opensim-SC_OLD-86defd0a69d53df6d352b7d4b9a5b9d6621c19e8.tar.gz
opensim-SC_OLD-86defd0a69d53df6d352b7d4b9a5b9d6621c19e8.tar.bz2
opensim-SC_OLD-86defd0a69d53df6d352b7d4b9a5b9d6621c19e8.tar.xz
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.cs72
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 }