Bug 55747

Summary: Players list not updated when removing AI
Product: [Applications] boson Reporter: Rivo Laks <rivolaks>
Component: generalAssignee: The Boson Team <boson-bugs>
Status: RESOLVED FIXED    
Severity: grave    
Priority: HI    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Rivo Laks 2003-03-09 17:09:02 UTC
Version:            (using KDE 3.1.1)
Installed from:    compiled sources
Compiler:          gcc version 3.2.1
OS:          Linux (i686) release 2.4.18

Start 2 clients, start network game on the first one and join it with the other one. Then add AI on the first client and then remove it. Players list is not updated on the second client.

Rivo
Comment 1 Andreas Beckermann 2003-03-13 15:22:26 UTC
Thats a very evil KGame bug, good found! 
The ID of the new AI player is *not* set when IdAddPlayer is sent through network, so it 
still has ID 0 when both KGame clients receive the (saved) player. 
 
But ID 0 means that it is a local player, i.e. the KGame object assign an ID to the new player. 
Of course these IDs will differ on both clients, as the player IDs are composed of a player ID 
and the KGame ID. 
I think the fix would be to call KPlayer::setId() before actually sending IdAddPlayer, but I 
am not sure whether there might be unexpected side effects. I'm on it (and have sent a mail 
to another KGame author on this). 
 
CU 
Andi 
 
Comment 2 Andreas Beckermann 2003-03-17 19:41:30 UTC
UPDATE: 
This bug is now fixed in current KGame. Update to KDE CVS if you want it to be fixed asap. 
 
I do not yet close this bug, as it must be fixed for other KGame versions too, i.e. I will write 
a workaround in our code for that. 
 
CU 
Andi 
 
Comment 3 Felix Seeger 2003-05-05 20:42:39 UTC
I am running cvs head and the ai player even doesn't reach the server. I can add 4 ai players for a 2 
Player game. Both are not visible on the server. 
 
Removing works for all except the last ai player, and hard adding/removing results in a crash.  
Comment 4 Rivo Laks 2003-10-22 16:15:18 UTC
Looks like it has been fixed in CVS. At least it works fine here.

Rivo