In WebStatsModule.OnMakeRootAgent(), get region ID directly from SP.Scene.RegionInfo.RegionID instead of manually looking it up from the stored scene list.
parent
97d084c9f5
commit
cf2f6843c6
|
@ -319,8 +319,6 @@ namespace OpenSim.Region.UserStatistics
|
||||||
|
|
||||||
private void OnMakeRootAgent(ScenePresence agent)
|
private void OnMakeRootAgent(ScenePresence agent)
|
||||||
{
|
{
|
||||||
UUID regionUUID = GetRegionUUIDFromHandle(agent.RegionHandle);
|
|
||||||
|
|
||||||
lock (m_sessions)
|
lock (m_sessions)
|
||||||
{
|
{
|
||||||
if (!m_sessions.ContainsKey(agent.UUID))
|
if (!m_sessions.ContainsKey(agent.UUID))
|
||||||
|
@ -330,7 +328,7 @@ namespace OpenSim.Region.UserStatistics
|
||||||
UserSessionID uid = new UserSessionID();
|
UserSessionID uid = new UserSessionID();
|
||||||
uid.name_f = agent.Firstname;
|
uid.name_f = agent.Firstname;
|
||||||
uid.name_l = agent.Lastname;
|
uid.name_l = agent.Lastname;
|
||||||
uid.region_id = regionUUID;
|
uid.region_id = agent.Scene.RegionInfo.RegionID;
|
||||||
uid.session_id = agent.ControllingClient.SessionId;
|
uid.session_id = agent.ControllingClient.SessionId;
|
||||||
uid.session_data = usd;
|
uid.session_data = usd;
|
||||||
|
|
||||||
|
@ -339,7 +337,7 @@ namespace OpenSim.Region.UserStatistics
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UserSessionID uid = m_sessions[agent.UUID];
|
UserSessionID uid = m_sessions[agent.UUID];
|
||||||
uid.region_id = regionUUID;
|
uid.region_id = agent.Scene.RegionInfo.RegionID;
|
||||||
uid.session_id = agent.ControllingClient.SessionId;
|
uid.session_id = agent.ControllingClient.SessionId;
|
||||||
m_sessions[agent.UUID] = uid;
|
m_sessions[agent.UUID] = uid;
|
||||||
}
|
}
|
||||||
|
@ -395,20 +393,6 @@ namespace OpenSim.Region.UserStatistics
|
||||||
return encoding.GetString(buffer);
|
return encoding.GetString(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private UUID GetRegionUUIDFromHandle(ulong regionhandle)
|
|
||||||
{
|
|
||||||
lock (m_scenes)
|
|
||||||
{
|
|
||||||
foreach (Scene scene in m_scenes)
|
|
||||||
{
|
|
||||||
if (scene.RegionInfo.RegionHandle == regionhandle)
|
|
||||||
return scene.RegionInfo.RegionID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return UUID.Zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Callback for a viewerstats cap
|
/// Callback for a viewerstats cap
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue