From 03c307ecdb2c75700d838e163ea21a27aad294b2 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 22 Apr 2009 10:10:19 +0000 Subject: * Committing stub VW-over-HTTP ClientStack. (1/2) * Nonfunctional, but eventually form a AJAX-accessible client protocol - for clients written in environments which only allow HTTP (eg HTML, Silverlight, Flash, etc). Designed for super-lightweight clients. --- OpenSim/Client/VWoHTTP/VWoHTTPModule.cs | 69 +++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 OpenSim/Client/VWoHTTP/VWoHTTPModule.cs (limited to 'OpenSim/Client/VWoHTTP/VWoHTTPModule.cs') diff --git a/OpenSim/Client/VWoHTTP/VWoHTTPModule.cs b/OpenSim/Client/VWoHTTP/VWoHTTPModule.cs new file mode 100644 index 0000000..b326122 --- /dev/null +++ b/OpenSim/Client/VWoHTTP/VWoHTTPModule.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Nini.Config; +using OpenMetaverse; +using OpenSim.Client.VWoHTTP.ClientStack; +using OpenSim.Framework.Servers; +using OpenSim.Framework.Servers.Interfaces; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Client.VWoHTTP +{ + class VWoHTTPModule : IRegionModule, IHttpAgentHandler + { + + private IHttpServer m_httpd; + + private readonly List m_scenes = new List(); + + private Dictionary m_clients = new Dictionary(); + + #region Implementation of IRegionModule + + public void Initialise(Scene scene, IConfigSource source) + { + m_scenes.Add(scene); + + m_httpd = scene.CommsManager.HttpServer; + } + + public void PostInitialise() + { + m_httpd.AddAgentHandler("vwohttp", this); + } + + public void Close() + { + m_httpd.RemoveAgentHandler("vwohttp", this); + } + + public string Name + { + get { return "VWoHTTP ClientStack"; } + } + + public bool IsSharedModule + { + get { return true; } + } + + #endregion + + #region Implementation of IHttpAgentHandler + + public bool Handle(OSHttpRequest req, OSHttpResponse resp) + { + + return false; + } + + public bool Match(OSHttpRequest req, OSHttpResponse resp) + { + return req.Url.ToString().Contains("vwohttp"); + } + + #endregion + } +} -- cgit v1.1