diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Communications/XMPP/Stanza.cs | 31 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/XMPP/XMPPParser.cs | 14 | ||||
-rw-r--r-- | OpenSim/Framework/JId.cs | 42 |
3 files changed, 87 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/XMPP/Stanza.cs b/OpenSim/Framework/Communications/XMPP/Stanza.cs new file mode 100644 index 0000000..4c57114 --- /dev/null +++ b/OpenSim/Framework/Communications/XMPP/Stanza.cs | |||
@@ -0,0 +1,31 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.Xml; | ||
5 | |||
6 | namespace OpenSim.Framework.Communications.XMPP | ||
7 | { | ||
8 | public class Stanza | ||
9 | { | ||
10 | |||
11 | public string localName = String.Empty; | ||
12 | public JId to; | ||
13 | public JId from; | ||
14 | string id; | ||
15 | string lang; | ||
16 | string nodeName; | ||
17 | |||
18 | public Stanza(XmlNode node, Object defaults, bool hasID) | ||
19 | { | ||
20 | |||
21 | } | ||
22 | //public virtual XmlElement getNode() | ||
23 | //{ | ||
24 | //return new XmlElement(); | ||
25 | //} | ||
26 | public virtual string generateId() | ||
27 | { | ||
28 | return ""; | ||
29 | } | ||
30 | } | ||
31 | } | ||
diff --git a/OpenSim/Framework/Communications/XMPP/XMPPParser.cs b/OpenSim/Framework/Communications/XMPP/XMPPParser.cs new file mode 100644 index 0000000..0539afb --- /dev/null +++ b/OpenSim/Framework/Communications/XMPP/XMPPParser.cs | |||
@@ -0,0 +1,14 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.Xml; | ||
5 | using OpenSim.Framework; | ||
6 | |||
7 | |||
8 | namespace OpenSim.Framework.Communications.XMPP | ||
9 | { | ||
10 | public class XMPPParser | ||
11 | { | ||
12 | |||
13 | } | ||
14 | } | ||
diff --git a/OpenSim/Framework/JId.cs b/OpenSim/Framework/JId.cs new file mode 100644 index 0000000..790a9e0 --- /dev/null +++ b/OpenSim/Framework/JId.cs | |||
@@ -0,0 +1,42 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Framework | ||
6 | { | ||
7 | public class JId | ||
8 | { | ||
9 | public string ServerIP = String.Empty; | ||
10 | public int ServerPort = 0; | ||
11 | public string username = String.Empty; | ||
12 | public string resource = String.Empty; | ||
13 | |||
14 | public JId() | ||
15 | { | ||
16 | |||
17 | } | ||
18 | public JId(string sJId) | ||
19 | { | ||
20 | // user@address:port/resource | ||
21 | string[] jidsplit = sJId.Split('@'); | ||
22 | if (jidsplit.GetUpperBound(0) == 2) | ||
23 | { | ||
24 | string[] serversplit = jidsplit[1].Split(':'); | ||
25 | if (serversplit.GetUpperBound(0) == 2) | ||
26 | { | ||
27 | ServerIP = serversplit[0]; | ||
28 | string[] resourcesplit = serversplit[1].Split('/'); | ||
29 | |||
30 | ServerPort = Convert.ToInt32(resourcesplit[0]); | ||
31 | |||
32 | if (resourcesplit.GetUpperBound(0) == 2) | ||
33 | resource = resourcesplit[1]; | ||
34 | |||
35 | username = jidsplit[0]; | ||
36 | |||
37 | } | ||
38 | } | ||
39 | } | ||
40 | |||
41 | } | ||
42 | } | ||