mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-08-03 11:26:13 -04:00
Fix permissions for a few commands
This commit is contained in:
parent
206c193da3
commit
c5ba878e08
@ -28,6 +28,7 @@ namespace MCGalaxy.Commands.Chatting
|
||||
public override string type { get { return CommandTypes.Chat; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.AdvBuilder; } }
|
||||
public override bool UseableWhenFrozen { get { return true; } }
|
||||
public override bool MessageBlockRestricted { get { return true; } }
|
||||
|
||||
public override void Use(Player p, string message, CommandData data) {
|
||||
if (message.Length == 0) { Help(p); return; }
|
||||
|
@ -24,6 +24,7 @@ namespace MCGalaxy.Commands.Eco {
|
||||
public override string name { get { return "Give"; } }
|
||||
public override string shortcut { get { return "Gib"; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Admin; } }
|
||||
public override bool MessageBlockRestricted { get { return true; } }
|
||||
|
||||
public override void Use(Player p, string message, CommandData data) {
|
||||
EcoTransaction trans;
|
||||
|
@ -23,7 +23,7 @@ namespace MCGalaxy.Commands.Eco {
|
||||
public sealed class CmdTake : MoneyCmd {
|
||||
public override string name { get { return "Take"; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Admin; } }
|
||||
|
||||
public override bool MessageBlockRestricted { get { return true; } }
|
||||
public override void Use(Player p, string message, CommandData data) {
|
||||
EcoTransaction trans;
|
||||
bool all = true;
|
||||
|
@ -281,15 +281,19 @@ namespace MCGalaxy.Commands.World {
|
||||
opt == LevelOptions.Goto || opt == LevelOptions.Unload;
|
||||
}
|
||||
|
||||
static void MapMoved(Player p, string message, string name, SubCommand.Behavior behaviour) {
|
||||
static void MapMoved(Player p, string message, string name, SubCommand.Behavior behaviour, bool mapOnly = true) {
|
||||
AnnounceRenamed(p, "map " + name, name);
|
||||
if (mapOnly && !LevelInfo.IsRealmOwner(p.level, p.name)) {
|
||||
p.Message("You may only use &T/{0} {1}&S after you join your map.", commandShortcut, name);
|
||||
return;
|
||||
}
|
||||
behaviour(p, message);
|
||||
}
|
||||
|
||||
static SubCommandGroup mapSubCommandGroup = new SubCommandGroup(commandShortcut + " map",
|
||||
new List<SubCommand>() {
|
||||
new SubCommand("Physics", (p, arg) => { MapMoved(p, arg, "physics", HandlePhysics); }),
|
||||
new SubCommand("Add", (p, arg) => { MapMoved(p, arg, "add", HandleAdd); }, false, new string[] { "create", "new" } ),
|
||||
new SubCommand("Add", (p, arg) => { MapMoved(p, arg, "add", HandleAdd, false);}, false, new string[] { "create", "new" } ),
|
||||
new SubCommand("Delete", (p, arg) => { MapMoved(p, arg, "delete", HandleDelete); }, false, new string[] { "del", "remove" } ),
|
||||
new SubCommand("Save", (p, arg) => { MapMoved(p, arg, "save", HandleSave); }),
|
||||
new SubCommand("Restore", (p, arg) => { MapMoved(p, arg, "restore", HandleRestore); }),
|
||||
|
@ -30,6 +30,8 @@ namespace MCGalaxy.Commands.Building {
|
||||
public override CommandPerm[] ExtraPerms {
|
||||
get { return new[] { new CommandPerm(LevelPermission.Operator, "can undo physics") }; }
|
||||
}
|
||||
public override bool MessageBlockRestricted { get { return true; } }
|
||||
|
||||
|
||||
public override void Use(Player p, string message, CommandData data) {
|
||||
if (message.Length == 0) { UndoLastDrawOp(p); return; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user