aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/UserLoginService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/UserServer/UserLoginService.cs')
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs31
1 files changed, 13 insertions, 18 deletions
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 8683daf..bd0e38b 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -97,8 +97,6 @@ namespace OpenSim.Grid.UserServer
97 ArrayList SendParams = new ArrayList(); 97 ArrayList SendParams = new ArrayList();
98 SendParams.Add(SimParams); 98 SendParams.Add(SimParams);
99 99
100 // Update agent with target sim
101
102 m_log.InfoFormat( 100 m_log.InfoFormat(
103 "[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}", 101 "[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}",
104 SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI, 102 SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI,
@@ -124,18 +122,13 @@ namespace OpenSim.Grid.UserServer
124 //base.LogOffUser(theUser); 122 //base.LogOffUser(theUser);
125 } 123 }
126 124
127 //public override void LogOffUser(UserProfileData theUser)
128 //{
129
130 //}
131
132 /// <summary> 125 /// <summary>
133 /// Customises the login response and fills in missing values. 126 /// Customises the login response and fills in missing values.
134 /// </summary> 127 /// </summary>
135 /// <param name="response">The existing response</param> 128 /// <param name="response">The existing response</param>
136 /// <param name="theUser">The user profile</param> 129 /// <param name="theUser">The user profile</param>
137 /// <param name="startLocationRequest">Destination of the user</param> 130 /// <param name="startLocationRequest">Destination of the user</param>
138 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser, 131 public override bool CustomiseResponse(LoginResponse response, UserProfileData theUser,
139 string startLocationRequest) 132 string startLocationRequest)
140 { 133 {
141 RegionProfileData SimInfo; 134 RegionProfileData SimInfo;
@@ -250,8 +243,7 @@ namespace OpenSim.Grid.UserServer
250 ulong defaultHandle = (((ulong) m_config.DefaultX * Constants.RegionSize) << 32) | 243 ulong defaultHandle = (((ulong) m_config.DefaultX * Constants.RegionSize) << 32) |
251 ((ulong) m_config.DefaultY * Constants.RegionSize); 244 ((ulong) m_config.DefaultY * Constants.RegionSize);
252 245
253 m_log.Warn( 246 m_log.Error("[LOGIN]: Sending user to default region " + defaultHandle + " instead");
254 "[LOGIN]: Sending user to default region " + defaultHandle + " instead");
255 247
256 SimInfo = RegionProfileData.RequestSimProfileData( 248 SimInfo = RegionProfileData.RequestSimProfileData(
257 defaultHandle, m_config.GridServerURL, 249 defaultHandle, m_config.GridServerURL,
@@ -267,8 +259,13 @@ namespace OpenSim.Grid.UserServer
267 theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z); 259 theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z);
268 260
269 if (!PrepareLoginToRegion(SimInfo, theUser, response)) 261 if (!PrepareLoginToRegion(SimInfo, theUser, response))
262 {
270 response.CreateDeadRegionResponse(); 263 response.CreateDeadRegionResponse();
264 return false;
265 }
271 } 266 }
267
268 return true;
272 } 269 }
273 270
274 /// <summary> 271 /// <summary>
@@ -282,10 +279,7 @@ namespace OpenSim.Grid.UserServer
282 private bool PrepareLoginToRegion(RegionProfileData sim, UserProfileData user, LoginResponse response) 279 private bool PrepareLoginToRegion(RegionProfileData sim, UserProfileData user, LoginResponse response)
283 { 280 {
284 try 281 try
285 { 282 {
286 // Destination
287 m_log.Info("[LOGIN]: CUSTOMISERESPONSE: Region X: " + sim.regionLocX + "; Region Y: " + sim.regionLocY);
288
289 response.SimAddress = Util.GetHostFromURL(sim.serverURI).ToString(); 283 response.SimAddress = Util.GetHostFromURL(sim.serverURI).ToString();
290 response.SimPort = uint.Parse(sim.serverURI.Split(new char[] {'/', ':'})[4]); 284 response.SimPort = uint.Parse(sim.serverURI.Split(new char[] {'/', ':'})[4]);
291 response.RegionX = sim.regionLocX; 285 response.RegionX = sim.regionLocX;
@@ -296,7 +290,9 @@ namespace OpenSim.Grid.UserServer
296 response.SeedCapability = sim.httpServerURI + "CAPS/" + capsPath + "0000/"; 290 response.SeedCapability = sim.httpServerURI + "CAPS/" + capsPath + "0000/";
297 291
298 // Notify the target of an incoming user 292 // Notify the target of an incoming user
299 m_log.Info("[LOGIN]: Telling " + sim.regionName + " (" + sim.serverURI + ") to prepare for client connection"); 293 m_log.InfoFormat(
294 "[LOGIN]: Telling {0} @ {1},{2} ({3}) to prepare for client connection",
295 sim.regionName, sim.regionLocX, sim.regionLocY, sim.serverURI);
300 296
301 // Update agent with target sim 297 // Update agent with target sim
302 user.CurrentAgent.Region = sim.UUID; 298 user.CurrentAgent.Region = sim.UUID;
@@ -317,8 +313,6 @@ namespace OpenSim.Grid.UserServer
317 SimParams["caps_path"] = capsPath; 313 SimParams["caps_path"] = capsPath;
318 ArrayList SendParams = new ArrayList(); 314 ArrayList SendParams = new ArrayList();
319 SendParams.Add(SimParams); 315 SendParams.Add(SimParams);
320
321 m_log.Info("[LOGIN]: Informing region at " + sim.httpServerURI);
322 316
323 // Send 317 // Send
324 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); 318 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
@@ -345,7 +339,6 @@ namespace OpenSim.Grid.UserServer
345 handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation; 339 handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation;
346 if (handlerUserLoggedInAtLocation != null) 340 if (handlerUserLoggedInAtLocation != null)
347 { 341 {
348 m_log.Info("[LOGIN]: Letting listeners know about successful login");
349 handlerUserLoggedInAtLocation(user.ID, user.CurrentAgent.SessionID, 342 handlerUserLoggedInAtLocation(user.ID, user.CurrentAgent.SessionID,
350 user.CurrentAgent.Region, 343 user.CurrentAgent.Region,
351 user.CurrentAgent.Handle, 344 user.CurrentAgent.Handle,
@@ -357,11 +350,13 @@ namespace OpenSim.Grid.UserServer
357 } 350 }
358 else 351 else
359 { 352 {
353 m_log.ErrorFormat("[LOGIN]: Region responded that it is not available to receive clients");
360 return false; 354 return false;
361 } 355 }
362 } 356 }
363 else 357 else
364 { 358 {
359 m_log.ErrorFormat("[LOGIN]: XmlRpc request to region failed with message {0}, code {1} ", GridResp.FaultString, GridResp.FaultCode);
365 return false; 360 return false;
366 } 361 }
367 } 362 }