aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-16 23:09:48 +0100
committerJustin Clark-Casey (justincc)2012-07-16 23:09:48 +0100
commit217f47b0d5b2382a93f3947e0840056a3ba1abfd (patch)
tree1d2bac08711495f23e4d4731cdb62e1c2619a43a /OpenSim
parentStop warning about no session from ViewerStats if user teleports to another r... (diff)
downloadopensim-SC_OLD-217f47b0d5b2382a93f3947e0840056a3ba1abfd.zip
opensim-SC_OLD-217f47b0d5b2382a93f3947e0840056a3ba1abfd.tar.gz
opensim-SC_OLD-217f47b0d5b2382a93f3947e0840056a3ba1abfd.tar.bz2
opensim-SC_OLD-217f47b0d5b2382a93f3947e0840056a3ba1abfd.tar.xz
In WebStatsModule.OnMakeRootAgent(), get region ID directly from SP.Scene.RegionInfo.RegionID instead of manually looking it up from the stored scene list.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs20
1 files changed, 2 insertions, 18 deletions
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index d1a7217..ed424ab 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -319,8 +319,6 @@ namespace OpenSim.Region.UserStatistics
319 319
320 private void OnMakeRootAgent(ScenePresence agent) 320 private void OnMakeRootAgent(ScenePresence agent)
321 { 321 {
322 UUID regionUUID = GetRegionUUIDFromHandle(agent.RegionHandle);
323
324 lock (m_sessions) 322 lock (m_sessions)
325 { 323 {
326 if (!m_sessions.ContainsKey(agent.UUID)) 324 if (!m_sessions.ContainsKey(agent.UUID))
@@ -330,7 +328,7 @@ namespace OpenSim.Region.UserStatistics
330 UserSessionID uid = new UserSessionID(); 328 UserSessionID uid = new UserSessionID();
331 uid.name_f = agent.Firstname; 329 uid.name_f = agent.Firstname;
332 uid.name_l = agent.Lastname; 330 uid.name_l = agent.Lastname;
333 uid.region_id = regionUUID; 331 uid.region_id = agent.Scene.RegionInfo.RegionID;
334 uid.session_id = agent.ControllingClient.SessionId; 332 uid.session_id = agent.ControllingClient.SessionId;
335 uid.session_data = usd; 333 uid.session_data = usd;
336 334
@@ -339,7 +337,7 @@ namespace OpenSim.Region.UserStatistics
339 else 337 else
340 { 338 {
341 UserSessionID uid = m_sessions[agent.UUID]; 339 UserSessionID uid = m_sessions[agent.UUID];
342 uid.region_id = regionUUID; 340 uid.region_id = agent.Scene.RegionInfo.RegionID;
343 uid.session_id = agent.ControllingClient.SessionId; 341 uid.session_id = agent.ControllingClient.SessionId;
344 m_sessions[agent.UUID] = uid; 342 m_sessions[agent.UUID] = uid;
345 } 343 }
@@ -395,20 +393,6 @@ namespace OpenSim.Region.UserStatistics
395 return encoding.GetString(buffer); 393 return encoding.GetString(buffer);
396 } 394 }
397 395
398 private UUID GetRegionUUIDFromHandle(ulong regionhandle)
399 {
400 lock (m_scenes)
401 {
402 foreach (Scene scene in m_scenes)
403 {
404 if (scene.RegionInfo.RegionHandle == regionhandle)
405 return scene.RegionInfo.RegionID;
406 }
407 }
408
409 return UUID.Zero;
410 }
411
412 /// <summary> 396 /// <summary>
413 /// Callback for a viewerstats cap 397 /// Callback for a viewerstats cap
414 /// </summary> 398 /// </summary>