From 38e8853e5761d09a7e8f580dd277d9b99b834696 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sat, 1 Nov 2008 22:09:48 +0000 Subject: 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. --- OpenSim/Data/MSSQL/MSSQLUserData.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'OpenSim/Data/MSSQL') diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index ee7765f..4d4b3bc 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs @@ -570,6 +570,39 @@ namespace OpenSim.Data.MSSQL return friendList; } + override public Dictionary GetFriendRegionInfos (List uuids) + { + Dictionary infos = new Dictionary(); + try + { + foreach (UUID uuid in uuids) + { + using (AutoClosingSqlCommand command = database.Query( + "select agentOnline,currentHandle from " + m_agentsTableName + " where UUID = @uuid")) + { + command.Parameters.Add(database.CreateParameter("@uuid", uuid)); + + using (IDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + FriendRegionInfo fri = new FriendRegionInfo(); + fri.isOnline = (sbyte)reader["agentOnline"] != 0; + fri.regionHandle = (ulong)reader["currentHandle"]; + + infos[uuid] = fri; + } + } + } + } + } + catch (Exception e) + { + m_log.Warn("[MSSQL]: Got exception on trying to find friends regions:", e); + } + + return infos; + } #endregion #region Money functions (not used) -- cgit v1.1