diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index 5bdf32c..e4ed9fa 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs | |||
@@ -124,6 +124,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
124 | if (!m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) | 124 | if (!m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) |
125 | m_scenes[scene.RegionInfo.RegionHandle] = scene; | 125 | m_scenes[scene.RegionInfo.RegionHandle] = scene; |
126 | } | 126 | } |
127 | |||
127 | scene.EventManager.OnNewClient += OnNewClient; | 128 | scene.EventManager.OnNewClient += OnNewClient; |
128 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; | 129 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; |
129 | scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; | 130 | scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; |
@@ -157,6 +158,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
157 | 158 | ||
158 | #endregion | 159 | #endregion |
159 | 160 | ||
161 | /// <summary> | ||
162 | /// Receive presence information changes about clients in other regions. | ||
163 | /// </summary> | ||
164 | /// <param name="req"></param> | ||
165 | /// <returns></returns> | ||
160 | public XmlRpcResponse processPresenceUpdateBulk(XmlRpcRequest req) | 166 | public XmlRpcResponse processPresenceUpdateBulk(XmlRpcRequest req) |
161 | { | 167 | { |
162 | Hashtable requestData = (Hashtable)req.Params[0]; | 168 | Hashtable requestData = (Hashtable)req.Params[0]; |
@@ -171,6 +177,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
171 | lock (m_rootAgents) | 177 | lock (m_rootAgents) |
172 | { | 178 | { |
173 | List<ScenePresence> friendsHere = new List<ScenePresence>(); | 179 | List<ScenePresence> friendsHere = new List<ScenePresence>(); |
180 | |||
174 | try | 181 | try |
175 | { | 182 | { |
176 | UUID agentID = new UUID((string)requestData["agentID"]); | 183 | UUID agentID = new UUID((string)requestData["agentID"]); |
@@ -728,6 +735,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
728 | if (destAgent != null) destAgent.ControllingClient.SendDeclineCallingCard(transactionID); | 735 | if (destAgent != null) destAgent.ControllingClient.SendDeclineCallingCard(transactionID); |
729 | } | 736 | } |
730 | 737 | ||
738 | /// <summary> | ||
739 | /// Send presence information about a client to other clients in both this region and others. | ||
740 | /// </summary> | ||
741 | /// <param name="client"></param> | ||
742 | /// <param name="friendList"></param> | ||
743 | /// <param name="iAmOnline"></param> | ||
731 | private void SendPresenceState(IClientAPI client, List<FriendListItem> friendList, bool iAmOnline) | 744 | private void SendPresenceState(IClientAPI client, List<FriendListItem> friendList, bool iAmOnline) |
732 | { | 745 | { |
733 | m_log.DebugFormat("[FRIEND]: {0} logged {1}; sending presence updates", client.Name, iAmOnline ? "in" : "out"); | 746 | m_log.DebugFormat("[FRIEND]: {0} logged {1}; sending presence updates", client.Name, iAmOnline ? "in" : "out"); |
@@ -756,8 +769,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
756 | } | 769 | } |
757 | } | 770 | } |
758 | 771 | ||
759 | |||
760 | |||
761 | // we now have a list of "interesting" friends (which we have to find out on-/offline state for), | 772 | // we now have a list of "interesting" friends (which we have to find out on-/offline state for), |
762 | // friends we want to send our online state to (if *they* are online, too), and | 773 | // friends we want to send our online state to (if *they* are online, too), and |
763 | // friends we want to receive online state for (currently unknown whether online or not) | 774 | // friends we want to receive online state for (currently unknown whether online or not) |
@@ -799,8 +810,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends | |||
799 | friendIDsToReceiveFromOnline.Add(uuid); | 810 | friendIDsToReceiveFromOnline.Add(uuid); |
800 | } | 811 | } |
801 | } | 812 | } |
813 | |||
802 | m_log.DebugFormat("[FRIEND]: Sending {0} offline and {1} online friends to {2}", | 814 | m_log.DebugFormat("[FRIEND]: Sending {0} offline and {1} online friends to {2}", |
803 | friendIDsToReceiveFromOffline.Count, friendIDsToReceiveFromOnline.Count, client.Name); | 815 | friendIDsToReceiveFromOffline.Count, friendIDsToReceiveFromOnline.Count, client.Name); |
816 | |||
804 | if (friendIDsToReceiveFromOffline.Count > 0) client.SendAgentOffline(friendIDsToReceiveFromOffline.ToArray()); | 817 | if (friendIDsToReceiveFromOffline.Count > 0) client.SendAgentOffline(friendIDsToReceiveFromOffline.ToArray()); |
805 | if (friendIDsToReceiveFromOnline.Count > 0) client.SendAgentOnline(friendIDsToReceiveFromOnline.ToArray()); | 818 | if (friendIDsToReceiveFromOnline.Count > 0) client.SendAgentOnline(friendIDsToReceiveFromOnline.ToArray()); |
806 | 819 | ||