diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | 58 |
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 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
30 | using System.Collections.Specialized; | ||
29 | using System.Reflection; | 31 | using System.Reflection; |
30 | using Nini.Config; | 32 | using System.IO; |
33 | using System.Web; | ||
31 | using log4net; | 34 | using log4net; |
35 | using Mono.Addins; | ||
36 | using Nini.Config; | ||
37 | using OpenMetaverse; | ||
38 | using OpenMetaverse.StructuredData; | ||
32 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Servers; | ||
41 | using OpenSim.Framework.Servers.HttpServer; | ||
33 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
35 | using Mono.Addins; | 44 | using OpenSim.Services.Interfaces; |
36 | using OpenMetaverse; | 45 | using Caps = OpenSim.Framework.Capabilities.Caps; |
37 | 46 | ||
38 | namespace OpenSim.Region.CoreModules.Media.Moap | 47 | namespace 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 |