CSharpRedotTools / Multiplayer-2023-Old

Client + server template
MIT License
8 stars 2 forks source link

If 20 clients join the server then there is always exactly one client that says "x does not exist in Players" #16

Closed valkyrienyanko closed 1 year ago

valkyrienyanko commented 1 year ago

Untitled

valkyrienyanko commented 1 year ago
for (int i = 0; i < 15; i++)
    _ = Task.Run(async () =>
    {
        var client = new GameClient();
        client.Connect("localhost", 25565, ignoredPackets);

        while (!client.IsConnected)
            await Task.Delay(1);

        client.Send(new CPacketPlayerJoin { Username = "Fred" });

        while (true)
        {
            await Task.Delay(100);
            client.Send(new CPacketPlayerPosition
            {
                Position = new Vector2(GD.RandRange(100, 1000), GD.RandRange(50, 600))
            });
        }
    });