From a5860ad438885cbf76a36dc7958947355522b8cf Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 21 Jun 2008 03:29:08 +0000 Subject: * 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. --- OpenSim/Grid/UserServer/UserLoginService.cs | 84 ++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 12 deletions(-) (limited to 'OpenSim/Grid/UserServer') 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 "[LOGIN]: XMLRPC request for {0} failed, fault code: {1}, reason: {2}", SimInfo.httpServerURI, GridResp.FaultCode, GridResp.FaultString); } - handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation; - if (handlerUserLoggedInAtLocation != null) + if (!GridResp.IsFault) { - //m_log.Info("[LOGIN]: Letting other objects know about login"); - handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, - theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X,theUser.CurrentAgent.Position.Y,theUser.CurrentAgent.Position.Z, - theUser.FirstName,theUser.SurName); + bool responseSuccess = true; + + + if (GridResp.Value != null) + { + Hashtable resp = (Hashtable)GridResp.Value; + if (resp.ContainsKey("success")) + { + if ((string)resp["success"] == "FALSE") + { + responseSuccess = false; + tryDefault = true; + } + } + } + + if (responseSuccess) + { + handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation; + if (handlerUserLoggedInAtLocation != null) + { + //m_log.Info("[LOGIN]: Letting other objects know about login"); + handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, + theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X, theUser.CurrentAgent.Position.Y, theUser.CurrentAgent.Position.Z, + theUser.FirstName, theUser.SurName); + } + } + + } } catch (Exception) @@ -340,14 +364,50 @@ namespace OpenSim.Grid.UserServer // Send XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); - handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation; - if (handlerUserLoggedInAtLocation != null) + + if (!GridResp.IsFault) + { + bool responseSuccess = true; + + + if (GridResp.Value != null) + { + Hashtable resp = (Hashtable) GridResp.Value; + if (resp.ContainsKey("success")) + { + if ((string)resp["success"] == "FALSE") + { + responseSuccess = false; + tryDefault = true; + } + } + } + + if (responseSuccess) + { + handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation; + if (handlerUserLoggedInAtLocation != null) + { + m_log.Info("[LOGIN]: Letting other objects know about login"); + handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, + theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X, theUser.CurrentAgent.Position.Y, theUser.CurrentAgent.Position.Z, + theUser.FirstName, theUser.SurName); + } + } + else + { + response.CreateDeadRegionResponse(); + + } + + + } + else { - m_log.Info("[LOGIN]: Letting other objects know about login"); - handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, - theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X, theUser.CurrentAgent.Position.Y, theUser.CurrentAgent.Position.Z, - theUser.FirstName, theUser.SurName); + response.CreateDeadRegionResponse(); + } + } catch (Exception e) -- cgit v1.1