aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Client/Sirikata/SirikataModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Client/Sirikata/SirikataModule.cs')
-rw-r--r--OpenSim/Client/Sirikata/SirikataModule.cs37
1 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Client/Sirikata/SirikataModule.cs b/OpenSim/Client/Sirikata/SirikataModule.cs
index d2d7ff8..cbb6c23 100644
--- a/OpenSim/Client/Sirikata/SirikataModule.cs
+++ b/OpenSim/Client/Sirikata/SirikataModule.cs
@@ -60,8 +60,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60 60
61using System; 61using System;
62using System.Collections.Generic; 62using System.Collections.Generic;
63using System.Net;
64using System.Net.Sockets;
63using Nini.Config; 65using Nini.Config;
64using OpenMetaverse; 66using OpenMetaverse;
67using OpenSim.Client.Sirikata.ClientStack;
65using OpenSim.Framework; 68using OpenSim.Framework;
66using OpenSim.Framework.Servers; 69using OpenSim.Framework.Servers;
67using OpenSim.Framework.Servers.HttpServer; 70using OpenSim.Framework.Servers.HttpServer;
@@ -72,18 +75,50 @@ namespace OpenSim.Client.Sirikata
72{ 75{
73 class SirikataModule : IRegionModule 76 class SirikataModule : IRegionModule
74 { 77 {
78 private bool m_enabled = false;
79
80 private TcpListener m_listener;
81 private bool m_running = true;
82
83 private List<Scene> m_scenes = new List<Scene>();
84 private Dictionary<UUID,SirikataClientView> m_clients = new Dictionary<UUID, SirikataClientView>();
85
75 #region Implementation of IRegionModule 86 #region Implementation of IRegionModule
76 87
77 public void Initialise(Scene scene, IConfigSource source) 88 public void Initialise(Scene scene, IConfigSource source)
78 { 89 {
79 90 lock (m_scenes)
91 m_scenes.Add(scene);
80 } 92 }
81 93
82 public void PostInitialise() 94 public void PostInitialise()
83 { 95 {
96 if(!m_enabled)
97 return;
98
99 m_listener = new TcpListener(IPAddress.Any, 5943);
84 100
85 } 101 }
86 102
103 private void ListenLoop()
104 {
105 while(m_running)
106 {
107 m_listener.BeginAcceptTcpClient(AcceptSocket, m_listener);
108 }
109 }
110
111 private void AcceptSocket(IAsyncResult ar)
112 {
113 TcpListener listener = (TcpListener) ar.AsyncState;
114 TcpClient client = listener.EndAcceptTcpClient(ar);
115
116 SirikataClientView clientView = new SirikataClientView(client);
117
118 lock (m_clients)
119 m_clients.Add(clientView.SessionId, clientView);
120 }
121
87 public void Close() 122 public void Close()
88 { 123 {
89 124