public void Initialize(IConfigSource config, IRegistryCore registry)
{
IConfig hgConfig = config.Configs["HyperGrid"];
if (hgConfig == null || !hgConfig.GetBoolean ("Enabled", false))
return;
IConfig imConfig = config.Configs["HyperGridIM"];
uint port = 8007;
bool enabled = false;
if (imConfig != null)
{
enabled = imConfig.GetBoolean ("Enabled", enabled);
port = imConfig.GetUInt ("Port", port);
}
if (!enabled)
return;
//Add the external handler
m_registry = registry;
ISimulationBase simBase = m_registry.RequestModuleInterface<ISimulationBase> ();
IHttpServer server = simBase.GetHttpServer (port);
GetHandlers.IM_PORT = server.Port;
server.AddXmlRPCHandler ("grid_instant_message", ProcessInstantMessage, false);
}