From c1667d39a610488e80e9d7c939ee7b449f02410d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 16 Jul 2012 23:15:02 +0100 Subject: refactor: factor out common code in WebStatsModule.OnMakeRootAgent() --- OpenSim/Region/UserStatistics/WebStatsModule.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs index ed424ab..c11ea02 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs @@ -321,26 +321,25 @@ namespace OpenSim.Region.UserStatistics { lock (m_sessions) { + UserSessionID uid; + if (!m_sessions.ContainsKey(agent.UUID)) { UserSessionData usd = UserSessionUtil.newUserSessionData(); - - UserSessionID uid = new UserSessionID(); + uid = new UserSessionID(); uid.name_f = agent.Firstname; uid.name_l = agent.Lastname; - uid.region_id = agent.Scene.RegionInfo.RegionID; - uid.session_id = agent.ControllingClient.SessionId; uid.session_data = usd; m_sessions.Add(agent.UUID, uid); } else { - UserSessionID uid = m_sessions[agent.UUID]; - uid.region_id = agent.Scene.RegionInfo.RegionID; - uid.session_id = agent.ControllingClient.SessionId; - m_sessions[agent.UUID] = uid; + uid = m_sessions[agent.UUID]; } + + uid.region_id = agent.Scene.RegionInfo.RegionID; + uid.session_id = agent.ControllingClient.SessionId; } } -- cgit v1.1