Introduce SoftcoreOnly config option to allow only softcore characters
to connect.
This commit is contained in:
parent
dcf1f07ff9
commit
a40effd55e
3 changed files with 11 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
|
||||||
|
|
||||||
## Upcoming changes
|
## Upcoming changes
|
||||||
* Fixed SendTileRectHandler not sending tile rect updates like Pylons/Mannequins to other clients. (@Stealownz)
|
* Fixed SendTileRectHandler not sending tile rect updates like Pylons/Mannequins to other clients. (@Stealownz)
|
||||||
|
* Introduced `SoftcoreOnly` config option to allow only softcore characters to connect. (@drunderscore)
|
||||||
|
|
||||||
## TShock 4.5.5
|
## TShock 4.5.5
|
||||||
* Changed the world autosave message so that it no longer warns of a "potential lag spike." (@hakusaro)
|
* Changed the world autosave message so that it no longer warns of a "potential lag spike." (@hakusaro)
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,10 @@ namespace TShockAPI.Configuration
|
||||||
[Description("Prevents softcore players from connecting.")]
|
[Description("Prevents softcore players from connecting.")]
|
||||||
public bool MediumcoreOnly;
|
public bool MediumcoreOnly;
|
||||||
|
|
||||||
|
/// <summary>Prevents non-softcore players from connecting.</summary>
|
||||||
|
[Description("Prevents non-softcore players from connecting.")]
|
||||||
|
public bool SoftcoreOnly;
|
||||||
|
|
||||||
/// <summary>Disables any placing, or removal of blocks.</summary>
|
/// <summary>Disables any placing, or removal of blocks.</summary>
|
||||||
[Description("Disables any placing, or removal of blocks.")]
|
[Description("Disables any placing, or removal of blocks.")]
|
||||||
public bool DisableBuild;
|
public bool DisableBuild;
|
||||||
|
|
|
||||||
|
|
@ -2364,6 +2364,12 @@ namespace TShockAPI
|
||||||
NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, args.Player.Index, NetworkText.FromLiteral(args.Player.Name), args.Player.Index);
|
NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, args.Player.Index, NetworkText.FromLiteral(args.Player.Name), args.Player.Index);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (TShock.Config.Settings.SoftcoreOnly && difficulty != 0)
|
||||||
|
{
|
||||||
|
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePlayerInfo rejected softcore required");
|
||||||
|
args.Player.Kick("You need to join with a softcore player.", true, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (TShock.Config.Settings.MediumcoreOnly && difficulty < 1)
|
if (TShock.Config.Settings.MediumcoreOnly && difficulty < 1)
|
||||||
{
|
{
|
||||||
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePlayerInfo rejected mediumcore required");
|
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePlayerInfo rejected mediumcore required");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue