Better help for mute/freeze, add a ConfigByte attribute.

This commit is contained in:
UnknownShadow200 2017-06-28 22:15:00 +10:00
parent 57f468f7b1
commit 565e428256
7 changed files with 14 additions and 14 deletions

View File

@ -58,7 +58,7 @@ namespace MCGalaxy.Commands.Moderation {
public override void Help(Player p) { public override void Help(Player p) {
Player.Message(p, "%T/freeze [name] [timespan] <reason>"); Player.Message(p, "%T/freeze [name] [timespan] <reason>");
Player.Message(p, "%HStops [name] from moving for [timespan] time, or until manually unfrozen."); Player.Message(p, "%HPrevents [name] from moving for [timespan], or until manually unfrozen.");
Player.Message(p, "%HFor <reason>, @number can be used as a shortcut for that rule."); Player.Message(p, "%HFor <reason>, @number can be used as a shortcut for that rule.");
} }
} }

View File

@ -66,7 +66,7 @@ namespace MCGalaxy.Commands.Moderation {
public override void Help(Player p) { public override void Help(Player p) {
Player.Message(p, "%T/mute [player] [timespan] <reason>"); Player.Message(p, "%T/mute [player] [timespan] <reason>");
Player.Message(p, "%HMutes or unmutes that player."); Player.Message(p, "%HMutes player for [timespan], or unmutes that player.");
Player.Message(p, "%HFor <reason>, @number can be used as a shortcut for that rule."); Player.Message(p, "%HFor <reason>, @number can be used as a shortcut for that rule.");
} }
} }

View File

@ -45,7 +45,7 @@ namespace MCGalaxy.Commands.World {
if (src == null) return; if (src == null) return;
if (!Formatter.ValidName(p, dst, "level")) return; if (!Formatter.ValidName(p, dst, "level")) return;
if (LevelInfo.MapExists(dst)) { Player.Message(p, "The level \"" + dst + "\" already exists."); return; } if (LevelInfo.MapExists(dst)) { Player.Message(p, "The level \"" + dst + "\" already exists."); return; }
try { try {
LevelActions.CopyLevel(src, dst); LevelActions.CopyLevel(src, dst);
} catch (System.IO.IOException) { } catch (System.IO.IOException) {

View File

@ -19,7 +19,7 @@ using System;
namespace MCGalaxy.Config { namespace MCGalaxy.Config {
public sealed class ConfigIntAttribute : ConfigAttribute { public class ConfigIntAttribute : ConfigAttribute {
/// <summary> Minimum integer allowed for a value. </summary> /// <summary> Minimum integer allowed for a value. </summary>
public int MinValue; public int MinValue;

View File

@ -242,7 +242,7 @@ namespace MCGalaxy {
Logger.Log(LogType.UserActivity, "{0} rank changed to {1} on {2}.", type, grp.trueName, lvl.name); Logger.Log(LogType.UserActivity, "{0} rank changed to {1} on {2}.", type, grp.trueName, lvl.name);
Chat.MessageLevel(lvl, type + " rank changed to " + grp.ColoredName + "%S."); Chat.MessageLevel(lvl, type + " rank changed to " + grp.ColoredName + "%S.");
if (p != null && p.level != lvl) if (p != null && p.level != lvl)
Player.Message(p, "{0} rank changed to {1} %Son {2}%S.", type, grp.ColoredName, lvl.ColoredName); Player.Message(p, "{0} rank changed to {1} %Son {2}%S.", type, grp.ColoredName, ColoredName);
} }
/// <summary> Messages all player on the level (and source player) notifying them that the /// <summary> Messages all player on the level (and source player) notifying them that the
@ -261,7 +261,7 @@ namespace MCGalaxy {
Logger.Log(LogType.UserActivity, "{0} on {1}", msg, lvl.name); Logger.Log(LogType.UserActivity, "{0} on {1}", msg, lvl.name);
Chat.MessageLevel(lvl, msg); Chat.MessageLevel(lvl, msg);
if (p != null && p.level != lvl) if (p != null && p.level != lvl)
Player.Message(p, "{0} on %S{1}", msg, lvl.ColoredName); Player.Message(p, "{0} on %S{1}", msg, ColoredName);
} }

View File

@ -50,8 +50,8 @@ namespace MCGalaxy {
public int JailZ; public int JailZ;
// Environment settings // Environment settings
[ConfigInt("Weather", "Env", null, 0, 0, 2)] [ConfigByte("Weather", "Env", null, 0, 0, 2)]
public int Weather; public byte Weather;
[ConfigString("Texture", "Env", null, "", true, null, NetUtils.StringSize)] [ConfigString("Texture", "Env", null, "", true, null, NetUtils.StringSize)]
public string Terrain = ""; public string Terrain = "";
[ConfigString("TexturePack", "Env", null, "", true, null, NetUtils.StringSize)] [ConfigString("TexturePack", "Env", null, "", true, null, NetUtils.StringSize)]
@ -95,11 +95,11 @@ namespace MCGalaxy {
[ConfigInt("weather-fade", "Env", null, 128, short.MinValue, short.MaxValue)] [ConfigInt("weather-fade", "Env", null, 128, short.MinValue, short.MaxValue)]
public int WeatherFade = 128; public int WeatherFade = 128;
/// <summary> The block which will be displayed on the horizon. </summary> /// <summary> The block which will be displayed on the horizon. </summary>
[ConfigInt("HorizonBlock", "Env", null, Block.water, 0, 255)] [ConfigByte("HorizonBlock", "Env", null, Block.water)]
public int HorizonBlock = Block.water; public byte HorizonBlock = Block.water;
/// <summary> The block which will be displayed on the edge of the map. </summary> /// <summary> The block which will be displayed on the edge of the map. </summary>
[ConfigInt("EdgeBlock", "Env", null, Block.blackrock, 0, 255)] [ConfigByte("EdgeBlock", "Env", null, Block.blackrock)]
public int EdgeBlock = Block.blackrock; public byte EdgeBlock = Block.blackrock;
/// <summary> Whether exponential fog mode is used client-side. </summary> /// <summary> Whether exponential fog mode is used client-side. </summary>
[ConfigBool("ExpFog", "Env", null, false)] [ConfigBool("ExpFog", "Env", null, false)]
public bool ExpFog; public bool ExpFog;

View File

@ -52,7 +52,7 @@ namespace MCGalaxy {
} }
public static void SetBlock(Player p, string value, EnvProp prop, public static void SetBlock(Player p, string value, EnvProp prop,
string variable, byte defValue, ref int target) { string variable, byte defValue, ref byte target) {
if (IsResetString(value)) { if (IsResetString(value)) {
Player.Message(p, "Reset {0} for {1} %Sto normal", variable, p.level.ColoredName); Player.Message(p, "Reset {0} for {1} %Sto normal", variable, p.level.ColoredName);
target = defValue; target = defValue;
@ -113,7 +113,7 @@ namespace MCGalaxy {
} }
static bool CheckBlock(Player p, string value, string variable, ref int modify) { static bool CheckBlock(Player p, string value, string variable, ref byte modify) {
ExtBlock block; ExtBlock block;
if (!CommandParser.GetBlock(p, value, out block)) return false; if (!CommandParser.GetBlock(p, value, out block)) return false;