Prevent further things from clients who dont handshake

- The player will only finish the handshake once they spawn their player, a normal client would always do this eventually.

- They cannot chat, even if they request world data but just not spawn their player.

- Other clients will not be notified of their join/leave in both cases (dont request WD or do but dont spawn)

- And most importantly, they do not show on the in game player list but still show on the server console /playing cmd.
This commit is contained in:
ohayo 2025-01-31 09:17:26 +10:00
parent d35934b3a2
commit 53789b40e4
5 changed files with 22 additions and 6 deletions

View file

@ -2726,6 +2726,8 @@ namespace TShockAPI
short numberOfDeathsPVP = args.Data.ReadInt16();
PlayerSpawnContext context = (PlayerSpawnContext)args.Data.ReadByte();
args.Player.FinishedHandshake = true;
if (OnPlayerSpawn(args.Player, args.Data, player, spawnx, spawny, respawnTimer, numberOfDeathsPVE, numberOfDeathsPVP, context))
return true;
@ -2762,6 +2764,7 @@ namespace TShockAPI
args.Player.Dead = true;
else
args.Player.Dead = false;
return false;
}