Ejemplo n.º 1
0
        public override void Use(Player p, string cmdName, CommandData data)
        {
            if (!Formatter.ValidName(p, cmdName, "command"))
            {
                return;
            }
            if (Command.Find(cmdName) != null)
            {
                p.Message("That command is already loaded!"); return;
            }

            string path = IScripting.DllPath(cmdName);

            if (!File.Exists(path))
            {
                p.Message("File &9{0} &Snot found.", path); return;
            }

            string error = IScripting.Load(path);

            if (error != null)
            {
                p.Message("&W" + error); return;
            }
            p.Message("Command was successfully loaded.");
        }
Ejemplo n.º 2
0
        public override void Use(Player p, string message, CommandData data)
        {
            if (message.Length == 0)
            {
                Help(p); return;
            }
            string[] args = message.SplitSpaces();

            IScripting engine = null;

            if (args.Length == 1)
            {
                engine = IScripting.CS;
            }
            else if (args[1].CaselessEq("vb"))
            {
                engine = IScripting.VB;
            }
            else
            {
                Help(p); return;
            }

            string path = engine.SourcePath(args[0]);

            if (!File.Exists(path))
            {
                p.Message("File &9{0} %Snot found.", path); return;
            }

            string dstPath = IScripting.DllPath(args[0]);

            if (engine.Compile(path, dstPath))
            {
                p.Message("Command compiled successfully.");
            }
            else
            {
                p.Message("%WCompilation error. See " + IScripting.ErrorPath + " for more information.");
            }
        }