diff options
author | Teravus Ovares | 2008-02-26 09:16:31 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-26 09:16:31 +0000 |
commit | bf8214815272efae07b05288103cbc8216c97af0 (patch) | |
tree | 3a57e14b5c5dac897a5b57e5fb79f00b212e8d41 /OpenSim/Grid/MessagingServer/MessageService.cs | |
parent | * More Message server stuff. Still not ready. (diff) | |
download | opensim-SC-bf8214815272efae07b05288103cbc8216c97af0.zip opensim-SC-bf8214815272efae07b05288103cbc8216c97af0.tar.gz opensim-SC-bf8214815272efae07b05288103cbc8216c97af0.tar.bz2 opensim-SC-bf8214815272efae07b05288103cbc8216c97af0.tar.xz |
* Added base thread pool based presence informing to the message server.
* Not ready yet for use.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/MessagingServer/MessageService.cs | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs index d0b939b..fc16a88 100644 --- a/OpenSim/Grid/MessagingServer/MessageService.cs +++ b/OpenSim/Grid/MessagingServer/MessageService.cs | |||
@@ -30,6 +30,7 @@ using System.Net; | |||
30 | using System.Net.Sockets; | 30 | using System.Net.Sockets; |
31 | using System.Collections; | 31 | using System.Collections; |
32 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
33 | using System.Threading; | ||
33 | //using System.Xml; | 34 | //using System.Xml; |
34 | using libsecondlife; | 35 | using libsecondlife; |
35 | using Nwc.XmlRpc; | 36 | using Nwc.XmlRpc; |
@@ -59,6 +60,8 @@ namespace OpenSim.Grid.MessagingServer | |||
59 | // Hashtable containing work units that need to be processed | 60 | // Hashtable containing work units that need to be processed |
60 | private Hashtable m_unProcessedWorkUnits = new Hashtable(); | 61 | private Hashtable m_unProcessedWorkUnits = new Hashtable(); |
61 | 62 | ||
63 | |||
64 | |||
62 | public MessageService(MessageServerConfig cfg) | 65 | public MessageService(MessageServerConfig cfg) |
63 | { | 66 | { |
64 | m_cfg = cfg; | 67 | m_cfg = cfg; |
@@ -66,29 +69,7 @@ namespace OpenSim.Grid.MessagingServer | |||
66 | 69 | ||
67 | #region RegionComms Methods | 70 | #region RegionComms Methods |
68 | 71 | ||
69 | /// <summary> | 72 | |
70 | /// Informs a region about an Agent | ||
71 | /// </summary> | ||
72 | /// <param name="TalkingAbout">User to talk about</param> | ||
73 | /// <param name="UserToUpdate">User we're sending this too (contains the region)</param> | ||
74 | public void SendRegionPresenceUpdate(UserPresenceData TalkingAbout, UserPresenceData UserToUpdate) | ||
75 | { | ||
76 | // TODO: Fill in pertenant Presence Data from 'TalkingAbout' | ||
77 | |||
78 | RegionProfileData whichRegion = UserToUpdate.regionData; | ||
79 | //whichRegion.httpServerURI | ||
80 | |||
81 | Hashtable PresenceParams = new Hashtable(); | ||
82 | ArrayList SendParams = new ArrayList(); | ||
83 | SendParams.Add(PresenceParams); | ||
84 | |||
85 | m_log.Info("[PRESENCE]: Informing " + whichRegion.regionName + " at " + whichRegion.httpServerURI); | ||
86 | // Send | ||
87 | XmlRpcRequest RegionReq = new XmlRpcRequest("presence_update", SendParams); | ||
88 | XmlRpcResponse RegionResp = RegionReq.Send(whichRegion.httpServerURI, 6000); | ||
89 | } | ||
90 | |||
91 | |||
92 | #endregion | 73 | #endregion |
93 | 74 | ||
94 | #region FriendList Methods | 75 | #region FriendList Methods |
@@ -152,7 +133,13 @@ namespace OpenSim.Grid.MessagingServer | |||
152 | // we need to send out online status update, but the user is already subscribed | 133 | // we need to send out online status update, but the user is already subscribed |
153 | 134 | ||
154 | } | 135 | } |
155 | SendRegionPresenceUpdate(friendpresence, userpresence); | 136 | PresenceInformer friendlistupdater = new PresenceInformer(); |
137 | friendlistupdater.presence1 = friendpresence; | ||
138 | friendlistupdater.presence2 = userpresence; | ||
139 | WaitCallback cb = new WaitCallback(friendlistupdater.go); | ||
140 | ThreadPool.QueueUserWorkItem(cb); | ||
141 | |||
142 | //SendRegionPresenceUpdate(friendpresence, userpresence); | ||
156 | } | 143 | } |
157 | if ((uFriendListItem.FriendPerms & (uint)FriendRights.CanSeeOnline) != 0) | 144 | if ((uFriendListItem.FriendPerms & (uint)FriendRights.CanSeeOnline) != 0) |
158 | { | 145 | { |
@@ -166,7 +153,14 @@ namespace OpenSim.Grid.MessagingServer | |||
166 | // we need to send out online status update, but the user is already subscribed | 153 | // we need to send out online status update, but the user is already subscribed |
167 | 154 | ||
168 | } | 155 | } |
169 | SendRegionPresenceUpdate(userpresence, friendpresence); | 156 | PresenceInformer friendlistupdater = new PresenceInformer(); |
157 | friendlistupdater.presence1 = userpresence; | ||
158 | friendlistupdater.presence2 = friendpresence; | ||
159 | |||
160 | WaitCallback cb2 = new WaitCallback(friendlistupdater.go); | ||
161 | ThreadPool.QueueUserWorkItem(cb2); | ||
162 | |||
163 | //SendRegionPresenceUpdate(userpresence, friendpresence); | ||
170 | } | 164 | } |
171 | 165 | ||
172 | } | 166 | } |
@@ -280,7 +274,14 @@ namespace OpenSim.Grid.MessagingServer | |||
280 | m_presences[AgentsNeedingNotification[i]] = friendd; | 274 | m_presences[AgentsNeedingNotification[i]] = friendd; |
281 | 275 | ||
282 | } | 276 | } |
283 | SendRegionPresenceUpdate(AgentData, friendd); | 277 | PresenceInformer friendlistupdater = new PresenceInformer(); |
278 | friendlistupdater.presence1 = AgentData; | ||
279 | friendlistupdater.presence2 = friendd; | ||
280 | |||
281 | WaitCallback cb3 = new WaitCallback(friendlistupdater.go); | ||
282 | ThreadPool.QueueUserWorkItem(cb3); | ||
283 | |||
284 | //SendRegionPresenceUpdate(AgentData, friendd); | ||
284 | 285 | ||
285 | 286 | ||
286 | //removeBackReference(AgentID, AgentsNeedingNotification[i]); | 287 | //removeBackReference(AgentID, AgentsNeedingNotification[i]); |