|
| 1 | +/* |
| 2 | + Copyright 2010 MCLawl Team - Written by Valek (Modified for use with MCForge) |
| 3 | + |
| 4 | + Dual-licensed under the Educational Community License, Version 2.0 and |
| 5 | + the GNU General Public License, Version 3 (the "Licenses"); you may |
| 6 | + not use this file except in compliance with the Licenses. You may |
| 7 | + obtain a copy of the Licenses at |
| 8 | + |
| 9 | + https://opensource.org/license/ecl-2-0/ |
| 10 | + https://www.gnu.org/licenses/gpl-3.0.html |
| 11 | + |
| 12 | + Unless required by applicable law or agreed to in writing, |
| 13 | + software distributed under the Licenses are distributed on an "AS IS" |
| 14 | + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 15 | + or implied. See the Licenses for the specific language governing |
| 16 | + permissions and limitations under the Licenses. |
| 17 | +*/ |
| 18 | +using System.Collections.Generic; |
| 19 | +using Flames.NewScripting; |
| 20 | +#if F_DOTNET |
| 21 | +namespace Flames.Commands.Scripting |
| 22 | +{ |
| 23 | + public sealed class CmdCmdLoad : Command2 |
| 24 | + { |
| 25 | + public override string name { get { return "CmdLoad"; } } |
| 26 | + public override string type { get { return CommandTypes.Other; } } |
| 27 | + public override LevelPermission defaultRank { get { return LevelPermission.Owner; } } |
| 28 | + public override bool MessageBlockRestricted { get { return true; } } |
| 29 | + |
| 30 | + public override void Use(Player p, string cmdName, CommandData data) |
| 31 | + { |
| 32 | + if (cmdName.Length == 0) { Help(p); return; } |
| 33 | + if (!Formatter.ValidFilename(p, cmdName)) return; |
| 34 | + |
| 35 | + string path = IScripting.CommandPath(cmdName); |
| 36 | + ScriptingOperations.LoadCommands(p, path); |
| 37 | + } |
| 38 | + |
| 39 | + public override void Help(Player p) |
| 40 | + { |
| 41 | + p.Message("&T/CmdLoad [command name]"); |
| 42 | + p.Message("&HLoads a compiled command into the server for use."); |
| 43 | + p.Message("&H Loads both C# and Visual Basic compiled commands."); |
| 44 | + } |
| 45 | + } |
| 46 | +} |
| 47 | +#endif |
0 commit comments