aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Client/MXP/MXPModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Client/MXP/MXPModule.cs')
-rw-r--r--OpenSim/Client/MXP/MXPModule.cs52
1 files changed, 26 insertions, 26 deletions
diff --git a/OpenSim/Client/MXP/MXPModule.cs b/OpenSim/Client/MXP/MXPModule.cs
index 581239f..e0891ca 100644
--- a/OpenSim/Client/MXP/MXPModule.cs
+++ b/OpenSim/Client/MXP/MXPModule.cs
@@ -40,65 +40,64 @@ namespace OpenSim.Client.MXP
40{ 40{
41 public class MXPModule : IRegionModule 41 public class MXPModule : IRegionModule
42 { 42 {
43 private int mxp_Port = 1253;
44 //private double mxp_BubbleRadius = 181.01933598375616624661615669884; // Radius of a sphere big enough to encapsulate a 256x256 square
45 43
46 private readonly Timer ticker = new Timer(100); 44 private int m_port = 1253;
45 //private int m_ticks = 0;
46 private bool m_shutdown = false;
47 47
48 private int ticks; 48 private IConfigSource m_config;
49 private bool shutdown = false; 49 private readonly Timer m_ticker = new Timer(100);
50 50 private readonly Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
51 private IConfigSource config;
52
53 private readonly Dictionary<UUID,Scene> m_scenes = new Dictionary<UUID, Scene>();
54
55 private MXPPacketServer server;
56 51
52 private MXPPacketServer m_server;
57 53
58 public void Initialise(Scene scene, IConfigSource source) 54 public void Initialise(Scene scene, IConfigSource source)
59 { 55 {
60 if (!m_scenes.ContainsKey(scene.RegionInfo.RegionID)) 56 if (!m_scenes.ContainsKey(scene.RegionInfo.RegionID))
61 m_scenes.Add(scene.RegionInfo.RegionID, scene); 57 m_scenes.Add(scene.RegionInfo.RegionID, scene);
62 config = source; 58
59 m_config = source;
63 } 60 }
64 61
65 public void PostInitialise() 62 public void PostInitialise()
66 { 63 {
67 if (config.Configs["MXP"] != null) 64 if (m_config.Configs["MXP"] != null)
68 { 65 {
69 IConfig con = config.Configs["MXP"]; 66 IConfig con = m_config.Configs["MXP"];
70 67
71 if (!con.GetBoolean("Enabled", false)) 68 if (!con.GetBoolean("Enabled", false))
72 return; 69 return;
73 70
74 mxp_Port = con.GetInt("Port", mxp_Port); 71 m_port = con.GetInt("Port", m_port);
75 72
76 server = new MXPPacketServer("http://null", mxp_Port, m_scenes); 73 m_server = new MXPPacketServer(m_port, m_scenes);
77 74
78 ticker.AutoReset = false; 75 m_ticker.AutoReset = false;
79 ticker.Elapsed += ticker_Elapsed; 76 m_ticker.Elapsed += ticker_Elapsed;
80 77
81 ticker.Start(); 78 m_ticker.Start();
82 } 79 }
83 } 80 }
84 81
85 void ticker_Elapsed(object sender, ElapsedEventArgs e) 82 void ticker_Elapsed(object sender, ElapsedEventArgs e)
86 { 83 {
87 server.Process(); 84 m_server.Process();
88 85
89 if (!shutdown) 86 if (!m_shutdown)
90 ticker.Start(); 87 m_ticker.Start();
91 88
92 if (++ticks % 100 == 0) 89 // Commenting this at because of the excess flood to log.
90 // TODO: Add ini file option.
91 /*if (++ticks % 100 == 0)
93 { 92 {
94 server.PrintDebugInformation(); 93 server.PrintDebugInformation();
95 } 94 }*/
96 } 95 }
97 96
98 public void Close() 97 public void Close()
99 { 98 {
100 shutdown = true; 99 m_shutdown = true;
101 ticker.Stop(); 100 m_ticker.Stop();
102 } 101 }
103 102
104 public string Name 103 public string Name
@@ -110,5 +109,6 @@ namespace OpenSim.Client.MXP
110 { 109 {
111 get { return true; } 110 get { return true; }
112 } 111 }
112
113 } 113 }
114} 114}