max of 6 in /roll by default

This commit is contained in:
UnknownShadow200 2017-01-29 15:47:25 +11:00
parent 4d0c61901a
commit 0b9ec61ee1
5 changed files with 10 additions and 6 deletions

View File

@ -73,7 +73,7 @@ namespace MCGalaxy {
}
}
/// <summary> Sends a message to all players who are on the given level. </summary>
/// <summary> Sends a message to all players who are on the given level, and are not in a chatroom. </summary>
public static void MessageLevel(Level lvl, string message) {
MessageWhere(message, pl => pl.level == lvl && pl.Chatroom == null);
}
@ -91,7 +91,7 @@ namespace MCGalaxy {
}
/// <summary> Sends a message to all players, who do not have
/// isolated level/level only chat and are not in a chatroom. </summary>
/// isolated level/level only chat, and are not in a chatroom. </summary>
public static void MessageAll(string message) {
message = Colors.EscapeColors(message);
Player[] players = PlayerInfo.Online.Items;
@ -139,6 +139,7 @@ namespace MCGalaxy {
}
}
#region Format helpers
public static void MessageAll(string message, object a0) {

View File

@ -28,7 +28,7 @@ namespace MCGalaxy.Commands {
int min, max;
if (!int.TryParse(args[0], out min)) min = 1;
if (args.Length == 1 || !int.TryParse(args[1], out max)) max = 7;
if (args.Length == 1 || !int.TryParse(args[1], out max)) max = 6;
if (min > max) { int a = min; min = max; max = a; }
// rand.Next(min, max) is exclusive of max, so we need to use (max + 1)

View File

@ -175,7 +175,7 @@ namespace MCGalaxy.Eco {
}
if (shortcuts.Count == 0) return;
Player.Message(p, "Shortcuts: {0}", shortcuts.Join());
Player.Message(p, "Shortcuts: %T{0}", shortcuts.Join());
}
}
}

View File

@ -64,14 +64,14 @@ namespace MCGalaxy {
}
static void PrintAliases(Player p, Command cmd) {
StringBuilder dst = new StringBuilder("Shortcuts: ");
StringBuilder dst = new StringBuilder("Shortcuts: %T");
if (!String.IsNullOrEmpty(cmd.shortcut)) {
dst.Append('/').Append(cmd.shortcut).Append(", ");
}
FindAliases(Alias.coreAliases, cmd, dst);
FindAliases(Alias.aliases, cmd, dst);
if (dst.Length == "Shortcuts: ".Length) return;
if (dst.Length == "Shortcuts: %T".Length) return;
Player.Message(p, dst.ToString(0, dst.Length - 2));
}

View File

@ -20,6 +20,9 @@ using System.Collections;
using System.Text;
namespace MCGalaxy {
/// <summary> Finds partial matches of a 'name' against the names of the items an enumerable. </summary>
/// <remarks> returns number of matches found, and the matching item if only 1 match is found. </remarks>
public static class Matcher {
const StringComparison comp = StringComparison.OrdinalIgnoreCase;