aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLUserData.cs
diff options
context:
space:
mode:
authorHomer Horwitz2008-11-01 22:09:48 +0000
committerHomer Horwitz2008-11-01 22:09:48 +0000
commit38e8853e5761d09a7e8f580dd277d9b99b834696 (patch)
tree653fe4c9075a03c05a4b5782f7309afa83062e5c /OpenSim/Data/MySQL/MySQLUserData.cs
parent* minor: Remove mono compiler warning (diff)
downloadopensim-SC-38e8853e5761d09a7e8f580dd277d9b99b834696.zip
opensim-SC-38e8853e5761d09a7e8f580dd277d9b99b834696.tar.gz
opensim-SC-38e8853e5761d09a7e8f580dd277d9b99b834696.tar.bz2
opensim-SC-38e8853e5761d09a7e8f580dd277d9b99b834696.tar.xz
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.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLUserData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index e671989..c3aade0 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -365,6 +365,49 @@ namespace OpenSim.Data.MySQL
365 return Lfli; 365 return Lfli;
366 } 366 }
367 367
368 override public Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos (List<UUID> uuids)
369 {
370 MySQLSuperManager dbm = GetLockedConnection("GetFriendRegionInfos");
371 Dictionary<UUID, FriendRegionInfo> infos = new Dictionary<UUID,FriendRegionInfo>();
372
373 try
374 {
375 foreach (UUID uuid in uuids)
376 {
377 Dictionary<string, string> param = new Dictionary<string, string>();
378 param["?uuid"] = uuid.ToString();
379 IDbCommand result =
380 dbm.Manager.Query("select agentOnline,currentHandle from " + m_agentsTableName +
381 " where UUID = ?uuid", param);
382
383 IDataReader reader = result.ExecuteReader();
384 while (reader.Read())
385 {
386 FriendRegionInfo fri = new FriendRegionInfo();
387 fri.isOnline = (sbyte)reader["agentOnline"] != 0;
388 fri.regionHandle = (ulong)reader["currentHandle"];
389
390 infos[uuid] = fri;
391 }
392
393 reader.Dispose();
394 result.Dispose();
395 }
396 }
397 catch (Exception e)
398 {
399 m_log.Warn("[MYSQL]: Got exception on trying to find friends regions:", e);
400 dbm.Manager.Reconnect();
401 m_log.Error(e.ToString());
402 }
403 finally
404 {
405 dbm.Release();
406 }
407
408 return infos;
409 }
410
368 #endregion 411 #endregion
369 412
370 public override void UpdateUserCurrentRegion(UUID avatarid, UUID regionuuid, ulong regionhandle) 413 public override void UpdateUserCurrentRegion(UUID avatarid, UUID regionuuid, ulong regionhandle)