heinrich5991 / libtw2

Some Teeworlds stuff in Rust.™
Apache License 2.0
50 stars 16 forks source link

serverbrowse: Fix 0.7 is player flag #95

Closed ChillerDragon closed 6 months ago

ChillerDragon commented 6 months ago

closed https://github.com/ddnet/ddnet/issues/8277

From the teeworlds code:

pPacker->AddInt(GameServer()->IsClientPlayer(i)?0:1); // flag spectator=1, bot=2 (player=0)
ChillerDragon commented 6 months ago

untested

heinrich5991 commented 6 months ago

Although this might fix the issue, it's not the correct approach. The ClientInfo struct should contain all the information that is sent over the network. (Also the spectator thing is only a flag, so the check code is currently incorrect.)

ChillerDragon commented 6 months ago

Although this might fix the issue, it's not the correct approach. The ClientInfo struct should contain all the information that is sent over the network. (Also the spectator thing is only a flag, so the check code is currently incorrect.)

What are you saying? Make is_player an integer instead of a boolean? Then all information is kept. Or do you want 2 booleans? is_player, is_bot?

heinrich5991 commented 6 months ago

Wait, why does this modify 0.6 test code? 0.6 server info parsing isn't even affected by this bug.

heinrich5991 commented 6 months ago

What are you saying?

First check out the 0.7 client code to see why your proposed code isn't close to what the client needs to do.

Make is_player an integer instead of a boolean? Then all information is kept. Or do you want 2 booleans? is_player, is_bot?

Probably change the is_player field to flags and then set them correctly for both 0.6 and 0.7. We can model the flags after the 0.7 values.

heinrich5991 commented 6 months ago

(I'm also willing to fix this myself if you let me.)

ChillerDragon commented 6 months ago

(I'm also willing to fix this myself if you let me.)

Yes please. Thanks c: