Inheritance: INPCModule, ISharedRegionModule
        public override void SetUp()
        {
            base.SetUp();

            uint port = 9999;
            uint sslPort = 9998;

            // This is an unfortunate bit of clean up we have to do because MainServer manages things through static
            // variables and the VM is not restarted between tests.
            MainServer.RemoveHttpServer(port);

            BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "");
            MainServer.AddHttpServer(server);
            MainServer.Instance = server;

            IConfigSource config = new IniConfigSource();
            config.AddConfig("Startup");
            config.Configs["Startup"].Set("EventQueue", "true");

            CapabilitiesModule capsModule = new CapabilitiesModule();
            m_eqgMod = new EventQueueGetModule();

            // For NPC test support
            config.AddConfig("NPC");
            config.Configs["NPC"].Set("Enabled", "true");
            m_npcMod = new NPCModule();

            m_scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(m_scene, config, capsModule, m_eqgMod, m_npcMod);
        }
Example #2
0
 public void AddRegion(Scene scene)
 {
     if(!enabled) return;
     log("Adding region to MGM");
     npc = (NPCModule)scene.RequestModuleInterface<INPCModule>();
     if(npc == null || !npc.Enabled)
     {
         enabled = false;
         log("ERROR: NPC module must be enabled for MGM");
         return;
     }
     scene.AddCommand("mgm",this,"mgm status","status","Print the status of the MGM module", consoleStatus);
     scene.AddCommand("mgm",this,"mgm addUser","addUser","Test adding a user", addUser);
     mgmLink = new MGMLink(new IPEndPoint(mgmAddress, mgmPort), log);
     mgmLink.start();
     registerEvents(scene.EventManager);
     string regMsg = MGMJson.Register(scene.Name, scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, scene.RegionInfo.RegionSizeX);
     mgmLink.send(regMsg);
     this.scene = scene;
     mgr = new MGMClientManager(scene,log);
 }