The /texture command should show you a warning if url is > 64 characters, also should show 'help' when an invalid scope is specified.

This commit is contained in:
UnknownShadow200 2016-04-07 12:51:34 +10:00
parent dfd65bbd77
commit c03e09b853

View File

@ -30,6 +30,8 @@ namespace MCGalaxy.Commands {
if (message == "") { Help(p); return; }
string[] args = message.Split(' ');
string scope = args[0].ToLower();
if (scope == "local") scope = "level";
if (scope == "localzip") scope = "levelzip";
if (args.Length == 1) {
if (scope == "level")
@ -58,6 +60,7 @@ namespace MCGalaxy.Commands {
if ((scope == "globalzip" || scope == "levelzip") && !(url == "" || url.EndsWith(".zip"))) {
p.SendMessage("The texture pack URL must end in a .zip"); return;
}
if (url.Length > 64) { p.SendMessage("The URL must be 64 characters or less."); return; }
if (scope == "global") {
Server.defaultTerrainUrl = url;
@ -75,12 +78,12 @@ namespace MCGalaxy.Commands {
p.level.texturePackUrl = url;
p.SendMessage("Set level's texture pack to " + args[1]);
UpdateLevel(p, true);
} else {
Help(p);
}
}
static string GetPath(string url) {
return url == "" ? "(none)" : url;
}
static string GetPath(string url) { return url == "" ? "(none)" : url; }
void UpdateGlobally(Player p, bool zip) {
Player[] players = PlayerInfo.Online.Items;