send server init after the client init

To make service discovery by internet scan bots harder.
This commit is contained in:
Robin C. Ladiges 2024-04-27 17:32:17 +02:00
parent f51ef765e5
commit b418331a03
No known key found for this signature in database
GPG Key ID: B494D3DF92661B99
1 changed files with 5 additions and 3 deletions

View File

@ -138,9 +138,6 @@ public class Server {
Client client = new Client(socket) {Server = this};
var remote = socket.RemoteEndPoint;
IMemoryOwner<byte> memory = null!;
await client.Send(new InitPacket {
MaxPlayers = Settings.Instance.Server.MaxPlayers
});
bool first = true;
try {
@ -206,6 +203,11 @@ public class Server {
continue;
}
// send server init
await client.Send(new InitPacket {
MaxPlayers = Settings.Instance.Server.MaxPlayers,
});
bool wasFirst = connect.ConnectionType == ConnectPacket.ConnectionTypes.FirstConnection;
// add client to the set of connected players