Added config option for Server Full kick reason.
Added config option to display group names in chat
This commit is contained in:
parent
2a20af352a
commit
3fcb95f9a4
2 changed files with 16 additions and 2 deletions
|
|
@ -94,6 +94,7 @@ namespace TShockAPI
|
|||
public string HardcoreBanReason = "Death results in a ban";
|
||||
public string HardcoreKickReason = "Death results in a kick";
|
||||
public string ProjectileAbuseReason = "Projectile abuse";
|
||||
|
||||
|
||||
public bool EnableDNSHostResolution;
|
||||
|
||||
|
|
@ -110,8 +111,21 @@ namespace TShockAPI
|
|||
/// </summary>
|
||||
public string HashAlgorithm = "sha512";
|
||||
|
||||
/// <summary>
|
||||
/// Buffers up the packets and sends them out at the end of each frame
|
||||
/// </summary>
|
||||
public bool BufferPackets = false;
|
||||
|
||||
/// <summary>
|
||||
/// Display the users group when they chat.
|
||||
/// </summary>
|
||||
public bool ChatDisplayGroup = false;
|
||||
|
||||
/// <summary>
|
||||
/// String that is used when kicking people when the server is full.
|
||||
/// </summary>
|
||||
public string ServerFullReason = "Server is full";
|
||||
|
||||
public static ConfigFile Read(string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ namespace TShockAPI
|
|||
|
||||
if (Tools.ActivePlayers() + 1 > Config.MaxSlots && !player.Group.HasPermission("reservedslot"))
|
||||
{
|
||||
Tools.ForceKick(player, "Server is full");
|
||||
Tools.ForceKick(player, Config.ServerFullReason);
|
||||
handler.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
@ -490,7 +490,7 @@ namespace TShockAPI
|
|||
}
|
||||
else
|
||||
{
|
||||
Tools.Broadcast("<" + tsplr.Name + "> " + text,
|
||||
Tools.Broadcast("{2}<{0}> {1}".SFormat(tsplr.Name, text, Config.ChatDisplayGroup ? "[{0}] ".SFormat(tsplr.Group.Name) : ""),
|
||||
tsplr.Group.R, tsplr.Group.G,
|
||||
tsplr.Group.B);
|
||||
//Log.Info(string.Format("{0} said: {1}", tsplr.Name, text));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue