mirror of
https://github.com/opensim/opensim.git
synced 2026-06-30 02:57:02 +08:00
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.
This commit is contained in:
@@ -795,5 +795,41 @@ namespace OpenSim.Data.MySQL
|
||||
deleteOneFolder(folderID);
|
||||
deleteItemsInFolder(folderID);
|
||||
}
|
||||
|
||||
public List<InventoryItemBase> fetchActiveGestures(UUID avatarID)
|
||||
{
|
||||
MySqlDataReader result = null;
|
||||
MySqlCommand sqlCmd = null;
|
||||
lock (database)
|
||||
{
|
||||
try
|
||||
{
|
||||
database.CheckConnection();
|
||||
sqlCmd = new MySqlCommand(
|
||||
"SELECT * FROM inventoryitems WHERE avatarId = ?uuid AND assetType = ?type and flags = 1",
|
||||
database.Connection);
|
||||
sqlCmd.Parameters.AddWithValue("?uuid", avatarID.ToString());
|
||||
sqlCmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture);
|
||||
result = sqlCmd.ExecuteReader();
|
||||
|
||||
List<InventoryItemBase> list = new List<InventoryItemBase>();
|
||||
while (result.Read())
|
||||
list.Add(readInventoryItem(result));
|
||||
|
||||
return list;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
database.Reconnect();
|
||||
m_log.Error(e.ToString());
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(result != null) result.Close();
|
||||
if(sqlCmd != null) sqlCmd.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user