diff options
Diffstat (limited to '')
5 files changed, 68 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index a1d8d5a..a5c4584 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -106,7 +106,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
106 | return m_ExportedAppearances; | 106 | return m_ExportedAppearances; |
107 | } | 107 | } |
108 | } | 108 | } |
109 | |||
110 | 109 | ||
111 | #region ISharedRegionModule | 110 | #region ISharedRegionModule |
112 | 111 | ||
@@ -149,9 +148,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
149 | base.AddRegion(scene); | 148 | base.AddRegion(scene); |
150 | 149 | ||
151 | if (m_Enabled) | 150 | if (m_Enabled) |
151 | { | ||
152 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); | 152 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); |
153 | 153 | scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject; | |
154 | scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject; | 154 | } |
155 | } | 155 | } |
156 | 156 | ||
157 | void OnIncomingSceneObject(SceneObjectGroup so) | 157 | void OnIncomingSceneObject(SceneObjectGroup so) |
@@ -245,6 +245,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
245 | { | 245 | { |
246 | // Log them out of this grid | 246 | // Log them out of this grid |
247 | Scene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId); | 247 | Scene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId); |
248 | string userId = Scene.UserManagementModule.GetUserUUI(sp.UUID); | ||
249 | Scene.GridUserService.LoggedOut(userId, UUID.Zero, Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); | ||
248 | } | 250 | } |
249 | } | 251 | } |
250 | 252 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs index 4eecaa2..acefc97 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs | |||
@@ -137,6 +137,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
137 | ud.FirstName = words[0]; | 137 | ud.FirstName = words[0]; |
138 | ud.LastName = "@" + words[1]; | 138 | ud.LastName = "@" + words[1]; |
139 | users.Add(ud); | 139 | users.Add(ud); |
140 | // WARNING! that uriStr is not quite right... it may be missing the / at the end, | ||
141 | // which will cause trouble (duplicate entries on some tables). We should | ||
142 | // get the UUI instead from the UAS. TO BE FIXED. | ||
140 | AddUser(userID, names[0], names[1], uriStr); | 143 | AddUser(userID, names[0], names[1], uriStr); |
141 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0}@{1} found", words[0], words[1]); | 144 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0}@{1} found", words[0], words[1]); |
142 | } | 145 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index f4ed67b..36c84c7 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -429,8 +429,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
429 | 429 | ||
430 | public void AddUser(UUID uuid, string first, string last, string homeURL) | 430 | public void AddUser(UUID uuid, string first, string last, string homeURL) |
431 | { | 431 | { |
432 | // m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, first {1}, last {2}, url {3}", uuid, first, last, homeURL); | 432 | //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, first {1}, last {2}, url {3}", uuid, first, last, homeURL); |
433 | |||
434 | AddUser(uuid, homeURL + ";" + first + " " + last); | 433 | AddUser(uuid, homeURL + ";" + first + " " + last); |
435 | } | 434 | } |
436 | 435 | ||
@@ -553,8 +552,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
553 | MainConsole.Instance.Output("-----------------------------------------------------------------------------"); | 552 | MainConsole.Instance.Output("-----------------------------------------------------------------------------"); |
554 | foreach (KeyValuePair<UUID, UserData> kvp in m_UserCache) | 553 | foreach (KeyValuePair<UUID, UserData> kvp in m_UserCache) |
555 | { | 554 | { |
556 | MainConsole.Instance.Output(String.Format("{0} {1} {2}", | 555 | MainConsole.Instance.Output(String.Format("{0} {1} {2} ({3})", |
557 | kvp.Key, kvp.Value.FirstName, kvp.Value.LastName)); | 556 | kvp.Key, kvp.Value.FirstName, kvp.Value.LastName, kvp.Value.HomeURL)); |
558 | } | 557 | } |
559 | 558 | ||
560 | return; | 559 | return; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index b0edce7..221f815 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs | |||
@@ -65,11 +65,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
65 | 65 | ||
66 | public void OnMakeRootAgent(ScenePresence sp) | 66 | public void OnMakeRootAgent(ScenePresence sp) |
67 | { | 67 | { |
68 | // m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); | ||
69 | |||
70 | if (sp.PresenceType != PresenceType.Npc) | 68 | if (sp.PresenceType != PresenceType.Npc) |
69 | { | ||
70 | string userid = sp.Scene.UserManagementModule.GetUserUUI(sp.UUID); | ||
71 | //m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", userid, sp.Scene.RegionInfo.RegionName); | ||
71 | m_GridUserService.SetLastPosition( | 72 | m_GridUserService.SetLastPosition( |
72 | sp.UUID.ToString(), UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); | 73 | userid, UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); |
74 | } | ||
73 | } | 75 | } |
74 | 76 | ||
75 | public void OnNewClient(IClientAPI client) | 77 | public void OnNewClient(IClientAPI client) |
@@ -82,9 +84,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
82 | if (client.SceneAgent.IsChildAgent) | 84 | if (client.SceneAgent.IsChildAgent) |
83 | return; | 85 | return; |
84 | 86 | ||
85 | // m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); | 87 | string userId = client.AgentId.ToString(); |
88 | if (client.Scene is Scene) | ||
89 | { | ||
90 | Scene s = (Scene)client.Scene; | ||
91 | userId = s.UserManagementModule.GetUserUUI(client.AgentId); | ||
92 | } | ||
93 | //m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", userId, client.Scene.RegionInfo.RegionName); | ||
94 | |||
86 | m_GridUserService.LoggedOut( | 95 | m_GridUserService.LoggedOut( |
87 | client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, | 96 | userId, client.SessionId, client.Scene.RegionInfo.RegionID, |
88 | client.SceneAgent.AbsolutePosition, client.SceneAgent.Lookat); | 97 | client.SceneAgent.AbsolutePosition, client.SceneAgent.Lookat); |
89 | } | 98 | } |
90 | } | 99 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs index badb552..04acf67 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs | |||
@@ -44,6 +44,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | private const int KEEPTIME = 30; // 30 secs | ||
48 | private ExpiringCache<string, GridUserInfo> m_Infos = new ExpiringCache<string, GridUserInfo>(); | ||
49 | |||
47 | #region ISharedRegionModule | 50 | #region ISharedRegionModule |
48 | 51 | ||
49 | private bool m_Enabled = false; | 52 | private bool m_Enabled = false; |
@@ -128,23 +131,60 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
128 | 131 | ||
129 | public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat) | 132 | public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat) |
130 | { | 133 | { |
134 | if (m_Infos.Contains(userID)) | ||
135 | m_Infos.Remove(userID); | ||
136 | |||
131 | return m_RemoteConnector.LoggedOut(userID, sessionID, region, position, lookat); | 137 | return m_RemoteConnector.LoggedOut(userID, sessionID, region, position, lookat); |
132 | } | 138 | } |
133 | 139 | ||
134 | 140 | ||
135 | public bool SetHome(string userID, UUID regionID, Vector3 position, Vector3 lookAt) | 141 | public bool SetHome(string userID, UUID regionID, Vector3 position, Vector3 lookAt) |
136 | { | 142 | { |
137 | return m_RemoteConnector.SetHome(userID, regionID, position, lookAt); | 143 | if (m_RemoteConnector.SetHome(userID, regionID, position, lookAt)) |
144 | { | ||
145 | // Update the cache too | ||
146 | GridUserInfo info = null; | ||
147 | if (m_Infos.TryGetValue(userID, out info)) | ||
148 | { | ||
149 | info.HomeRegionID = regionID; | ||
150 | info.HomePosition = position; | ||
151 | info.HomeLookAt = lookAt; | ||
152 | } | ||
153 | return true; | ||
154 | } | ||
155 | |||
156 | return false; | ||
138 | } | 157 | } |
139 | 158 | ||
140 | public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) | 159 | public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) |
141 | { | 160 | { |
142 | return m_RemoteConnector.SetLastPosition(userID, sessionID, regionID, position, lookAt); | 161 | if (m_RemoteConnector.SetLastPosition(userID, sessionID, regionID, position, lookAt)) |
162 | { | ||
163 | // Update the cache too | ||
164 | GridUserInfo info = null; | ||
165 | if (m_Infos.TryGetValue(userID, out info)) | ||
166 | { | ||
167 | info.LastRegionID = regionID; | ||
168 | info.LastPosition = position; | ||
169 | info.LastLookAt = lookAt; | ||
170 | } | ||
171 | return true; | ||
172 | } | ||
173 | |||
174 | return false; | ||
143 | } | 175 | } |
144 | 176 | ||
145 | public GridUserInfo GetGridUserInfo(string userID) | 177 | public GridUserInfo GetGridUserInfo(string userID) |
146 | { | 178 | { |
147 | return m_RemoteConnector.GetGridUserInfo(userID); | 179 | GridUserInfo info = null; |
180 | if (m_Infos.TryGetValue(userID, out info)) | ||
181 | return info; | ||
182 | |||
183 | info = m_RemoteConnector.GetGridUserInfo(userID); | ||
184 | |||
185 | m_Infos.AddOrUpdate(userID, info, KEEPTIME); | ||
186 | |||
187 | return info; | ||
148 | } | 188 | } |
149 | 189 | ||
150 | public GridUserInfo[] GetGridUserInfo(string[] userID) | 190 | public GridUserInfo[] GetGridUserInfo(string[] userID) |