Tomash667 / carpg

Combination of action rpg with roguelike.
https://carpg.pl
MIT License
16 stars 15 forks source link

MP problems with Clients with wrong data CRC sum at MP Server selection / game start #429

Closed BottledByte closed 4 years ago

BottledByte commented 4 years ago

Game version: 0.13

There is a bug in multiplayer server/client communication while selecting server if one of the clients has wrong CRC checksum of its data.

When Server creates a new game on LAN (I did not tested it if Internet lobby is being used) and client tries to join, it can see that there is 1 gamer (Server). If the client has different data / CRC ("Bad Client"), it can not connect. It gets rejected, but the number of players increases. If the client tries to join one more time, SLikeNet error pops up. Other clients seeing the server in available servers screen can see that there is more players then really is. Even if this faked number reaches max player cap, client with good CRC checksum may join ("Good Client"). However, when Bad Client tries to join one more time, and CRC invalidity gets reported, all Good Clients will see Server player disappear from player list, but server capacity seen at all the clients suggests that both Server and Bad Client are in. Server see that it is in and Bad Client is not. When starting the game in this state, where Good Clients can't see the Server player, all Good Clients got kicked, with message "Error while reading level data".

scree

Additional context: I tested this with 2 and 3 Clients (2 Good Clients, 1 Bad).

Tomash667 commented 4 years ago

Fixed in 0.14.

In next version I'll try to improve it a bit, to not show this temporary player for a split second before he gets kicked.