diff options
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/Framework/Communications/Services/LoginService.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Services/LoginService.cs | 41 |
1 files changed, 30 insertions, 11 deletions
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 | } |