diff options
author | Melanie Thielker | 2008-11-23 05:16:07 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-11-23 05:16:07 +0000 |
commit | cbd02218704287640ba5c7b564440a6590e038cf (patch) | |
tree | e600fd4868bce3e3d007d6d1894dd814d948692a /OpenSim/Grid/UserServer/UserManager.cs | |
parent | Mantis#2660. Thank you kindly, Ruud Lathrop for a patch that: (diff) | |
download | opensim-SC_OLD-cbd02218704287640ba5c7b564440a6590e038cf.zip opensim-SC_OLD-cbd02218704287640ba5c7b564440a6590e038cf.tar.gz opensim-SC_OLD-cbd02218704287640ba5c7b564440a6590e038cf.tar.bz2 opensim-SC_OLD-cbd02218704287640ba5c7b564440a6590e038cf.tar.xz |
Plumb in the presence notifications and region shutdown/restart messages
from the presence module to the message server, through the user server
and on into the database. This should fix the "Already logged in" issue
that grids see after a sim crashes, or a user crashes out of a sim.
Not yet a 100% solution for friends, but getting there.
Diffstat (limited to 'OpenSim/Grid/UserServer/UserManager.cs')
-rw-r--r-- | OpenSim/Grid/UserServer/UserManager.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index f7e4e3c..04510b2 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs | |||
@@ -758,5 +758,52 @@ namespace OpenSim.Grid.UserServer | |||
758 | { | 758 | { |
759 | throw new Exception("The method or operation is not implemented."); | 759 | throw new Exception("The method or operation is not implemented."); |
760 | } | 760 | } |
761 | |||
762 | public void HandleAgentLocation(UUID agentID, UUID regionID, ulong regionHandle) | ||
763 | { | ||
764 | UserProfileData userProfile = GetUserProfile(agentID); | ||
765 | if (userProfile != null) | ||
766 | { | ||
767 | userProfile.CurrentAgent.Region = regionID; | ||
768 | userProfile.CurrentAgent.Handle = regionHandle; | ||
769 | CommitAgent(ref userProfile); | ||
770 | } | ||
771 | } | ||
772 | |||
773 | public void HandleAgentLeaving(UUID agentID, UUID regionID, ulong regionHandle) | ||
774 | { | ||
775 | UserProfileData userProfile = GetUserProfile(agentID); | ||
776 | if (userProfile != null) | ||
777 | { | ||
778 | if (userProfile.CurrentAgent.Region == regionID) | ||
779 | { | ||
780 | UserAgentData userAgent = userProfile.CurrentAgent; | ||
781 | if (userAgent != null && userAgent.AgentOnline) | ||
782 | { | ||
783 | userAgent.AgentOnline = false; | ||
784 | userAgent.LogoutTime = Util.UnixTimeSinceEpoch(); | ||
785 | if (regionID != UUID.Zero) | ||
786 | { | ||
787 | userAgent.Region = regionID; | ||
788 | } | ||
789 | userAgent.Handle = regionHandle; | ||
790 | userProfile.LastLogin = userAgent.LogoutTime; | ||
791 | |||
792 | CommitAgent(ref userProfile); | ||
793 | } | ||
794 | } | ||
795 | } | ||
796 | } | ||
797 | |||
798 | public void HandleRegionStartup(UUID regionID) | ||
799 | { | ||
800 | LogoutUsers(regionID); | ||
801 | } | ||
802 | |||
803 | public void HandleRegionShutdown(UUID regionID) | ||
804 | { | ||
805 | LogoutUsers(regionID); | ||
806 | } | ||
807 | |||
761 | } | 808 | } |
762 | } | 809 | } |