aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs58
1 files changed, 53 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
index 1e5c767..68b9b43 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
@@ -26,31 +26,79 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
30using System.Collections.Specialized;
29using System.Reflection; 31using System.Reflection;
30using Nini.Config; 32using System.IO;
33using System.Web;
31using log4net; 34using log4net;
35using Mono.Addins;
36using Nini.Config;
37using OpenMetaverse;
38using OpenMetaverse.StructuredData;
32using OpenSim.Framework; 39using OpenSim.Framework;
40using OpenSim.Framework.Servers;
41using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Region.Framework.Interfaces; 42using OpenSim.Region.Framework.Interfaces;
34using OpenSim.Region.Framework.Scenes; 43using OpenSim.Region.Framework.Scenes;
35using Mono.Addins; 44using OpenSim.Services.Interfaces;
36using OpenMetaverse; 45using Caps = OpenSim.Framework.Capabilities.Caps;
37 46
38namespace OpenSim.Region.CoreModules.Media.Moap 47namespace OpenSim.Region.CoreModules.Media.Moap
39{ 48{
40 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MoapModule")] 49 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MoapModule")]
41 public class MoapModule : INonSharedRegionModule 50 public class MoapModule : INonSharedRegionModule
42 { 51 {
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53
43 public string Name { get { return "MoapModule"; } } 54 public string Name { get { return "MoapModule"; } }
44 public Type ReplaceableInterface { get { return null; } } 55 public Type ReplaceableInterface { get { return null; } }
45 56
57 protected Scene m_scene;
58
46 public void Initialise(IConfigSource config) {} 59 public void Initialise(IConfigSource config) {}
47 60
48 public void AddRegion(Scene scene) { Console.WriteLine("YEAH I'M HERE, BABY!"); } 61 public void AddRegion(Scene scene)
62 {
63 m_scene = scene;
64 }
49 65
50 public void RemoveRegion(Scene scene) {} 66 public void RemoveRegion(Scene scene) {}
51 67
52 public void RegionLoaded(Scene scene) {} 68 public void RegionLoaded(Scene scene)
69 {
70 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
71 }
53 72
54 public void Close() {} 73 public void Close() {}
74
75 public void RegisterCaps(UUID agentID, Caps caps)
76 {
77 m_log.DebugFormat(
78 "[MOAP]: Registering ObjectMedia and ObjectMediaNavigate capabilities for agent {0}", agentID);
79
80 caps.RegisterHandler(
81 "ObjectMedia", new RestStreamHandler("GET", "/CAPS/" + UUID.Random(), OnObjectMediaRequest));
82 caps.RegisterHandler(
83 "ObjectMediaNavigate", new RestStreamHandler("GET", "/CAPS/" + UUID.Random(), OnObjectMediaNavigateRequest));
84 }
85
86 protected string OnObjectMediaRequest(
87 string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
88 {
89 m_log.DebugFormat("[MOAP]: Got ObjectMedia request for {0}", path);
90 //NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
91
92 return string.Empty;
93 }
94
95 protected string OnObjectMediaNavigateRequest(
96 string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
97 {
98 m_log.DebugFormat("[MOAP]: Got ObjectMediaNavigate request for {0}", path);
99 //NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
100
101 return string.Empty;
102 }
55 } 103 }
56} \ No newline at end of file 104} \ No newline at end of file