diff options
author | Homer Horwitz | 2008-11-01 22:09:48 +0000 |
---|---|---|
committer | Homer Horwitz | 2008-11-01 22:09:48 +0000 |
commit | 38e8853e5761d09a7e8f580dd277d9b99b834696 (patch) | |
tree | 653fe4c9075a03c05a4b5782f7309afa83062e5c /OpenSim/Framework/Communications | |
parent | * minor: Remove mono compiler warning (diff) | |
download | opensim-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/Framework/Communications')
4 files changed, 119 insertions, 1 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index dfe0fdc..bb4a853 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -50,6 +50,12 @@ namespace OpenSim.Framework.Communications | |||
50 | } | 50 | } |
51 | protected IUserService m_userService; | 51 | protected IUserService m_userService; |
52 | 52 | ||
53 | public IMessagingService MessageService | ||
54 | { | ||
55 | get { return m_messageService; } | ||
56 | } | ||
57 | protected IMessagingService m_messageService; | ||
58 | |||
53 | public IGridServices GridService | 59 | public IGridServices GridService |
54 | { | 60 | { |
55 | get { return m_gridService; } | 61 | get { return m_gridService; } |
@@ -370,6 +376,21 @@ namespace OpenSim.Framework.Communications | |||
370 | return m_userService.GetUserFriendList(friendlistowner); | 376 | return m_userService.GetUserFriendList(friendlistowner); |
371 | } | 377 | } |
372 | 378 | ||
379 | public Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos(List<UUID> uuids) | ||
380 | { | ||
381 | return m_messageService.GetFriendRegionInfos(uuids); | ||
382 | } | ||
383 | |||
384 | public List<UUID> InformFriendsInOtherRegion(UUID agentId, ulong destRegionHandle, List<UUID> friends, bool online) | ||
385 | { | ||
386 | return m_interRegion.InformFriendsInOtherRegion(agentId, destRegionHandle, friends, online); | ||
387 | } | ||
388 | |||
389 | public bool TriggerTerminateFriend(ulong regionHandle, UUID agentID, UUID exFriendID) | ||
390 | { | ||
391 | return m_interRegion.TriggerTerminateFriend(regionHandle, agentID, exFriendID); | ||
392 | } | ||
393 | |||
373 | #endregion | 394 | #endregion |
374 | 395 | ||
375 | #region Packet Handlers | 396 | #region Packet Handlers |
diff --git a/OpenSim/Framework/Communications/IInterRegionCommunications.cs b/OpenSim/Framework/Communications/IInterRegionCommunications.cs index 3dd5561..6b589b9 100644 --- a/OpenSim/Framework/Communications/IInterRegionCommunications.cs +++ b/OpenSim/Framework/Communications/IInterRegionCommunications.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Collections.Generic; | ||
28 | using OpenMetaverse; | 29 | using OpenMetaverse; |
29 | 30 | ||
30 | namespace OpenSim.Framework.Communications | 31 | namespace OpenSim.Framework.Communications |
@@ -46,5 +47,42 @@ namespace OpenSim.Framework.Communications | |||
46 | bool AcknowledgePrimCrossed(ulong regionHandle, UUID primID); | 47 | bool AcknowledgePrimCrossed(ulong regionHandle, UUID primID); |
47 | 48 | ||
48 | bool TellRegionToCloseChildConnection(ulong regionHandle, UUID agentID); | 49 | bool TellRegionToCloseChildConnection(ulong regionHandle, UUID agentID); |
50 | |||
51 | /// <summary> | ||
52 | /// Try to inform friends in the given region about online status of agent. | ||
53 | /// </summary> | ||
54 | /// <param name="agentId"> | ||
55 | /// The <see cref="UUID"/> of the agent. | ||
56 | /// </param> | ||
57 | /// <param name="destRegionHandle"> | ||
58 | /// The regionHandle of the region. | ||
59 | /// </param> | ||
60 | /// <param name="friends"> | ||
61 | /// A List of <see cref="UUID"/>s of friends to inform in the given region. | ||
62 | /// </param> | ||
63 | /// <param name="online"> | ||
64 | /// Is the agent online or offline | ||
65 | /// </param> | ||
66 | /// <returns> | ||
67 | /// A list of friends that couldn't be reached on this region. | ||
68 | /// </returns> | ||
69 | List<UUID> InformFriendsInOtherRegion(UUID agentId, ulong destRegionHandle, List<UUID> friends, bool online); | ||
70 | |||
71 | /// <summary> | ||
72 | /// Send TerminateFriend of exFriendID to agent agentID in region regionHandle. | ||
73 | /// </summary> | ||
74 | /// <param name="regionHandle"> | ||
75 | /// The handle of the region agentID is in (hopefully). | ||
76 | /// </param> | ||
77 | /// <param name="agentID"> | ||
78 | /// The agent to send the packet to. | ||
79 | /// </param> | ||
80 | /// <param name="exFriendID"> | ||
81 | /// The ex-friends ID. | ||
82 | /// </param> | ||
83 | /// <returns> | ||
84 | /// Whether the packet could be sent. False if the agent couldn't be found in the region. | ||
85 | /// </returns> | ||
86 | bool TriggerTerminateFriend(ulong regionHandle, UUID agentID, UUID exFriendID); | ||
49 | } | 87 | } |
50 | } | 88 | } |
diff --git a/OpenSim/Framework/Communications/IMessagingService.cs b/OpenSim/Framework/Communications/IMessagingService.cs new file mode 100644 index 0000000..5d4cbf8 --- /dev/null +++ b/OpenSim/Framework/Communications/IMessagingService.cs | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System.Collections.Generic; | ||
29 | using OpenMetaverse; | ||
30 | |||
31 | namespace OpenSim.Framework.Communications | ||
32 | { | ||
33 | public interface IMessagingService | ||
34 | { | ||
35 | Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos (List<UUID> uuids); | ||
36 | } | ||
37 | } | ||
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index ba9cf27..7189eee 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -35,6 +35,7 @@ using OpenMetaverse; | |||
35 | using OpenMetaverse.StructuredData; | 35 | using OpenMetaverse.StructuredData; |
36 | using log4net; | 36 | using log4net; |
37 | using Nwc.XmlRpc; | 37 | using Nwc.XmlRpc; |
38 | using OpenSim.Framework; | ||
38 | using OpenSim.Framework.Statistics; | 39 | using OpenSim.Framework.Statistics; |
39 | 40 | ||
40 | namespace OpenSim.Framework.Communications | 41 | namespace OpenSim.Framework.Communications |
@@ -42,7 +43,7 @@ namespace OpenSim.Framework.Communications | |||
42 | /// <summary> | 43 | /// <summary> |
43 | /// Base class for user management (create, read, etc) | 44 | /// Base class for user management (create, read, etc) |
44 | /// </summary> | 45 | /// </summary> |
45 | public abstract class UserManagerBase : IUserService, IUserServiceAdmin, IAvatarService | 46 | public abstract class UserManagerBase : IUserService, IUserServiceAdmin, IAvatarService, IMessagingService |
46 | { | 47 | { |
47 | private static readonly ILog m_log | 48 | private static readonly ILog m_log |
48 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -285,6 +286,27 @@ namespace OpenSim.Framework.Communications | |||
285 | return null; | 286 | return null; |
286 | } | 287 | } |
287 | 288 | ||
289 | public Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos (List<UUID> uuids) | ||
290 | { | ||
291 | foreach (IUserDataPlugin plugin in _plugins) | ||
292 | { | ||
293 | try | ||
294 | { | ||
295 | Dictionary<UUID, FriendRegionInfo> result = plugin.GetFriendRegionInfos(uuids); | ||
296 | |||
297 | if (result != null) | ||
298 | { | ||
299 | return result; | ||
300 | } | ||
301 | } | ||
302 | catch (Exception e) | ||
303 | { | ||
304 | m_log.Info("[USERSTORAGE]: Unable to GetFriendRegionInfos via " + plugin.Name + "(" + e.ToString() + ")"); | ||
305 | } | ||
306 | } | ||
307 | return null; | ||
308 | } | ||
309 | |||
288 | public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) | 310 | public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) |
289 | { | 311 | { |
290 | foreach (IUserDataPlugin plugin in _plugins) | 312 | foreach (IUserDataPlugin plugin in _plugins) |