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

@ -183,7 +183,7 @@ namespace TShockAPI
/// <returns>The number of active players on the server.</returns>
public int GetActivePlayerCount()
{
return TShock.Players.Count(p => null != p && p.Active);
return TShock.Players.Count(p => null != p && p.Active && p.FinishedHandshake);
}
//Random should not be generated in a method