mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
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.
This commit is contained in:
@@ -758,5 +758,52 @@ namespace OpenSim.Grid.UserServer
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
public void HandleAgentLocation(UUID agentID, UUID regionID, ulong regionHandle)
|
||||
{
|
||||
UserProfileData userProfile = GetUserProfile(agentID);
|
||||
if (userProfile != null)
|
||||
{
|
||||
userProfile.CurrentAgent.Region = regionID;
|
||||
userProfile.CurrentAgent.Handle = regionHandle;
|
||||
CommitAgent(ref userProfile);
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleAgentLeaving(UUID agentID, UUID regionID, ulong regionHandle)
|
||||
{
|
||||
UserProfileData userProfile = GetUserProfile(agentID);
|
||||
if (userProfile != null)
|
||||
{
|
||||
if (userProfile.CurrentAgent.Region == regionID)
|
||||
{
|
||||
UserAgentData userAgent = userProfile.CurrentAgent;
|
||||
if (userAgent != null && userAgent.AgentOnline)
|
||||
{
|
||||
userAgent.AgentOnline = false;
|
||||
userAgent.LogoutTime = Util.UnixTimeSinceEpoch();
|
||||
if (regionID != UUID.Zero)
|
||||
{
|
||||
userAgent.Region = regionID;
|
||||
}
|
||||
userAgent.Handle = regionHandle;
|
||||
userProfile.LastLogin = userAgent.LogoutTime;
|
||||
|
||||
CommitAgent(ref userProfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleRegionStartup(UUID regionID)
|
||||
{
|
||||
LogoutUsers(regionID);
|
||||
}
|
||||
|
||||
public void HandleRegionShutdown(UUID regionID)
|
||||
{
|
||||
LogoutUsers(regionID);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user