aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/UserLoginService.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-31 12:18:29 +0000
committerTeravus Ovares2008-05-31 12:18:29 +0000
commitfebe78d06249cd4d36a86e97610dd45ab518a757 (patch)
tree7b9733fc14045f09e874440b923cfe443b781b6a /OpenSim/Grid/UserServer/UserLoginService.cs
parentMantis#1425. Thank you kindly, Melanie for a patch that: (diff)
downloadopensim-SC_OLD-febe78d06249cd4d36a86e97610dd45ab518a757.zip
opensim-SC_OLD-febe78d06249cd4d36a86e97610dd45ab518a757.tar.gz
opensim-SC_OLD-febe78d06249cd4d36a86e97610dd45ab518a757.tar.bz2
opensim-SC_OLD-febe78d06249cd4d36a86e97610dd45ab518a757.tar.xz
* Implements UserServer logoff in a few situations
* User tries to log-in but is already logged in. Userserver will send message to simulator user was in to log the user out there. * From the UserServer, admin types 'logoff-user firstname lastname message'. * Some regions may not get the message because they're not updated yet.
Diffstat (limited to 'OpenSim/Grid/UserServer/UserLoginService.cs')
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs59
1 files changed, 59 insertions, 0 deletions
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 628c471..d538d36 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -60,6 +60,65 @@ namespace OpenSim.Grid.UserServer
60 { 60 {
61 m_config = config; 61 m_config = config;
62 } 62 }
63 public override void LogOffUser(UserProfileData theUser, string message)
64 {
65 RegionProfileData SimInfo = null;
66 try
67 {
68 SimInfo = RegionProfileData.RequestSimProfileData(
69 theUser.CurrentAgent.Handle, m_config.GridServerURL,
70 m_config.GridSendKey, m_config.GridRecvKey);
71 if (SimInfo == null)
72 {
73 m_log.Error("[GRID]: Region user was in isn't currently logged in");
74 return;
75 }
76
77 }
78 catch (Exception)
79 {
80 m_log.Error("[GRID]: Unable to look up region to log user off");
81 return;
82 }
83 // Prepare notification
84 Hashtable SimParams = new Hashtable();
85 SimParams["agent_id"] = theUser.ID.ToString();
86 SimParams["region_secret"] = theUser.CurrentAgent.SecureSessionID.ToString();
87 //SimParams["region_secret"] = SimInfo.regionSecret;
88 //m_log.Info(SimInfo.regionSecret);
89 SimParams["regionhandle"] = theUser.CurrentAgent.Handle.ToString();
90 SimParams["message"] = message;
91 ArrayList SendParams = new ArrayList();
92 SendParams.Add(SimParams);
93
94 // Update agent with target sim
95
96 m_log.InfoFormat(
97 "[ASSUMED CRASH]: Telling region {0} @ {1},{2} ({3}) that their agent is dead: {4}",
98 SimInfo.regionName, SimInfo.regionLocX, SimInfo.regionLocY, SimInfo.httpServerURI, theUser.FirstName + " " + theUser.SurName);
99 try
100 {
101 XmlRpcRequest GridReq = new XmlRpcRequest("logoff_user", SendParams);
102 XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000);
103
104 if (GridResp.IsFault)
105 {
106 m_log.ErrorFormat(
107 "[LOGIN]: XMLRPC request for {0} failed, fault code: {1}, reason: {2}, This is likely an old region revision.",
108 SimInfo.httpServerURI, GridResp.FaultCode, GridResp.FaultString);
109 }
110 }
111 catch (Exception)
112 {
113 m_log.Error("[LOGIN]: Error telling region to logout user!");
114 }
115
116 //base.LogOffUser(theUser);
117 }
118 //public override void LogOffUser(UserProfileData theUser)
119 //{
120
121 //}
63 122
64 /// <summary> 123 /// <summary>
65 /// Customises the login response and fills in missing values. 124 /// Customises the login response and fills in missing values.