aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Client/VWoHTTP/VWoHTTPModule.cs
blob: f698c8c3bdc560456aab8985e219f8dd197b5e32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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<Scene> m_scenes = new List<Scene>();

        private Dictionary<UUID, VWHClientView> m_clients = new Dictionary<UUID, VWHClientView>();

        #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
    }
}