aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid
diff options
context:
space:
mode:
authorHomer Horwitz2008-09-24 21:12:21 +0000
committerHomer Horwitz2008-09-24 21:12:21 +0000
commitfe9aea258ff4142e718b4916ccefeeedef229768 (patch)
treef60c40697833392b35788fbc5cd97a5014bb29b7 /OpenSim/Grid
parentlight the mysql region tests (diff)
downloadopensim-SC_OLD-fe9aea258ff4142e718b4916ccefeeedef229768.zip
opensim-SC_OLD-fe9aea258ff4142e718b4916ccefeeedef229768.tar.gz
opensim-SC_OLD-fe9aea258ff4142e718b4916ccefeeedef229768.tar.bz2
opensim-SC_OLD-fe9aea258ff4142e718b4916ccefeeedef229768.tar.xz
Add persistence of active gestures. This needs an UGAIM update to work.
Active gestures are sent as part of the login-response. Added fetchActiveGestures to SQLite and MySQL; added an empty one for MSSQL and NHibernate. Using the empty ones won't cause errors, but doesn't provide persistence either, of course.
Diffstat (limited to 'OpenSim/Grid')
-rw-r--r--OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs16
-rw-r--r--OpenSim/Grid/InventoryServer/GridInventoryService.cs9
-rw-r--r--OpenSim/Grid/InventoryServer/Main.cs5
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs34
4 files changed, 62 insertions, 2 deletions
diff --git a/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs b/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs
index 5de5bb3..ee76d74 100644
--- a/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs
+++ b/OpenSim/Grid/Communications/OGS1/OGS1InterServiceInventoryService.cs
@@ -67,5 +67,21 @@ namespace OpenSim.Grid.Communications.OGS1
67 return SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( 67 return SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>(
68 "POST", m_inventoryServerUrl + "RootFolders/", userId.Guid); 68 "POST", m_inventoryServerUrl + "RootFolders/", userId.Guid);
69 } 69 }
70
71 /// <summary>
72 /// Returns a list of all the active gestures in a user's inventory.
73 /// </summary>
74 /// <param name="userId">
75 /// The <see cref="UUID"/> of the user
76 /// </param>
77 /// <returns>
78 /// A flat list of the gesture items.
79 /// </returns>
80 public List<InventoryItemBase> GetActiveGestures(UUID userId)
81 {
82 return SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryItemBase>>(
83 "POST", m_inventoryServerUrl + "ActiveGestures/", userId.Guid);
84 }
85
70 } 86 }
71} 87}
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
index 4d58775..6f7672e 100644
--- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs
+++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
@@ -233,5 +233,14 @@ namespace OpenSim.Grid.InventoryServer
233 233
234 return CreateNewUserInventory(userID); 234 return CreateNewUserInventory(userID);
235 } 235 }
236
237 public List<InventoryItemBase> GetActiveGestures(Guid rawUserID)
238 {
239 UUID userID = new UUID(rawUserID);
240
241 m_log.InfoFormat("[GRID AGENT INVENTORY]: fetching active gestures for user {0}", userID);
242
243 return GetActiveGestures(userID);
244 }
236 } 245 }
237} 246}
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs
index 9f40d16..3b990e7 100644
--- a/OpenSim/Grid/InventoryServer/Main.cs
+++ b/OpenSim/Grid/InventoryServer/Main.cs
@@ -123,6 +123,11 @@ namespace OpenSim.Grid.InventoryServer
123 m_httpServer.AddStreamHandler( 123 m_httpServer.AddStreamHandler(
124 new RestDeserialiseTrustedHandler<Guid, List<InventoryFolderBase>> 124 new RestDeserialiseTrustedHandler<Guid, List<InventoryFolderBase>>
125 ("POST", "/RootFolders/", m_inventoryService.GetInventorySkeleton, m_inventoryService.CheckTrustSource)); 125 ("POST", "/RootFolders/", m_inventoryService.GetInventorySkeleton, m_inventoryService.CheckTrustSource));
126
127 // for persistent active gestures
128 m_httpServer.AddStreamHandler(
129 new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>>
130 ("POST", "/ActiveGestures/", m_inventoryService.GetActiveGestures, m_inventoryService.CheckTrustSource));
126 } 131 }
127 132
128 private void Work() 133 private void Work()
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 8ab9af1..573e546 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -131,6 +131,9 @@ namespace OpenSim.Grid.UserServer
131 /// <param name="startLocationRequest">The requested start location</param> 131 /// <param name="startLocationRequest">The requested start location</param>
132 public override bool CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest) 132 public override bool CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest)
133 { 133 {
134 // add active gestures to login-response
135 AddActiveGestures(response, theUser);
136
134 // HomeLocation 137 // HomeLocation
135 RegionProfileData homeInfo = null; 138 RegionProfileData homeInfo = null;
136 // use the homeRegionID if it is stored already. If not, use the regionHandle as before 139 // use the homeRegionID if it is stored already. If not, use the regionHandle as before
@@ -243,10 +246,37 @@ namespace OpenSim.Grid.UserServer
243 // theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z); 246 // theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z);
244 theUser.CurrentAgent.Position = new Vector3(128,128,0); 247 theUser.CurrentAgent.Position = new Vector3(128,128,0);
245 response.StartLocation = "safe"; 248 response.StartLocation = "safe";
246 249
247 return PrepareLoginToRegion(regionInfo, theUser, response); 250 return PrepareLoginToRegion(regionInfo, theUser, response);
248 } 251 }
249 252
253 /// <summary>
254 /// Add active gestures of the user to the login response.
255 /// </summary>
256 /// <param name="response">
257 /// A <see cref="LoginResponse"/>
258 /// </param>
259 /// <param name="theUser">
260 /// A <see cref="UserProfileData"/>
261 /// </param>
262 private void AddActiveGestures(LoginResponse response, UserProfileData theUser)
263 {
264 List<InventoryItemBase> gestures = m_inventoryService.GetActiveGestures(theUser.ID);
265 m_log.DebugFormat("[LOGIN]: AddActiveGestures, found {0}", gestures == null ? 0 : gestures.Count);
266 ArrayList list = new ArrayList();
267 if (gestures != null)
268 {
269 foreach (InventoryItemBase gesture in gestures)
270 {
271 Hashtable item = new Hashtable();
272 item["item_id"] = gesture.ID.ToString();
273 item["asset_id"] = gesture.AssetID.ToString();
274 list.Add(item);
275 }
276 }
277 response.ActiveGestures = list;
278 }
279
250 /// <summary> 280 /// <summary>
251 /// Prepare a login to the given region. This involves both telling the region to expect a connection 281 /// Prepare a login to the given region. This involves both telling the region to expect a connection
252 /// and appropriately customising the response to the user. 282 /// and appropriately customising the response to the user.