aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-09-07 05:07:57 +0000
committerJustin Clarke Casey2008-09-07 05:07:57 +0000
commit815278531ab578dc5c4fbfefb71c6b458c201571 (patch)
treed467b4222462e8d590d9cdf47268a016bfddac83 /OpenSim/Framework
parent* refactor: Remove duplication in UserLoginService where most of the emergenc... (diff)
downloadopensim-SC_OLD-815278531ab578dc5c4fbfefb71c6b458c201571.zip
opensim-SC_OLD-815278531ab578dc5c4fbfefb71c6b458c201571.tar.gz
opensim-SC_OLD-815278531ab578dc5c4fbfefb71c6b458c201571.tar.bz2
opensim-SC_OLD-815278531ab578dc5c4fbfefb71c6b458c201571.tar.xz
* Improve login failure handling.
* Now it should properly inform the user and stop a login if a region server could not be contacted in order to expect a user (the last commit didn't actually quite work correctly)
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs41
1 files changed, 20 insertions, 21 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index d8d0fa2..42292f3 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -74,11 +74,13 @@ namespace OpenSim.Framework.Communications
74 } 74 }
75 75
76 /// <summary> 76 /// <summary>
77 /// Customises the login response and fills in missing values. 77 /// Customises the login response and fills in missing values. This method also tells the login region to
78 /// expect a client connection.
78 /// </summary> 79 /// </summary>
79 /// <param name="response">The existing response</param> 80 /// <param name="response">The existing response</param>
80 /// <param name="theUser">The user profile</param> 81 /// <param name="theUser">The user profile</param>
81 public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest); 82 /// <returns>true on success, false if the region was not successfully told to expect a user connection</returns>
83 public abstract bool CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest);
82 84
83 /// <summary> 85 /// <summary>
84 /// If the user is already logged in, try to notify the region that the user they've got is dead. 86 /// If the user is already logged in, try to notify the region that the user they've got is dead.
@@ -86,8 +88,8 @@ namespace OpenSim.Framework.Communications
86 /// <param name="theUser"></param> 88 /// <param name="theUser"></param>
87 public virtual void LogOffUser(UserProfileData theUser, string message) 89 public virtual void LogOffUser(UserProfileData theUser, string message)
88 { 90 {
89
90 } 91 }
92
91 /// <summary> 93 /// <summary>
92 /// Get the initial login inventory skeleton (in other words, the folder structure) for the given user. 94 /// Get the initial login inventory skeleton (in other words, the folder structure) for the given user.
93 /// </summary> 95 /// </summary>
@@ -284,29 +286,26 @@ namespace OpenSim.Framework.Communications
284 logResponse.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(agentID)); 286 logResponse.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(agentID));
285 logResponse.StartLocation = startLocationRequest; 287 logResponse.StartLocation = startLocationRequest;
286 288
287 try 289 if (CustomiseResponse(logResponse, userProfile, startLocationRequest))
288 { 290 {
289 CustomiseResponse(logResponse, userProfile, startLocationRequest); 291 userProfile.LastLogin = userProfile.CurrentAgent.LoginTime;
292 CommitAgent(ref userProfile);
293
294 // If we reach this point, then the login has successfully logged onto the grid
295 if (StatsManager.UserStats != null)
296 StatsManager.UserStats.AddSuccessfulLogin();
297
298 m_log.DebugFormat(
299 "[LOGIN END]: XMLRPC Authentication of user {0} {1} successful. Sending response to client.",
300 firstname, lastname);
301
302 return logResponse.ToXmlRpcResponse();
290 } 303 }
291 catch (Exception e) 304 else
292 { 305 {
293 m_log.Info("[LOGIN END]: XMLRPC " + e.ToString()); 306 m_log.ErrorFormat("[LOGIN END]: XMLRPC informing user {0} {1} that login failed due to an unavailable region", firstname, lastname);
294 return logResponse.CreateDeadRegionResponse(); 307 return logResponse.CreateDeadRegionResponse();
295 //return logResponse.ToXmlRpcResponse();
296 } 308 }
297
298 userProfile.LastLogin = userProfile.CurrentAgent.LoginTime;
299 CommitAgent(ref userProfile);
300
301 // If we reach this point, then the login has successfully logged onto the grid
302 if (StatsManager.UserStats != null)
303 StatsManager.UserStats.AddSuccessfulLogin();
304
305 m_log.DebugFormat(
306 "[LOGIN END]: XMLRPC Authentication of user {0} {1} successful. Sending response to client.",
307 firstname, lastname);
308
309 return logResponse.ToXmlRpcResponse();
310 } 309 }
311 catch (Exception e) 310 catch (Exception e)
312 { 311 {