Fix NetHooks_NameCollision to kick duplicate players.

- Fixes Pryaxis/TShock#2530
This commit is contained in:
gohjoseph 2022-03-18 00:35:02 +08:00
parent 227cef3bd6
commit 8b064a7e22
2 changed files with 4 additions and 3 deletions

View file

@ -521,7 +521,7 @@ namespace TShockAPI
{
if (player.IP == ip)
{
Netplay.Clients[player.Index].PendingTermination = true;
player.Kick("You logged in from the same IP.", true, true, "Server", true);
args.Handled = true;
return;
}
@ -530,7 +530,7 @@ namespace TShockAPI
var ips = JsonConvert.DeserializeObject<List<string>>(player.Account.KnownIps);
if (ips.Contains(ip))
{
Netplay.Clients[player.Index].PendingTermination = true;
player.Kick("You logged in from another location.", true, true, "Server", true);
args.Handled = true;
}
}
@ -1279,7 +1279,7 @@ namespace TShockAPI
//Reset toggle creative powers to default, preventing potential power transfer & desync on another user occupying this slot later.
foreach(var kv in CreativePowerManager.Instance._powersById)
foreach (var kv in CreativePowerManager.Instance._powersById)
{
var power = kv.Value;