diff --git a/Commands/CmdOverseer.cs b/Commands/CmdOverseer.cs index deecbcd6e..476ba9ba0 100644 --- a/Commands/CmdOverseer.cs +++ b/Commands/CmdOverseer.cs @@ -35,7 +35,7 @@ namespace MCGalaxy.Commands p.SendMessage("Your rank is set to have 0 overseer maps. Therefore, you may not use overseer."); if (message == "") { Help(p); return; } - string[] parts = message.Split(' '); + string[] parts = message.Split(trimChars, 3); string cmd = parts[0].ToUpper(); string arg = parts.Length > 1 ? parts[1].ToUpper() : ""; string arg2 = parts.Length > 2 ? parts[2] : ""; @@ -182,10 +182,13 @@ namespace MCGalaxy.Commands } } - if (value == "" || MapGen.IsRecognisedFormat(value)) { - string type = value == "" ? "flat" : value; + string[] args = value.Split(' '); + bool noTypeArg = value == "" || args.Length == 3; + string type = noTypeArg ? "flat" : args[args.Length - 1]; + if (MapGen.IsRecognisedFormat(type)) { Player.SendMessage(p, "Creating a new map for you: " + level); - Command.all.Find("newlvl").Use(p, level + " 128 64 128 " + type); + string cmdArgs = args.Length == 1 ? "128 64 128 flat" : (noTypeArg ? value + " flat" : value); + Command.all.Find("newlvl").Use(p, level + " " + cmdArgs); } else { Player.SendMessage(p, "Invalid map type was specified."); MapGen.PrintValidFormats(p); @@ -250,7 +253,8 @@ namespace MCGalaxy.Commands Player.SendMessage(p, "Your texture has been updated!"); } } else { - Player.SendMessage(p, "/os map add [type - default is flat] -- Creates your map"); + Player.SendMessage(p, "/os map add [type - default is flat] -- Creates your map (128x64x128)"); + Player.SendMessage(p, "/os map add [width] [height] [length] [type] -- Creates your map"); Player.SendMessage(p, "/os map physics -- Sets the physics on your map."); Player.SendMessage(p, "/os map delete -- Deletes your map"); Player.SendMessage(p, "/os map save -- Saves your map"); diff --git a/Commands/Moderation/CmdCrashServer.cs b/Commands/Moderation/CmdCrashServer.cs index 5ce26f45a..5ef643d9a 100644 --- a/Commands/Moderation/CmdCrashServer.cs +++ b/Commands/Moderation/CmdCrashServer.cs @@ -29,7 +29,6 @@ namespace MCGalaxy.Commands { public override void Use(Player p, string message) { if (message != "") { Help(p); return; } - Chat.GlobalMessageOps(p.color + p.DisplayName + " %Sused &b/crashserver"); int code = p.random.Next(int.MinValue, int.MaxValue); string msg = "Server crash! Error code 0x" + Convert.ToString(code, 16).ToUpper(); p.LeaveServer(msg, msg); diff --git a/Commands/Moderation/CmdRankInfo.cs b/Commands/Moderation/CmdRankInfo.cs index ad8b957b8..7b194bf1c 100644 --- a/Commands/Moderation/CmdRankInfo.cs +++ b/Commands/Moderation/CmdRankInfo.cs @@ -34,27 +34,24 @@ namespace MCGalaxy.Commands { Player who = PlayerInfo.Find(message); string target = who == null ? message : who.name; - Player.SendMessage(p, "&1Rank Information of " + target); + Player.SendMessage(p, "&1Rank information for " + target); bool found = false; foreach (string line in File.ReadAllLines("text/rankinfo.txt")) { - if (!line.Contains(target)) - continue; + if (!line.CaselessStarts(target)) continue; string[] parts = line.Split(' '); - if (parts[0] != target) continue; + if (!parts[0].CaselessEq(target)) continue; Group newRank = Group.Find(parts[7]), oldRank = Group.Find(parts[8]); int minutes = Convert.ToInt32(parts[2]), hours = Convert.ToInt32(parts[3]); int days = Convert.ToInt32(parts[4]), months = Convert.ToInt32(parts[5]); int years = Convert.ToInt32(parts[6]); DateTime timeRanked = new DateTime(years, months, days, hours, minutes, 0); - string reason = parts.Length <= 9 ? null : + string reason = parts.Length <= 9 ? "(no reason given)" : CP437Reader.ConvertToRaw(parts[9].Replace("%20", " ")); - Player.SendMessage(p, "&aRank changed from: " + oldRank.color + oldRank.name - + " &ato " + newRank.color + newRank.name); - Player.SendMessage(p, "&aRanked by: %S" + parts[1] + " &aon %S" + timeRanked); - if (reason != null) - Player.SendMessage(p, "&aRank reason: %S" + reason); + Player.SendMessage(p, "&aFrom " + oldRank.color + oldRank.name + + " &ato " + newRank.color + newRank.name + " &aon %S" + timeRanked); + Player.SendMessage(p, "&aBy %S" + parts[1] + " &awith reason: %S" + reason); found = true; } if (!found)