aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs4
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs14
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs14
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs2
-rw-r--r--OpenSim/Services/Interfaces/IGridUserService.cs26
-rw-r--r--OpenSim/Services/UserAccountService/GridUserService.cs4
6 files changed, 40 insertions, 24 deletions
diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
index 935ebb1..b3ea865 100644
--- a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
+++ b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Services.Connectors
101 101
102 } 102 }
103 103
104 public bool LoggedOut(string userID, UUID region, Vector3 position, Vector3 lookat) 104 public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat)
105 { 105 {
106 Dictionary<string, object> sendData = new Dictionary<string, object>(); 106 Dictionary<string, object> sendData = new Dictionary<string, object>();
107 //sendData["SCOPEID"] = scopeID.ToString(); 107 //sendData["SCOPEID"] = scopeID.ToString();
@@ -123,7 +123,7 @@ namespace OpenSim.Services.Connectors
123 return Set(sendData, userID, regionID, position, lookAt); 123 return Set(sendData, userID, regionID, position, lookAt);
124 } 124 }
125 125
126 public bool SetLastPosition(string userID, UUID regionID, Vector3 position, Vector3 lookAt) 126 public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt)
127 { 127 {
128 Dictionary<string, object> sendData = new Dictionary<string, object>(); 128 Dictionary<string, object> sendData = new Dictionary<string, object>();
129 //sendData["SCOPEID"] = scopeID.ToString(); 129 //sendData["SCOPEID"] = scopeID.ToString();
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs
index 67a06f3..b8703c6 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs
@@ -29,6 +29,7 @@ using System;
29using System.Reflection; 29using System.Reflection;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Region.Framework.Scenes; 31using OpenSim.Region.Framework.Scenes;
32using OpenSim.Services.Interfaces;
32using OpenMetaverse; 33using OpenMetaverse;
33using log4net; 34using log4net;
34 35
@@ -38,12 +39,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
38 { 39 {
39 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 40 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
40 41
41 private SimianPresenceServiceConnector m_GridUserService; 42 private IGridUserService m_GridUserService;
42 private Scene m_aScene;
43 43
44 public SimianActivityDetector(SimianPresenceServiceConnector guservice) 44 public SimianActivityDetector(IGridUserService guService)
45 { 45 {
46 m_GridUserService = guservice; 46 m_GridUserService = guService;
47 m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Started"); 47 m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Started");
48 } 48 }
49 49
@@ -54,9 +54,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
54 scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; 54 scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
55 scene.EventManager.OnNewClient += OnNewClient; 55 scene.EventManager.OnNewClient += OnNewClient;
56 scene.EventManager.OnAvatarEnteringNewParcel += OnEnteringNewParcel; 56 scene.EventManager.OnAvatarEnteringNewParcel += OnEnteringNewParcel;
57
58 if (m_aScene == null)
59 m_aScene = scene;
60 } 57 }
61 58
62 public void RemoveRegion(Scene scene) 59 public void RemoveRegion(Scene scene)
@@ -101,9 +98,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
101 } 98 }
102 99
103 m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); 100 m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
104 m_GridUserService.LoggedOut(client.AgentId.ToString(), client.Scene.RegionInfo.RegionID, position, lookat); 101 m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat);
105 } 102 }
106
107 } 103 }
108 104
109 void OnEnteringNewParcel(ScenePresence sp, int localLandID, UUID regionID) 105 void OnEnteringNewParcel(ScenePresence sp, int localLandID, UUID regionID)
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
index a344594..8141420 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
@@ -260,8 +260,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
260 return null; 260 return null;
261 } 261 }
262 262
263 public bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) 263 public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
264 { 264 {
265 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Logging out user " + userID);
266
267 // Remove the session to mark this user offline
268 if (!LogoutAgent(sessionID))
269 return false;
270
265 // Save our last position as user data 271 // Save our last position as user data
266 NameValueCollection requestArgs = new NameValueCollection 272 NameValueCollection requestArgs = new NameValueCollection
267 { 273 {
@@ -304,12 +310,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
304 return UpdateSession(sessionID, regionID, lastPosition, lastLookAt); 310 return UpdateSession(sessionID, regionID, lastPosition, lastLookAt);
305 } 311 }
306 312
307 public bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
308 {
309 // Never called
310 return false;
311 }
312
313 public GridUserInfo GetGridUserInfo(string user) 313 public GridUserInfo GetGridUserInfo(string user)
314 { 314 {
315 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent " + user); 315 m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent " + user);
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index 8c3be70..8acd618 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -232,7 +232,7 @@ namespace OpenSim.Services.HypergridService
232 232
233 GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(userID.ToString()); 233 GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(userID.ToString());
234 if (guinfo != null) 234 if (guinfo != null)
235 m_GridUserService.LoggedOut(userID.ToString(), guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt); 235 m_GridUserService.LoggedOut(userID.ToString(), sessionID, guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt);
236 } 236 }
237 237
238 // We need to prevent foreign users with the same UUID as a local user 238 // We need to prevent foreign users with the same UUID as a local user
diff --git a/OpenSim/Services/Interfaces/IGridUserService.cs b/OpenSim/Services/Interfaces/IGridUserService.cs
index 95ce5e8..6613ae7 100644
--- a/OpenSim/Services/Interfaces/IGridUserService.cs
+++ b/OpenSim/Services/Interfaces/IGridUserService.cs
@@ -105,11 +105,31 @@ namespace OpenSim.Services.Interfaces
105 public interface IGridUserService 105 public interface IGridUserService
106 { 106 {
107 GridUserInfo LoggedIn(string userID); 107 GridUserInfo LoggedIn(string userID);
108 bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt); 108
109 /// <summary>
110 /// Informs the grid that a user is logged out and to remove any session data for them
111 /// </summary>
112 /// <param name="userID">Ignore if your connector does not use userID for logouts</param>
113 /// <param name="sessionID">Ignore if your connector does not use sessionID for logouts</param>
114 /// <param name="regionID">RegionID where the user was last located</param>
115 /// <param name="lastPosition">Last region-relative position of the user</param>
116 /// <param name="lastLookAt">Last normalized look direction for the user</param>
117 /// <returns>True if the logout request was successfully processed, otherwise false</returns>
118 bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt);
109 119
110 bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt); 120 bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt);
111 bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt); 121
112 122 /// <summary>
123 /// Stores the last known user position at the grid level
124 /// </summary>
125 /// <param name="userID">Ignore if your connector does not use userID for position updates</param>
126 /// <param name="sessionID">Ignore if your connector does not use sessionID for position updates</param>
127 /// <param name="regionID">RegionID where the user is currently located</param>
128 /// <param name="lastPosition">Region-relative position</param>
129 /// <param name="lastLookAt">Normalized look direction</param>
130 /// <returns>True if the user's last position was successfully updated, otherwise false</returns>
131 bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt);
132
113 GridUserInfo GetGridUserInfo(string userID); 133 GridUserInfo GetGridUserInfo(string userID);
114 } 134 }
115} \ No newline at end of file 135} \ No newline at end of file
diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs
index 697ba63..9b18915 100644
--- a/OpenSim/Services/UserAccountService/GridUserService.cs
+++ b/OpenSim/Services/UserAccountService/GridUserService.cs
@@ -92,7 +92,7 @@ namespace OpenSim.Services.UserAccountService
92 return GetGridUserInfo(userID); 92 return GetGridUserInfo(userID);
93 } 93 }
94 94
95 public bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) 95 public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
96 { 96 {
97 m_log.DebugFormat("[GRID USER SERVICE]: User {0} is offline", userID); 97 m_log.DebugFormat("[GRID USER SERVICE]: User {0} is offline", userID);
98 GridUserData d = m_Database.Get(userID); 98 GridUserData d = m_Database.Get(userID);
@@ -139,7 +139,7 @@ namespace OpenSim.Services.UserAccountService
139 return m_Database.Store(d); 139 return m_Database.Store(d);
140 } 140 }
141 141
142 public bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) 142 public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
143 { 143 {
144 //m_log.DebugFormat("[Grid User Service]: SetLastPosition for {0}", userID); 144 //m_log.DebugFormat("[Grid User Service]: SetLastPosition for {0}", userID);
145 GridUserData d = m_Database.Get(userID); 145 GridUserData d = m_Database.Get(userID);