diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/MessagingServer/PresenceInformer.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/OpenSim/Grid/MessagingServer/PresenceInformer.cs b/OpenSim/Grid/MessagingServer/PresenceInformer.cs new file mode 100644 index 0000000..877d104 --- /dev/null +++ b/OpenSim/Grid/MessagingServer/PresenceInformer.cs | |||
@@ -0,0 +1,59 @@ | |||
1 | using System; | ||
2 | using System.Collections; | ||
3 | using System.Collections.Generic; | ||
4 | using System.Net; | ||
5 | using System.Net.Sockets; | ||
6 | using System.Text; | ||
7 | using libsecondlife; | ||
8 | using Nwc.XmlRpc; | ||
9 | using OpenSim.Framework; | ||
10 | using OpenSim.Framework.Console; | ||
11 | using OpenSim.Framework.Data; | ||
12 | using OpenSim.Framework.Servers; | ||
13 | |||
14 | namespace OpenSim.Grid.MessagingServer | ||
15 | { | ||
16 | public class PresenceInformer | ||
17 | { | ||
18 | public UserPresenceData presence1 = null; | ||
19 | public UserPresenceData presence2 = null; | ||
20 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
21 | |||
22 | public PresenceInformer() | ||
23 | { | ||
24 | |||
25 | } | ||
26 | public void go(object o) | ||
27 | { | ||
28 | if (presence1 != null && presence2 != null) | ||
29 | { | ||
30 | SendRegionPresenceUpdate(presence1, presence2); | ||
31 | } | ||
32 | |||
33 | } | ||
34 | |||
35 | /// <summary> | ||
36 | /// Informs a region about an Agent | ||
37 | /// </summary> | ||
38 | /// <param name="TalkingAbout">User to talk about</param> | ||
39 | /// <param name="UserToUpdate">User we're sending this too (contains the region)</param> | ||
40 | public void SendRegionPresenceUpdate(UserPresenceData TalkingAbout, UserPresenceData UserToUpdate) | ||
41 | { | ||
42 | // TODO: Fill in pertenant Presence Data from 'TalkingAbout' | ||
43 | |||
44 | RegionProfileData whichRegion = UserToUpdate.regionData; | ||
45 | //whichRegion.httpServerURI | ||
46 | |||
47 | Hashtable PresenceParams = new Hashtable(); | ||
48 | ArrayList SendParams = new ArrayList(); | ||
49 | SendParams.Add(PresenceParams); | ||
50 | |||
51 | m_log.Info("[PRESENCE]: Informing " + whichRegion.regionName + " at " + whichRegion.httpServerURI); | ||
52 | // Send | ||
53 | XmlRpcRequest RegionReq = new XmlRpcRequest("presence_update", SendParams); | ||
54 | XmlRpcResponse RegionResp = RegionReq.Send(whichRegion.httpServerURI, 6000); | ||
55 | } | ||
56 | |||
57 | |||
58 | } | ||
59 | } | ||