Example #1
0
 public override void OnInvoke(CommandObject[] obj)
 {
     if (obj.Length != 2)
     {
         Print(Info.HelpText);
         return;
     }
     if (obj[0].type == Program.engine.STRING && !obj[0].IsNull &&
         obj[1].type == Program.engine.STRING && !obj[1].IsNull)
     {
         string name = (string)obj[0].value;
         int    count;
         if (!int.TryParse((string)obj[1].value, out count))
         {
             Print(Info.HelpText);
             return;
         }
         MapBase map = GlobalServer.FindMap(name);
         if (map == null)
         {
             Print("指定地图不存在");
             return;
         }
         map.MaxBlockCount = count;
         Print("操作成功");
     }
 }
Example #2
0
        public override void OnInvoke(CommandObject[] obj)
        {
            if (obj.Length != 1)
            {
                Print(Info.HelpText);
                return;
            }
            string arg = (string)obj[0].value;

            if (GlobalServer.FindMap(arg) == null)
            {
                Print("指定地图不存在");
                return;
            }
            ForgetiveServer.DefaultMapName = arg;
            Logger.WriteLine(LogLevel.Default, "已选择地图 {0}", arg);
        }