[Kde-games-devel] Why a KPlayer is not added ?

Kleag kleag at free.fr
Wed Jul 13 09:03:28 CEST 2005


Hi Andreas,

Thanks for you help. You found the solution. I thinked that player adding was 
asynchronous only for network players and thus did not connect to 
playerJoinedGame as I had only local players up to now. So, it was working 
just by chance... Note that I compiled KDE3.4.1 myself and now it works 
again... by chance :-)
I will correct the program to make things cleanly.

Le Mercredi 13 Juillet 2005 06:16, Andreas Beckermann a écrit :
> On Sunday 03 July 2005 22:40, Kleag wrote:
> Why do you think the player isn't added? "seems not to be added" is not very 
> descriptive...
I used exactly the method below to test the addition: creating player by 
passing the KGame to it and then using playerCount.

> >
> It could, yes. By default KGame messages work asynchronously, so
> kdDebug() << playerCount() << endl;
> addPlayer(newPlayer);
> kdDebug() << playerCount() << endl;
> will output the same playerCount() value twice. The "newPlayer" has not yet
> been added at this point.
> So you need to wait until the new player has been added (i.e.
> KGame::signalPlayerJoinedGame() got emitted)


Kleag
-- 
KsirK - a turn-based strategy game for KDE
http://gna.org/projects/ksirk

KGraphViewer - a GraphViz dot graphs viewer
http://gna.org/projects/kgraphviewer


More information about the kde-games-devel mailing list