diff options
author | Justin Clark-Casey (justincc) | 2012-10-06 04:03:53 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-10-06 04:04:50 +0100 |
commit | 9de991301cfcb66721a5593dd9098fe84e090dec (patch) | |
tree | cc55e6910f074f14ee607bbd1766b320c0086d2a /OpenSim/Region/UserStatistics/WebStatsModule.cs | |
parent | On receiving TaskInventoryAccepted with a destination folder in the binary bu... (diff) | |
download | opensim-SC_OLD-9de991301cfcb66721a5593dd9098fe84e090dec.zip opensim-SC_OLD-9de991301cfcb66721a5593dd9098fe84e090dec.tar.gz opensim-SC_OLD-9de991301cfcb66721a5593dd9098fe84e090dec.tar.bz2 opensim-SC_OLD-9de991301cfcb66721a5593dd9098fe84e090dec.tar.xz |
Make UserSessionID a class rather than a struct, so that later updates to value suceed (rather than having to pull the data out and reinsert back into the Dictionary).
Fixes http://opensimulator.org/mantis/view.php?id=6338
Diffstat (limited to 'OpenSim/Region/UserStatistics/WebStatsModule.cs')
-rw-r--r-- | OpenSim/Region/UserStatistics/WebStatsModule.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs index c11ea02..b1795db 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs | |||
@@ -319,6 +319,10 @@ namespace OpenSim.Region.UserStatistics | |||
319 | 319 | ||
320 | private void OnMakeRootAgent(ScenePresence agent) | 320 | private void OnMakeRootAgent(ScenePresence agent) |
321 | { | 321 | { |
322 | // m_log.DebugFormat( | ||
323 | // "[WEB STATS MODULE]: Looking for session {0} for {1} in {2}", | ||
324 | // agent.ControllingClient.SessionId, agent.Name, agent.Scene.Name); | ||
325 | |||
322 | lock (m_sessions) | 326 | lock (m_sessions) |
323 | { | 327 | { |
324 | UserSessionID uid; | 328 | UserSessionID uid; |
@@ -427,7 +431,10 @@ namespace OpenSim.Region.UserStatistics | |||
427 | m_log.WarnFormat("[WEB STATS MODULE]: no session for stat disclosure for agent {0}", agentID); | 431 | m_log.WarnFormat("[WEB STATS MODULE]: no session for stat disclosure for agent {0}", agentID); |
428 | return new UserSessionID(); | 432 | return new UserSessionID(); |
429 | } | 433 | } |
434 | |||
430 | uid = m_sessions[agentID]; | 435 | uid = m_sessions[agentID]; |
436 | |||
437 | // m_log.DebugFormat("[WEB STATS MODULE]: Got session {0} for {1}", uid.session_id, agentID); | ||
431 | } | 438 | } |
432 | else | 439 | else |
433 | { | 440 | { |
@@ -499,6 +506,7 @@ namespace OpenSim.Region.UserStatistics | |||
499 | usd.d_texture_kb = (float)downloads_map["texture_kbytes"].AsReal(); | 506 | usd.d_texture_kb = (float)downloads_map["texture_kbytes"].AsReal(); |
500 | usd.d_world_kb = (float)downloads_map["workd_kbytes"].AsReal(); | 507 | usd.d_world_kb = (float)downloads_map["workd_kbytes"].AsReal(); |
501 | 508 | ||
509 | // m_log.DebugFormat("[WEB STATS MODULE]: mmap[\"session_id\"] = [{0}]", mmap["session_id"].AsUUID()); | ||
502 | 510 | ||
503 | usd.session_id = mmap["session_id"].AsUUID(); | 511 | usd.session_id = mmap["session_id"].AsUUID(); |
504 | 512 | ||
@@ -549,11 +557,18 @@ namespace OpenSim.Region.UserStatistics | |||
549 | 557 | ||
550 | uid.session_data = usd; | 558 | uid.session_data = usd; |
551 | m_sessions[agentID] = uid; | 559 | m_sessions[agentID] = uid; |
560 | |||
561 | // m_log.DebugFormat( | ||
562 | // "[WEB STATS MODULE]: Parse data for {0} {1}, session {2}", uid.name_f, uid.name_l, uid.session_id); | ||
563 | |||
552 | return uid; | 564 | return uid; |
553 | } | 565 | } |
554 | 566 | ||
555 | private void UpdateUserStats(UserSessionID uid, SqliteConnection db) | 567 | private void UpdateUserStats(UserSessionID uid, SqliteConnection db) |
556 | { | 568 | { |
569 | // m_log.DebugFormat( | ||
570 | // "[WEB STATS MODULE]: Updating user stats for {0} {1}, session {2}", uid.name_f, uid.name_l, uid.session_id); | ||
571 | |||
557 | if (uid.session_id == UUID.Zero) | 572 | if (uid.session_id == UUID.Zero) |
558 | return; | 573 | return; |
559 | 574 | ||
@@ -740,7 +755,6 @@ VALUES | |||
740 | s.min_ping = ArrayMin_f(__ping); | 755 | s.min_ping = ArrayMin_f(__ping); |
741 | s.max_ping = ArrayMax_f(__ping); | 756 | s.max_ping = ArrayMax_f(__ping); |
742 | s.mode_ping = ArrayMode_f(__ping); | 757 | s.mode_ping = ArrayMode_f(__ping); |
743 | |||
744 | } | 758 | } |
745 | 759 | ||
746 | #region Statistics | 760 | #region Statistics |
@@ -985,7 +999,7 @@ VALUES | |||
985 | } | 999 | } |
986 | #region structs | 1000 | #region structs |
987 | 1001 | ||
988 | public struct UserSessionID | 1002 | public class UserSessionID |
989 | { | 1003 | { |
990 | public UUID session_id; | 1004 | public UUID session_id; |
991 | public UUID region_id; | 1005 | public UUID region_id; |