public void AddRegion(Scene scene) { scene.RegisterModuleCommander(m_commander); scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; scene.RegisterModuleInterface<IRegionSerialiserModule>(this); lock (m_regions) { m_regions.Add(scene); } }
public void AddRegion(Scene scene) { m_scene = scene; m_scene.RegisterModuleCommander(m_commander); m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; }
public void AddRegion(Scene scene) { // We just have this to show the sequence // remove from your real module m_log.InfoFormat("[<<< ExampleModule >>>]: Running *{0}* Sequence {1} : Enabled {2}", "AddRegion", (m_InitCount++).ToString(), m_enabled.ToString(), scene.RegionInfo.RegionName); // We have to check to see if we're enabled // Return if not enabled if (!m_enabled) return; // Hook up events // This will fire when a client enters the region // It will fire for all regions in the instance // because this is a shared region module scene.EventManager.OnNewClient += OnNewClient; // This will fire when the agent becomes a root agent scene.EventManager.OnMakeRootAgent += HandleOnMakeRootAgent; // This will fire when we type our command into the console scene.EventManager.OnPluginConsole += HandleSceneEventManagerOnPluginConsole; // Take ownership of the IExampleModule service // This is optional for external modules. // But, for custom modules that are designed to replace basic ones, // you will register the interface with the module loader so this one // is loaded instead of the basic module. // If your module intends to be replaceable, then return this interface // type (See RepleableInterface property below) // If you module is replaceing, then register the interface here // and return null with the ReplaceableInterface property scene.RegisterModuleInterface<IExampleModule>(this); // The following are optional and is part of the required components to create // console commands to be handled by our module // // Add a command to set the message in the console // See the handler 'HandleSetMessage' below Command set_message = new Command("set-message", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleSetMessage, "Set ExampleModule message"); set_message.AddArgument("message", "the message", "String"); m_commander.RegisterCommand("set-message", set_message); // Add a command to get the message in the console // See the handler 'HandleGetMessage' below Command get_message = new Command("get-message", CommandIntentions.COMMAND_NON_HAZARDOUS, HandleGetMessage, "Get ExampleModule message"); m_commander.RegisterCommand("get-message",get_message); // Register our command handler scene.RegisterModuleCommander(m_commander); }