aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/UserLoginService.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-06-21 03:29:08 +0000
committerTeravus Ovares2008-06-21 03:29:08 +0000
commita5860ad438885cbf76a36dc7958947355522b8cf (patch)
treeb392682ca7bf79e7fae18c16271980a9eead28bf /OpenSim/Grid/UserServer/UserLoginService.cs
parentlots of futzing with nhibernate to make it more efficient. I (diff)
downloadopensim-SC-a5860ad438885cbf76a36dc7958947355522b8cf.zip
opensim-SC-a5860ad438885cbf76a36dc7958947355522b8cf.tar.gz
opensim-SC-a5860ad438885cbf76a36dc7958947355522b8cf.tar.bz2
opensim-SC-a5860ad438885cbf76a36dc7958947355522b8cf.tar.xz
* Adds Region ban capability to Regions. You access this by going to World->Region/Estate. Then on the Estate tab, at the lower right hand corner, clicking the 'Add' button and picking an avatar.
* It only persists across reboots for the mySQL datastore currently. * Currently have stubs in the other datastores.
Diffstat (limited to 'OpenSim/Grid/UserServer/UserLoginService.cs')
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs84
1 files changed, 72 insertions, 12 deletions
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index d538d36..165700c 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -260,13 +260,37 @@ namespace OpenSim.Grid.UserServer
260 "[LOGIN]: XMLRPC request for {0} failed, fault code: {1}, reason: {2}", 260 "[LOGIN]: XMLRPC request for {0} failed, fault code: {1}, reason: {2}",
261 SimInfo.httpServerURI, GridResp.FaultCode, GridResp.FaultString); 261 SimInfo.httpServerURI, GridResp.FaultCode, GridResp.FaultString);
262 } 262 }
263 handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation; 263 if (!GridResp.IsFault)
264 if (handlerUserLoggedInAtLocation != null)
265 { 264 {
266 //m_log.Info("[LOGIN]: Letting other objects know about login"); 265 bool responseSuccess = true;
267 handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, 266
268 theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X,theUser.CurrentAgent.Position.Y,theUser.CurrentAgent.Position.Z, 267
269 theUser.FirstName,theUser.SurName); 268 if (GridResp.Value != null)
269 {
270 Hashtable resp = (Hashtable)GridResp.Value;
271 if (resp.ContainsKey("success"))
272 {
273 if ((string)resp["success"] == "FALSE")
274 {
275 responseSuccess = false;
276 tryDefault = true;
277 }
278 }
279 }
280
281 if (responseSuccess)
282 {
283 handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation;
284 if (handlerUserLoggedInAtLocation != null)
285 {
286 //m_log.Info("[LOGIN]: Letting other objects know about login");
287 handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region,
288 theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X, theUser.CurrentAgent.Position.Y, theUser.CurrentAgent.Position.Z,
289 theUser.FirstName, theUser.SurName);
290 }
291 }
292
293
270 } 294 }
271 } 295 }
272 catch (Exception) 296 catch (Exception)
@@ -340,14 +364,50 @@ namespace OpenSim.Grid.UserServer
340 // Send 364 // Send
341 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); 365 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
342 XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); 366 XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000);
343 handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation; 367
344 if (handlerUserLoggedInAtLocation != null) 368 if (!GridResp.IsFault)
369 {
370 bool responseSuccess = true;
371
372
373 if (GridResp.Value != null)
374 {
375 Hashtable resp = (Hashtable) GridResp.Value;
376 if (resp.ContainsKey("success"))
377 {
378 if ((string)resp["success"] == "FALSE")
379 {
380 responseSuccess = false;
381 tryDefault = true;
382 }
383 }
384 }
385
386 if (responseSuccess)
387 {
388 handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation;
389 if (handlerUserLoggedInAtLocation != null)
390 {
391 m_log.Info("[LOGIN]: Letting other objects know about login");
392 handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region,
393 theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X, theUser.CurrentAgent.Position.Y, theUser.CurrentAgent.Position.Z,
394 theUser.FirstName, theUser.SurName);
395 }
396 }
397 else
398 {
399 response.CreateDeadRegionResponse();
400
401 }
402
403
404 }
405 else
345 { 406 {
346 m_log.Info("[LOGIN]: Letting other objects know about login"); 407 response.CreateDeadRegionResponse();
347 handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, 408
348 theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X, theUser.CurrentAgent.Position.Y, theUser.CurrentAgent.Position.Z,
349 theUser.FirstName, theUser.SurName);
350 } 409 }
410
351 } 411 }
352 412
353 catch (Exception e) 413 catch (Exception e)