aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-03-23 21:21:39 +0000
committerJustin Clarke Casey2008-03-23 21:21:39 +0000
commitda531fa9e124394228a7c7597bd50e548af81efb (patch)
treef522f4f115b8bf5db07b45ddcc1c60261dcde680 /OpenSim/Framework/Communications
parentImplements llGetParcelPrimOwners() (diff)
downloadopensim-SC_OLD-da531fa9e124394228a7c7597bd50e548af81efb.zip
opensim-SC_OLD-da531fa9e124394228a7c7597bd50e548af81efb.tar.gz
opensim-SC_OLD-da531fa9e124394228a7c7597bd50e548af81efb.tar.bz2
opensim-SC_OLD-da531fa9e124394228a7c7597bd50e548af81efb.tar.xz
* Start passing around a region server's http port in RegionInfo.
* This means that caps methods (editing scripts, poss map functions, etc) on non-home regions should now work with servers which are listening for http ports on a non default (9000) port. * If you are running a region server, this may only work properly once your grid server upgrades to this revision * PLEASE NOTE: This shouldn't cause inter-region problems if one end of the connection hasn't upgraded to this revision. However if it does, the instability will persist until the grid and region (and possibly all the region's neighbours) have upgraded to this revision. * This revision also adds extra login related messages, both for success and failure conditions
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs57
1 files changed, 39 insertions, 18 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index be47258..3e3216f 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Framework.UserManagement
73 } 73 }
74 74
75 /// <summary> 75 /// <summary>
76 /// Main user login function 76 /// Called when we receive the client's initial
77 /// </summary> 77 /// </summary>
78 /// <param name="request">The XMLRPC request</param> 78 /// <param name="request">The XMLRPC request</param>
79 /// <returns>The response to send</returns> 79 /// <returns>The response to send</returns>
@@ -94,25 +94,32 @@ namespace OpenSim.Framework.UserManagement
94 94
95 string startLocationRequest = "last"; 95 string startLocationRequest = "last";
96 96
97 if (requestData.Contains("start"))
98 {
99 startLocationRequest = (string)requestData["start"];
100 m_log.Info("[LOGIN]: Client Requested Start: " + (string)requestData["start"]);
101 }
102
103 UserProfileData userProfile; 97 UserProfileData userProfile;
104 LoginResponse logResponse = new LoginResponse(); 98 LoginResponse logResponse = new LoginResponse();
99
100 string firstname = String.Empty;
101 string lastname = String.Empty;
105 102
106 if (GoodXML) 103 if (GoodXML)
107 { 104 {
108 string firstname = (string) requestData["first"]; 105 firstname = (string) requestData["first"];
109 string lastname = (string) requestData["last"]; 106 lastname = (string) requestData["last"];
107
108 m_log.InfoFormat(
109 "[LOGIN]: Received login request message from user {0} {1}",
110 firstname, lastname);
110 111
111 if( requestData.Contains("version")) 112 if( requestData.Contains("version"))
112 { 113 {
113 string clientversion = (string)requestData["version"]; 114 string clientversion = (string)requestData["version"];
114 m_log.Info("[LOGIN]: Client Version " + clientversion + " for " + firstname + " " + lastname); 115 m_log.Info("[LOGIN]: Client version: " + clientversion);
115 } 116 }
117
118 if (requestData.Contains("start"))
119 {
120 startLocationRequest = (string)requestData["start"];
121 m_log.Info("[LOGIN]: Client requested start location: " + (string)requestData["start"]);
122 }
116 123
117 userProfile = GetTheUser(firstname, lastname); 124 userProfile = GetTheUser(firstname, lastname);
118 if (userProfile == null) 125 if (userProfile == null)
@@ -134,31 +141,35 @@ namespace OpenSim.Framework.UserManagement
134 { 141 {
135 webloginkey = new LLUUID((string)requestData["web_login_key"]); 142 webloginkey = new LLUUID((string)requestData["web_login_key"]);
136 } 143 }
137 catch (System.Exception) 144 catch (System.Exception e)
138 { 145 {
146 m_log.InfoFormat(
147 "[LOGIN]: Bad web_login_key: {0} for user {1} {2}, exception {3}",
148 requestData["web_login_key"], firstname, lastname, e);
149
139 return logResponse.CreateFailedResponse(); 150 return logResponse.CreateFailedResponse();
140 } 151 }
141 GoodLogin = AuthenticateUser(userProfile, webloginkey); 152 GoodLogin = AuthenticateUser(userProfile, webloginkey);
142 153
143 } 154 }
144 else
145 {
146 return logResponse.CreateFailedResponse();
147 }
148 } 155 }
149 else 156 else
150 { 157 {
158 m_log.Info(
159 "[LOGIN]: login_to_simulator login message did not contain all the required data");
160
151 return logResponse.CreateGridErrorResponse(); 161 return logResponse.CreateGridErrorResponse();
152 } 162 }
153 163
154 if (!GoodLogin) 164 if (!GoodLogin)
155 { 165 {
166 m_log.InfoFormat("[LOGIN]: User {0} {1} failed authentication", firstname, lastname);
167
156 return logResponse.CreateLoginFailedResponse(); 168 return logResponse.CreateLoginFailedResponse();
157 } 169 }
158 else 170 else
159 { 171 {
160 // If we already have a session... 172 // If we already have a session...
161
162 if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) 173 if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline)
163 { 174 {
164 //TODO: The following statements can cause trouble: 175 //TODO: The following statements can cause trouble:
@@ -169,6 +180,11 @@ namespace OpenSim.Framework.UserManagement
169 m_userManager.CommitAgent(ref userProfile); 180 m_userManager.CommitAgent(ref userProfile);
170 181
171 // Reject the login 182 // Reject the login
183
184 m_log.InfoFormat(
185 "[LOGIN]: Notifying user {0} {1} that they are already logged in",
186 firstname, lastname);
187
172 return logResponse.CreateAlreadyLoggedInResponse(); 188 return logResponse.CreateAlreadyLoggedInResponse();
173 } 189 }
174 // Otherwise... 190 // Otherwise...
@@ -234,14 +250,19 @@ namespace OpenSim.Framework.UserManagement
234 if (StatsManager.UserStats != null) 250 if (StatsManager.UserStats != null)
235 StatsManager.UserStats.AddSuccessfulLogin(); 251 StatsManager.UserStats.AddSuccessfulLogin();
236 252
253 m_log.InfoFormat(
254 "[LOGIN]: Authentication of user {0} {1} successful. Sending response to client.",
255 firstname, lastname);
256
237 return logResponse.ToXmlRpcResponse(); 257 return logResponse.ToXmlRpcResponse();
238 } 258 }
239 catch (Exception e) 259 catch (Exception e)
240 { 260 {
241 m_log.Info("[LOGIN]: " + e.ToString()); 261 m_log.Info("[LOGIN]: Login failed, exception" + e.ToString());
242 } 262 }
243 //}
244 } 263 }
264
265 m_log.Info("[LOGIN]: Login failed. Sending back blank XMLRPC response");
245 return response; 266 return response;
246 } 267 }
247 finally 268 finally