aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/XMPP/Stanza.cs31
-rw-r--r--OpenSim/Framework/Communications/XMPP/XMPPParser.cs14
-rw-r--r--OpenSim/Framework/JId.cs42
-rw-r--r--OpenSim/Grid/MessagingServer/XMPPHTTPService.cs111
-rw-r--r--OpenSim/Region/Environment/Modules/FriendsModule.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs4
7 files changed, 209 insertions, 3 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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Xml;
5
6namespace 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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Xml;
5using OpenSim.Framework;
6
7
8namespace 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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace 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}
diff --git a/OpenSim/Grid/MessagingServer/XMPPHTTPService.cs b/OpenSim/Grid/MessagingServer/XMPPHTTPService.cs
new file mode 100644
index 0000000..4a66717
--- /dev/null
+++ b/OpenSim/Grid/MessagingServer/XMPPHTTPService.cs
@@ -0,0 +1,111 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.IO;
30using System.Text;
31using System.Xml;
32using System.Xml.Serialization;
33using libsecondlife;
34using OpenSim.Framework;
35using OpenSim.Framework.Console;
36using OpenSim.Framework.Servers;
37
38namespace OpenSim.Grid.MessagingServer
39{
40 public class XMPPHTTPStreamHandler : BaseStreamHandler
41 {
42 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
43
44
45 /// <summary>
46 /// Constructor.
47 /// </summary>
48 /// <param name="assetManager"></param>
49 /// <param name="assetProvider"></param>
50 public XMPPHTTPStreamHandler()
51 : base("GET", "/presence")
52 {
53 m_log.Info("[REST]: In Get Request");
54
55 }
56
57 public override byte[] Handle(string path, Stream request)
58 {
59 string param = GetParam(path);
60 byte[] result = new byte[] {};
61 try
62 {
63 string[] p = param.Split(new char[] {'/', '?', '&'}, StringSplitOptions.RemoveEmptyEntries);
64
65 if (p.Length > 0)
66 {
67 LLUUID assetID = null;
68
69 if (!LLUUID.TryParse(p[0], out assetID))
70 {
71 m_log.InfoFormat(
72 "[REST]: GET:/presence ignoring request with malformed UUID {0}", p[0]);
73 return result;
74 }
75
76 }
77 }
78 catch (Exception e)
79 {
80 m_log.Error(e.ToString());
81 }
82 return result;
83 }
84 }
85
86 public class PostXMPPStreamHandler : BaseStreamHandler
87 {
88 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
89
90 public override byte[] Handle(string path, Stream request)
91 {
92 string param = GetParam(path);
93
94 LLUUID assetId;
95 if (param.Length > 0)
96 LLUUID.TryParse(param, out assetId);
97 byte[] txBuffer = new byte[4096];
98
99 // TODO: Read POST serialize XMPP stanzas
100
101 return new byte[] {};
102 }
103
104 public PostXMPPStreamHandler()
105 : base("POST", "/presence")
106 {
107
108 }
109
110 }
111}
diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs
index a572eb5..7560c90 100644
--- a/OpenSim/Region/Environment/Modules/FriendsModule.cs
+++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs
@@ -24,7 +24,7 @@
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27using System;
28using System.Collections.Generic; 28using System.Collections.Generic;
29using libsecondlife; 29using libsecondlife;
30using Nini.Config; 30using Nini.Config;
@@ -107,6 +107,12 @@ namespace OpenSim.Region.Environment.Modules
107 { 107 {
108 m_rootAgents[avatar.UUID] = avatar.RegionHandle; 108 m_rootAgents[avatar.UUID] = avatar.RegionHandle;
109 m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); 109 m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + ".");
110 if (avatar.JID.Length > 0)
111 {
112 JId avatarID = new JId(avatar.JID);
113 // REST Post XMPP Stanzas!
114
115 }
110 // Claim User! my user! Mine mine mine! 116 // Claim User! my user! Mine mine mine!
111 } 117 }
112 } 118 }
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 774e3b4..365c884 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -77,6 +77,8 @@ namespace OpenSim.Region.Environment.Scenes
77 77
78 public bool IsRestrictedToRegion = false; 78 public bool IsRestrictedToRegion = false;
79 79
80 public string JID = string.Empty;
81
80 // Agent moves with a PID controller causing a force to be exerted. 82 // Agent moves with a PID controller causing a force to be exerted.
81 private bool m_newForce = false; 83 private bool m_newForce = false;
82 private bool m_newCoarseLocations = true; 84 private bool m_newCoarseLocations = true;
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 8529234..673818a 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -290,8 +290,8 @@ namespace OpenSim.Region.Physics.OdePlugin
290 290
291 internal void waitForSpaceUnlock(IntPtr space) 291 internal void waitForSpaceUnlock(IntPtr space)
292 { 292 {
293 if (space != (IntPtr)0) 293 //if (space != (IntPtr)0)
294 while (d.SpaceLockQuery(space)){ } // Wait and do nothing 294 //while (d.SpaceLockQuery(space)){ } // Wait and do nothing
295 } 295 }
296 296
297 /// <summary> 297 /// <summary>