From dfcf1691ff9aa66b620f331f13ceeb803972e1a5 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 26 Jun 2017 10:16:43 +1000 Subject: [PATCH] Show special rules that can go in a motd when doing /help map motd. Fixes #312. --- MCGalaxy/Commands/World/CmdMap.cs | 15 +++++++++++++++ MCGalaxy/Levels/LevelOptions.cs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/MCGalaxy/Commands/World/CmdMap.cs b/MCGalaxy/Commands/World/CmdMap.cs index 5941de28f..894dd0407 100644 --- a/MCGalaxy/Commands/World/CmdMap.cs +++ b/MCGalaxy/Commands/World/CmdMap.cs @@ -142,11 +142,26 @@ namespace MCGalaxy.Commands.World { if (!help.Key.CaselessEq(opt)) continue; Player.Message(p, "%T/map [level] {0}{1}", opt, Suffix(opt)); Player.Message(p, "%H" + help.Value); + + if (help.Key.CaselessEq("motd")) ShowMotdRules(p); return; } Player.Message(p, "Unrecognised option \"{0}\".", opt); } + static void ShowMotdRules(Player p) { + Player.Message(p, "%HSpecial rules that can be put in a motd:"); + Player.Message(p, "%T-/+hax %H- disallows/allows all hacks"); + Player.Message(p, "%T-/+fly %H- disallows/allows flying"); + Player.Message(p, "%T-/+noclip %H- disallows/allows noclipping"); + Player.Message(p, "%T-/+respawn %H- disallows/allows respawning"); + Player.Message(p, "%T-/+speed %H- disallows/allows speeding"); + Player.Message(p, "%T-/+ophax %H- disallows/allows hacks for {0}%S+", + Group.GetColoredName(LevelPermission.Operator)); + Player.Message(p, "%Tjumpheight=[height] %H- sets max height users can jump up to"); + Player.Message(p, "%Thorspeed=[speed] %H- sets max speed users can move at, when speeding is disallowed"); + } + static string Suffix(string opt) { if (opt == "motd") return " "; return HasArgument(opt) ? " [value]" : ""; diff --git a/MCGalaxy/Levels/LevelOptions.cs b/MCGalaxy/Levels/LevelOptions.cs index 0aab02850..827298da8 100644 --- a/MCGalaxy/Levels/LevelOptions.cs +++ b/MCGalaxy/Levels/LevelOptions.cs @@ -55,7 +55,7 @@ namespace MCGalaxy { }; public static Dictionary Help = new Dictionary() { - { "motd", "%HSets the custom motd for this map. (leave blank to use server default)" }, + { "motd", "%HSets the motd for this map. (leave blank to use default motd)" }, { "RealmOwner", "%HSets the players allowed to use /realm on this map." }, { "TreeType", "%HSets the type of trees saplings grow into." }, { "PhysicSpeed", "%HSets the delay (in milliseconds) between physics ticks." },