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);
            scene.AddCommand("mgm", this, "mgm removeUser", "removeUser", "Test removing a user", removeUser);
            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);
        }
 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);
 }
Exemple #3
0
 public void registerCallbacks(MGMLink link)
 {
     this.link = link;
     this.OnInstantMessageToNPC += onInstantMessage;
 }
 public void registerCallbacks(MGMLink link)
 {
     this.link = link;
     this.OnInstantMessageToNPC += onInstantMessage;
 }