Implemented config for disabling account login at join.
This commit is contained in:
parent
1671db928b
commit
be20d07707
2 changed files with 4 additions and 1 deletions
|
|
@ -216,6 +216,9 @@ namespace TShockAPI
|
||||||
[Description("Protect chests with region and build permissions")]
|
[Description("Protect chests with region and build permissions")]
|
||||||
public bool RegionProtectChests = false;
|
public bool RegionProtectChests = false;
|
||||||
|
|
||||||
|
[Description("Disable users from being able to login with account password when joining")]
|
||||||
|
public bool DisableLoginBeforeJoin = false;
|
||||||
|
|
||||||
public static ConfigFile Read(string path)
|
public static ConfigFile Read(string path)
|
||||||
{
|
{
|
||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,7 @@ namespace TShockAPI
|
||||||
private static bool HandleConnecting(GetDataHandlerArgs args)
|
private static bool HandleConnecting(GetDataHandlerArgs args)
|
||||||
{
|
{
|
||||||
var user = TShock.Users.GetUserByName(args.Player.Name);
|
var user = TShock.Users.GetUserByName(args.Player.Name);
|
||||||
if (user != null)
|
if (user != null && !TShock.Config.DisableLoginBeforeJoin)
|
||||||
{
|
{
|
||||||
args.Player.RequiresPassword = true;
|
args.Player.RequiresPassword = true;
|
||||||
NetMessage.SendData((int)PacketTypes.PasswordRequired, args.Player.Index);
|
NetMessage.SendData((int)PacketTypes.PasswordRequired, args.Player.Index);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue