aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
authorTeravus Ovares2008-01-20 23:08:50 +0000
committerTeravus Ovares2008-01-20 23:08:50 +0000
commita3851b3812aae6221714b1e61656d0853fce7124 (patch)
tree8867b4d6c433b0230f276f88a95625695fb71390 /OpenSim/Framework/Communications
parentGraceful failure of teleport to unavailable regions might actually work now. (diff)
downloadopensim-SC-a3851b3812aae6221714b1e61656d0853fce7124.zip
opensim-SC-a3851b3812aae6221714b1e61656d0853fce7124.tar.gz
opensim-SC-a3851b3812aae6221714b1e61656d0853fce7124.tar.bz2
opensim-SC-a3851b3812aae6221714b1e61656d0853fce7124.tar.xz
* Added hooks for logout to all IUserService and all that implement it.
* Added a Logout message with a name on the console * Added a *fixme* message to figure out why the current agent session is null * After updating you may notice that there's a login <user> and also a logout<user>
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs13
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs37
2 files changed, 50 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index a07b165..baf24f0 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -163,6 +163,19 @@ namespace OpenSim.Framework.Communications
163 { 163 {
164 m_userService.AddNewUserFriend(friendlistowner, friend, perms); 164 m_userService.AddNewUserFriend(friendlistowner, friend, perms);
165 } 165 }
166 /// <summary>
167 /// Logs off a user and does the appropriate communications
168 /// </summary>
169 /// <param name="userid"></param>
170 /// <param name="regionid"></param>
171 /// <param name="regionhandle"></param>
172 /// <param name="posx"></param>
173 /// <param name="posy"></param>
174 /// <param name="posz"></param>
175 public void LogOffUser(LLUUID userid, LLUUID regionid, ulong regionhandle, float posx, float posy, float posz)
176 {
177 m_userService.LogOffUser(userid, regionid, regionhandle, posx, posy, posz);
178 }
166 179
167 /// <summary> 180 /// <summary>
168 /// Delete friend on friendlistowner's friendlist. 181 /// Delete friend on friendlistowner's friendlist.
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 4216553..8821776 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -411,7 +411,44 @@ namespace OpenSim.Framework.UserManagement
411 411
412 profile.currentAgent = agent; 412 profile.currentAgent = agent;
413 } 413 }
414 public void LogOffUser(LLUUID userid, LLUUID regionid, ulong regionhandle, float posx, float posy, float posz)
415 {
416 UserProfileData userProfile;
417 UserAgentData userAgent;
418 LLVector3 currentPos = new LLVector3(posx, posy, posz);
419
420 userProfile = GetUserProfile(userid);
421
422 if (userProfile != null)
423 {
424
425 userAgent = userProfile.currentAgent;
426 if (userAgent != null)
427 {
428 userAgent.agentOnline = false;
429 userAgent.logoutTime = Util.UnixTimeSinceEpoch();
430 userAgent.sessionID = LLUUID.Zero;
431 userAgent.currentRegion = regionid;
432 userAgent.currentHandle = regionhandle;
433
434 userAgent.currentPos = currentPos;
435
436 userProfile.currentAgent = userAgent;
437
414 438
439 CommitAgent(ref userProfile);
440 }
441 else
442 {
443 MainLog.Instance.Verbose("LOGOUT", "didn't save logout position, currentAgent is null *do Fix ");
444 }
445 MainLog.Instance.Verbose("LOGOUT", userProfile.username + " " + userProfile.surname);
446 }
447 else
448 {
449 MainLog.Instance.Warn("LOGOUT", "Unknown User logged out");
450 }
451 }
415 public void CreateAgent(UserProfileData profile, LLSD request) 452 public void CreateAgent(UserProfileData profile, LLSD request)
416 { 453 {
417 UserAgentData agent = new UserAgentData(); 454 UserAgentData agent = new UserAgentData();