mirror of
https://github.com/opensim/opensim.git
synced 2026-05-15 03:15:41 +08:00
Megapatch that fixes/adds: friend offer/deny/accept, friendship termination,
on-/offline updates, calling cards for friends. This adds methods in the DB layer and changes the MessagingServer, so a full update (incl. UGAIM) is necessary to get it working. Older regions shouldn't break, nor should older UGAIM break newer regions, but friends/presence will only work with all concerned parts (UGAIM, source region and destination region) at this revision (or later). I added the DB code for MSSQL, too, but couldn't test that. BEWARE: May contain bugs.
This commit is contained in:
@@ -365,6 +365,49 @@ namespace OpenSim.Data.MySQL
|
||||
return Lfli;
|
||||
}
|
||||
|
||||
override public Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos (List<UUID> uuids)
|
||||
{
|
||||
MySQLSuperManager dbm = GetLockedConnection("GetFriendRegionInfos");
|
||||
Dictionary<UUID, FriendRegionInfo> infos = new Dictionary<UUID,FriendRegionInfo>();
|
||||
|
||||
try
|
||||
{
|
||||
foreach (UUID uuid in uuids)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["?uuid"] = uuid.ToString();
|
||||
IDbCommand result =
|
||||
dbm.Manager.Query("select agentOnline,currentHandle from " + m_agentsTableName +
|
||||
" where UUID = ?uuid", param);
|
||||
|
||||
IDataReader reader = result.ExecuteReader();
|
||||
while (reader.Read())
|
||||
{
|
||||
FriendRegionInfo fri = new FriendRegionInfo();
|
||||
fri.isOnline = (sbyte)reader["agentOnline"] != 0;
|
||||
fri.regionHandle = (ulong)reader["currentHandle"];
|
||||
|
||||
infos[uuid] = fri;
|
||||
}
|
||||
|
||||
reader.Dispose();
|
||||
result.Dispose();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Warn("[MYSQL]: Got exception on trying to find friends regions:", e);
|
||||
dbm.Manager.Reconnect();
|
||||
m_log.Error(e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
dbm.Release();
|
||||
}
|
||||
|
||||
return infos;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public override void UpdateUserCurrentRegion(UUID avatarid, UUID regionuuid, ulong regionhandle)
|
||||
|
||||
Reference in New Issue
Block a user