aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/OGS1
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/Region/Communications/OGS1
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/Region/Communications/OGS1')
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs26
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs30
2 files changed, 56 insertions, 0 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 309a795..2e892c2 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -86,6 +86,7 @@ namespace OpenSim.Region.Communications.OGS1
86 httpServer = httpServe; 86 httpServer = httpServe;
87 //Respond to Grid Services requests 87 //Respond to Grid Services requests
88 httpServer.AddXmlRPCHandler("expect_user", ExpectUser); 88 httpServer.AddXmlRPCHandler("expect_user", ExpectUser);
89 httpServer.AddXmlRPCHandler("logoff_user", LogOffUser);
89 httpServer.AddXmlRPCHandler("check", PingCheckReply); 90 httpServer.AddXmlRPCHandler("check", PingCheckReply);
90 91
91 StartRemoting(); 92 StartRemoting();
@@ -603,6 +604,31 @@ namespace OpenSim.Region.Communications.OGS1
603 604
604 return new XmlRpcResponse(); 605 return new XmlRpcResponse();
605 } 606 }
607 // Grid Request Processing
608 /// <summary>
609 /// Ooops, our Agent must be dead if we're getting this request!
610 /// </summary>
611 /// <param name="request"></param>
612 /// <returns></returns>
613 public XmlRpcResponse LogOffUser(XmlRpcRequest request)
614 {
615 m_log.Debug("[CONNECTION DEBUGGING]: LogOff User Called ");
616 Hashtable requestData = (Hashtable)request.Params[0];
617 string message = (string)requestData["message"];
618 LLUUID agentID = LLUUID.Zero;
619 LLUUID RegionSecret = LLUUID.Zero;
620 Helpers.TryParse((string)requestData["agent_id"], out agentID);
621 Helpers.TryParse((string)requestData["region_secret"], out RegionSecret);
622
623 ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
624
625
626 m_localBackend.TriggerLogOffUser(regionHandle, agentID, RegionSecret,message);
627
628
629
630 return new XmlRpcResponse();
631 }
606 632
607 #region m_interRegion Comms 633 #region m_interRegion Comms
608 634
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index 8807eab..e0e17df 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -196,6 +196,36 @@ namespace OpenSim.Region.Communications.OGS1
196 return GetUserProfile(firstName + " " + lastName); 196 return GetUserProfile(firstName + " " + lastName);
197 } 197 }
198 198
199 public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle)
200 {
201 Hashtable param = new Hashtable();
202 param.Add("avatar_id", avatarid.ToString());
203 param.Add("region_uuid", regionuuid.ToString());
204 param.Add("region_handle", regionhandle.ToString());
205 IList parameters = new ArrayList();
206 parameters.Add(param);
207 XmlRpcRequest req = new XmlRpcRequest("update_user_current_region", parameters);
208 XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000);
209 Hashtable respData = (Hashtable)resp.Value;
210 if (respData.ContainsKey("returnString"))
211 {
212 if ((string)respData["returnString"] == "TRUE")
213 {
214 m_log.Info("[OSG1 USER SERVICES]: Successfully updated user record");
215 }
216 else
217 {
218 m_log.Error("[OSG1 USER SERVICES]: Error updating user record");
219 }
220 }
221 else
222 {
223 m_log.Warn("[OSG1 USER SERVICES]: Error updating user record, Grid server may not be updated.");
224 }
225
226
227 }
228
199 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query) 229 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query)
200 { 230 {
201 List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>(); 231 List<AvatarPickerAvatar> pickerlist = new List<AvatarPickerAvatar>();