Thank you tlaukkan for a patch that: Upgraded to MXP 0.4 version and cleaned up field naming.

* Updated code to compile against MXP 0.4 version.
* Cleaned up field naming conventions.
* Added support for logging in with region name.
* Filled in new fields of JoinResponseMEssage.
* Added support for SynchronizationBeginEvent and SynchronizationEndEvent.
* Commented out periodic debug log.
* Added networking startup log messages.

This closes mantis #3277
This commit is contained in:
lbsa71
2009-03-08 19:33:19 +00:00
parent 2fa57a2970
commit 4f23718102
6 changed files with 202 additions and 142 deletions

View File

@@ -40,65 +40,64 @@ namespace OpenSim.Client.MXP
{
public class MXPModule : IRegionModule
{
private int mxp_Port = 1253;
//private double mxp_BubbleRadius = 181.01933598375616624661615669884; // Radius of a sphere big enough to encapsulate a 256x256 square
private readonly Timer ticker = new Timer(100);
private int m_port = 1253;
//private int m_ticks = 0;
private bool m_shutdown = false;
private int ticks;
private bool shutdown = false;
private IConfigSource config;
private readonly Dictionary<UUID,Scene> m_scenes = new Dictionary<UUID, Scene>();
private MXPPacketServer server;
private IConfigSource m_config;
private readonly Timer m_ticker = new Timer(100);
private readonly Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
private MXPPacketServer m_server;
public void Initialise(Scene scene, IConfigSource source)
{
if (!m_scenes.ContainsKey(scene.RegionInfo.RegionID))
m_scenes.Add(scene.RegionInfo.RegionID, scene);
config = source;
m_config = source;
}
public void PostInitialise()
{
if (config.Configs["MXP"] != null)
if (m_config.Configs["MXP"] != null)
{
IConfig con = config.Configs["MXP"];
IConfig con = m_config.Configs["MXP"];
if (!con.GetBoolean("Enabled", false))
return;
mxp_Port = con.GetInt("Port", mxp_Port);
m_port = con.GetInt("Port", m_port);
server = new MXPPacketServer("http://null", mxp_Port, m_scenes);
m_server = new MXPPacketServer(m_port, m_scenes);
ticker.AutoReset = false;
ticker.Elapsed += ticker_Elapsed;
m_ticker.AutoReset = false;
m_ticker.Elapsed += ticker_Elapsed;
ticker.Start();
m_ticker.Start();
}
}
void ticker_Elapsed(object sender, ElapsedEventArgs e)
{
server.Process();
m_server.Process();
if (!shutdown)
ticker.Start();
if (!m_shutdown)
m_ticker.Start();
if (++ticks % 100 == 0)
// Commenting this at because of the excess flood to log.
// TODO: Add ini file option.
/*if (++ticks % 100 == 0)
{
server.PrintDebugInformation();
}
}*/
}
public void Close()
{
shutdown = true;
ticker.Stop();
m_shutdown = true;
m_ticker.Stop();
}
public string Name
@@ -110,5 +109,6 @@ namespace OpenSim.Client.MXP
{
get { return true; }
}
}
}