aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Grid/MessagingServer/MessageService.cs81
-rw-r--r--OpenSim/Grid/MessagingServer/UserPresenceData.cs5
2 files changed, 64 insertions, 22 deletions
diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs
index 22d149f..31d33b8 100644
--- a/OpenSim/Grid/MessagingServer/MessageService.cs
+++ b/OpenSim/Grid/MessagingServer/MessageService.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Grid.MessagingServer
93 up.agentData = agentData; 93 up.agentData = agentData;
94 List<FriendListItem> flData = GetUserFriendList(agentData.AgentID); 94 List<FriendListItem> flData = GetUserFriendList(agentData.AgentID);
95 up.friendData = flData; 95 up.friendData = flData;
96 RegionInfo riData = GetRegionInfo(regionHandle); 96 RegionProfileData riData = GetRegionInfo(regionHandle);
97 up.regionData = riData; 97 up.regionData = riData;
98 98
99 ProcessFriendListSubscriptions(up); 99 ProcessFriendListSubscriptions(up);
@@ -101,6 +101,19 @@ namespace OpenSim.Grid.MessagingServer
101 101
102 return new XmlRpcResponse(); 102 return new XmlRpcResponse();
103 } 103 }
104
105 #region RegionComms Methods
106
107 public void SendRegionPresenceUpdate(UserPresenceData AgentData)
108 {
109 RegionProfileData whichRegion = AgentData.regionData;
110 //whichRegion.httpServerURI
111
112 }
113
114
115 #endregion
116
104 #region FriendList Methods 117 #region FriendList Methods
105 118
106 #region FriendListProcessing 119 #region FriendListProcessing
@@ -110,9 +123,14 @@ namespace OpenSim.Grid.MessagingServer
110 List<FriendListItem> uFriendList = userpresence.friendData; 123 List<FriendListItem> uFriendList = userpresence.friendData;
111 for (int i = 0; i < uFriendList.Count; i++) 124 for (int i = 0; i < uFriendList.Count; i++)
112 { 125 {
126 m_presence_BackReferences.Add(userpresence.agentData.AgentID, uFriendList[i].Friend);
127 m_presence_BackReferences.Add(uFriendList[i].Friend, userpresence.agentData.AgentID);
128
113 if (m_presences.Contains(uFriendList[i].Friend)) 129 if (m_presences.Contains(uFriendList[i].Friend))
114 { 130 {
115 UserPresenceData friendup = (UserPresenceData)m_presences[uFriendList[i]]; 131 UserPresenceData friendup = (UserPresenceData)m_presences[uFriendList[i]];
132 // Add backreference
133
116 SubscribeToPresenceUpdates(userpresence, friendup, uFriendList[i],i); 134 SubscribeToPresenceUpdates(userpresence, friendup, uFriendList[i],i);
117 } 135 }
118 } 136 }
@@ -127,15 +145,34 @@ namespace OpenSim.Grid.MessagingServer
127 if ((uFriendListItem.FriendListOwnerPerms & (uint)FriendRights.CanSeeOnline) != 0) 145 if ((uFriendListItem.FriendListOwnerPerms & (uint)FriendRights.CanSeeOnline) != 0)
128 { 146 {
129 // Subscribe and Send Out updates 147 // Subscribe and Send Out updates
130 // Add backreference 148 if (!friendpresence.subscriptionData.Contains(friendpresence.agentData.AgentID))
131 m_presence_BackReferences.Add(userpresence.agentData.AgentID, friendpresence.agentData.AgentID); 149 {
150 userpresence.subscriptionData.Add(friendpresence.agentData.AgentID);
151 //Send Region Notice....
152 }
153 else
154 {
155 // we need to send out online status update, but the user is already subscribed
156
157 }
132 } 158 }
133 159 if ((uFriendListItem.FriendPerms & (uint)FriendRights.CanSeeOnline) != 0)
134 160 {
161 if (!friendpresence.subscriptionData.Contains(userpresence.agentData.AgentID))
162 {
163 friendpresence.subscriptionData.Add(userpresence.agentData.AgentID);
164 //Send Region Notice....
165 }
166 else
167 {
168 // we need to send out online status update, but the user is already subscribed
135 169
170 }
171 }
136 172
137 } 173 }
138 174
175
139 /// <summary> 176 /// <summary>
140 /// Adds a backreference so presence specific data doesn't have to be 177 /// Adds a backreference so presence specific data doesn't have to be
141 /// enumerated for each logged in user every time someone logs on or off. 178 /// enumerated for each logged in user every time someone logs on or off.
@@ -256,12 +293,12 @@ namespace OpenSim.Grid.MessagingServer
256 /// </summary> 293 /// </summary>
257 /// <param name="regionhandle">handle to the XY of the region we're looking for</param> 294 /// <param name="regionhandle">handle to the XY of the region we're looking for</param>
258 /// <returns>A RegionInfo object to stick in the presence info</returns> 295 /// <returns>A RegionInfo object to stick in the presence info</returns>
259 public RegionInfo GetRegionInfo(ulong regionhandle) 296 public RegionProfileData GetRegionInfo(ulong regionhandle)
260 { 297 {
261 RegionInfo regionInfo = null; 298 RegionProfileData regionInfo = null;
262 if (m_regionInfoCache.Contains(regionhandle)) 299 if (m_regionInfoCache.Contains(regionhandle))
263 { 300 {
264 regionInfo = (RegionInfo)m_regionInfoCache[regionhandle]; 301 regionInfo = (RegionProfileData)m_regionInfoCache[regionhandle];
265 } 302 }
266 else 303 else
267 { 304 {
@@ -269,8 +306,8 @@ namespace OpenSim.Grid.MessagingServer
269 } 306 }
270 return regionInfo; 307 return regionInfo;
271 } 308 }
272 public RegionInfo RequestRegionInfo(ulong regionHandle) 309 public RegionProfileData RequestRegionInfo(ulong regionHandle)
273 { RegionInfo regionInfo = null; 310 { RegionProfileData regionProfile = null;
274 try 311 try
275 { 312 {
276 313
@@ -295,18 +332,20 @@ namespace OpenSim.Grid.MessagingServer
295 string internalIpStr = (string)responseData["sim_ip"]; 332 string internalIpStr = (string)responseData["sim_ip"];
296 uint port = Convert.ToUInt32(responseData["sim_port"]); 333 uint port = Convert.ToUInt32(responseData["sim_port"]);
297 string externalUri = (string)responseData["sim_uri"]; 334 string externalUri = (string)responseData["sim_uri"];
298
299 IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int)port);
300 string neighbourExternalUri = externalUri; 335 string neighbourExternalUri = externalUri;
301 regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr);
302 336
303 regionInfo.RemotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); 337 regionProfile = new RegionProfileData();
304 regionInfo.RemotingAddress = internalIpStr; 338 regionProfile.httpPort = (uint)Convert.ToInt32((string)responseData["http_port"]);
305 339 regionProfile.httpServerURI = "http://" + internalIpStr + ":" + regionProfile.httpPort + "/";
306 regionInfo.RegionID = new LLUUID((string)responseData["region_UUID"]); 340 regionProfile.regionHandle = Helpers.UIntsToLong((regX * 256), (regY * 256));
307 regionInfo.RegionName = (string)responseData["region_name"]; 341 regionProfile.regionLocX = regX;
308 342 regionProfile.regionLocY = regY;
309 m_regionInfoCache.Add(regionHandle, regionInfo); 343
344 regionProfile.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]);
345 regionProfile.UUID = new LLUUID((string)responseData["region_UUID"]);
346 regionProfile.regionName = (string)responseData["region_name"];
347
348 m_regionInfoCache.Add(regionHandle, regionProfile);
310 } 349 }
311 catch (WebException) 350 catch (WebException)
312 { 351 {
@@ -317,7 +356,7 @@ namespace OpenSim.Grid.MessagingServer
317 } 356 }
318 357
319 358
320 return regionInfo; 359 return regionProfile;
321 } 360 }
322 #endregion 361 #endregion
323 } 362 }
diff --git a/OpenSim/Grid/MessagingServer/UserPresenceData.cs b/OpenSim/Grid/MessagingServer/UserPresenceData.cs
index 1391460..fdc5d10 100644
--- a/OpenSim/Grid/MessagingServer/UserPresenceData.cs
+++ b/OpenSim/Grid/MessagingServer/UserPresenceData.cs
@@ -30,13 +30,16 @@ using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using libsecondlife; 31using libsecondlife;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.Data;
34
33 35
34namespace OpenSim.Grid.MessagingServer 36namespace OpenSim.Grid.MessagingServer
35{ 37{
36 public class UserPresenceData 38 public class UserPresenceData
37 { 39 {
38 public AgentCircuitData agentData = new AgentCircuitData(); 40 public AgentCircuitData agentData = new AgentCircuitData();
39 public RegionInfo regionData = new RegionInfo(); 41 public RegionProfileData regionData = new RegionProfileData();
42 public string httpURI = "";
40 public List<FriendListItem> friendData = new List<FriendListItem> (); 43 public List<FriendListItem> friendData = new List<FriendListItem> ();
41 public List<LLUUID> subscriptionData = new List<LLUUID>(); 44 public List<LLUUID> subscriptionData = new List<LLUUID>();
42 45