aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authordiva2009-04-01 01:18:21 +0000
committerdiva2009-04-01 01:18:21 +0000
commitd4f6750f8214dea3816b3496c73aef8829423168 (patch)
tree28b9074b9979587333bc092f978403bda2fd7167 /OpenSim
parentReplacing OpenMetaverse.StructuredData.dll again with one compiled under Wind... (diff)
downloadopensim-SC-d4f6750f8214dea3816b3496c73aef8829423168.zip
opensim-SC-d4f6750f8214dea3816b3496c73aef8829423168.tar.gz
opensim-SC-d4f6750f8214dea3816b3496c73aef8829423168.tar.bz2
opensim-SC-d4f6750f8214dea3816b3496c73aef8829423168.tar.xz
Added AllowLoginWithoutInventory to LoginService, to be overwritten in subclasses. Default is false. HGLoginAuthService sets it true. Better error handling dealing with inventory service faults.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/Services/HGLoginAuthService.cs6
-rw-r--r--OpenSim/Framework/Communications/Services/LoginResponse.cs9
-rw-r--r--OpenSim/Framework/Communications/Services/LoginService.cs41
3 files changed, 41 insertions, 15 deletions
diff --git a/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs b/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs
index 99fbb2b..5e357d5 100644
--- a/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs
+++ b/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs
@@ -324,5 +324,11 @@ namespace OpenSim.Framework.Communications.Services
324 324
325 m_regionsConnector.LogOffUserFromGrid(SimInfo.RegionHandle, theUser.ID, theUser.CurrentAgent.SecureSessionID, "Logging you off"); 325 m_regionsConnector.LogOffUserFromGrid(SimInfo.RegionHandle, theUser.ID, theUser.CurrentAgent.SecureSessionID, "Logging you off");
326 } 326 }
327
328 protected override bool AllowLoginWithoutInventory()
329 {
330 return true;
331 }
332
327 } 333 }
328} 334}
diff --git a/OpenSim/Framework/Communications/Services/LoginResponse.cs b/OpenSim/Framework/Communications/Services/LoginResponse.cs
index db208a4..c81febd 100644
--- a/OpenSim/Framework/Communications/Services/LoginResponse.cs
+++ b/OpenSim/Framework/Communications/Services/LoginResponse.cs
@@ -371,9 +371,12 @@ namespace OpenSim.Framework.Communications.Services
371 responseData["classified_categories"] = classifiedCategories; 371 responseData["classified_categories"] = classifiedCategories;
372 responseData["ui-config"] = uiConfig; 372 responseData["ui-config"] = uiConfig;
373 373
374 responseData["inventory-skeleton"] = agentInventory; 374 if (agentInventory != null)
375 {
376 responseData["inventory-skeleton"] = agentInventory;
377 responseData["inventory-root"] = inventoryRoot;
378 }
375 responseData["inventory-skel-lib"] = inventoryLibrary; 379 responseData["inventory-skel-lib"] = inventoryLibrary;
376 responseData["inventory-root"] = inventoryRoot;
377 responseData["inventory-lib-root"] = inventoryLibRoot; 380 responseData["inventory-lib-root"] = inventoryLibRoot;
378 responseData["gestures"] = activeGestures; 381 responseData["gestures"] = activeGestures;
379 responseData["inventory-lib-owner"] = inventoryLibraryOwner; 382 responseData["inventory-lib-owner"] = inventoryLibraryOwner;
@@ -386,8 +389,6 @@ namespace OpenSim.Framework.Communications.Services
386 responseData["region_x"] = (Int32)(RegionX * Constants.RegionSize); 389 responseData["region_x"] = (Int32)(RegionX * Constants.RegionSize);
387 responseData["region_y"] = (Int32)(RegionY * Constants.RegionSize); 390 responseData["region_y"] = (Int32)(RegionY * Constants.RegionSize);
388 391
389 //responseData["inventory-lib-root"] = new ArrayList(); // todo
390
391 if (m_buddyList != null) 392 if (m_buddyList != null)
392 { 393 {
393 responseData["buddy-list"] = m_buddyList.ToArray(); 394 responseData["buddy-list"] = m_buddyList.ToArray();
diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs
index 1b6520d..d9556e4 100644
--- a/OpenSim/Framework/Communications/Services/LoginService.cs
+++ b/OpenSim/Framework/Communications/Services/LoginService.cs
@@ -197,7 +197,7 @@ namespace OpenSim.Framework.Communications.Services
197 try 197 try
198 { 198 {
199 UUID agentID = userProfile.ID; 199 UUID agentID = userProfile.ID;
200 InventoryData inventData; 200 InventoryData inventData = null;
201 201
202 try 202 try
203 { 203 {
@@ -209,16 +209,24 @@ namespace OpenSim.Framework.Communications.Services
209 "[LOGIN END]: Error retrieving inventory skeleton of agent {0} - {1}", 209 "[LOGIN END]: Error retrieving inventory skeleton of agent {0} - {1}",
210 agentID, e); 210 agentID, e);
211 211
212 return logResponse.CreateLoginInventoryFailedResponse(); 212 // Let's not panic
213 if (!AllowLoginWithoutInventory())
214 return logResponse.CreateLoginInventoryFailedResponse();
213 } 215 }
214 216
215 ArrayList AgentInventoryArray = inventData.InventoryArray; 217 if (inventData != null)
218 {
219 ArrayList AgentInventoryArray = inventData.InventoryArray;
216 220
217 Hashtable InventoryRootHash = new Hashtable(); 221 Hashtable InventoryRootHash = new Hashtable();
218 InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); 222 InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString();
219 ArrayList InventoryRoot = new ArrayList(); 223 ArrayList InventoryRoot = new ArrayList();
220 InventoryRoot.Add(InventoryRootHash); 224 InventoryRoot.Add(InventoryRootHash);
221 userProfile.RootInventoryFolderID = inventData.RootFolderID; 225 userProfile.RootInventoryFolderID = inventData.RootFolderID;
226
227 logResponse.InventoryRoot = InventoryRoot;
228 logResponse.InventorySkeleton = AgentInventoryArray;
229 }
222 230
223 // Inventory Library Section 231 // Inventory Library Section
224 Hashtable InventoryLibRootHash = new Hashtable(); 232 Hashtable InventoryLibRootHash = new Hashtable();
@@ -228,8 +236,6 @@ namespace OpenSim.Framework.Communications.Services
228 236
229 logResponse.InventoryLibRoot = InventoryLibRoot; 237 logResponse.InventoryLibRoot = InventoryLibRoot;
230 logResponse.InventoryLibraryOwner = GetLibraryOwner(); 238 logResponse.InventoryLibraryOwner = GetLibraryOwner();
231 logResponse.InventoryRoot = InventoryRoot;
232 logResponse.InventorySkeleton = AgentInventoryArray;
233 logResponse.InventoryLibrary = GetInventoryLibrary(); 239 logResponse.InventoryLibrary = GetInventoryLibrary();
234 240
235 logResponse.CircuitCode = Util.RandomClass.Next(); 241 logResponse.CircuitCode = Util.RandomClass.Next();
@@ -1011,7 +1017,15 @@ namespace OpenSim.Framework.Communications.Services
1011 /// </param> 1017 /// </param>
1012 protected void AddActiveGestures(LoginResponse response, UserProfileData theUser) 1018 protected void AddActiveGestures(LoginResponse response, UserProfileData theUser)
1013 { 1019 {
1014 List<InventoryItemBase> gestures = m_inventoryService.GetActiveGestures(theUser.ID); 1020 List<InventoryItemBase> gestures = null;
1021 try
1022 {
1023 gestures = m_inventoryService.GetActiveGestures(theUser.ID);
1024 }
1025 catch (Exception e)
1026 {
1027 m_log.Debug("[LOGIN]: Unable to retrieve active gestures from inventory server. Reason: " + e.Message);
1028 }
1015 //m_log.DebugFormat("[LOGIN]: AddActiveGestures, found {0}", gestures == null ? 0 : gestures.Count); 1029 //m_log.DebugFormat("[LOGIN]: AddActiveGestures, found {0}", gestures == null ? 0 : gestures.Count);
1016 ArrayList list = new ArrayList(); 1030 ArrayList list = new ArrayList();
1017 if (gestures != null) 1031 if (gestures != null)
@@ -1089,5 +1103,10 @@ namespace OpenSim.Framework.Communications.Services
1089 1103
1090 return new InventoryData(AgentInventoryArray, rootID); 1104 return new InventoryData(AgentInventoryArray, rootID);
1091 } 1105 }
1106
1107 protected virtual bool AllowLoginWithoutInventory()
1108 {
1109 return false;
1110 }
1092 } 1111 }
1093} 1112}