aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/MessagingServer/PresenceInformer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/MessagingServer/PresenceInformer.cs')
-rw-r--r--OpenSim/Grid/MessagingServer/PresenceInformer.cs59
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 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Net;
5using System.Net.Sockets;
6using System.Text;
7using libsecondlife;
8using Nwc.XmlRpc;
9using OpenSim.Framework;
10using OpenSim.Framework.Console;
11using OpenSim.Framework.Data;
12using OpenSim.Framework.Servers;
13
14namespace 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}