[Kde-games-devel] KGame patch

Kleag kleag at free.fr
Tue Feb 27 00:15:44 CET 2007


Hello,

With KDE4, KsirK network mode was not working anymore (crash during network 
client connection). The following patch solves the problem for me but I would 
like to know if there is consequences on other games ?

Index: libkdegames/kgame/kgame.cpp
===================================================================
--- libkdegames/kgame/kgame.cpp (révision 636202)
+++ libkdegames/kgame/kgame.cpp (copie de travail)
@@ -232,6 +232,13 @@
  // If there is additional data to be loaded before players are loaded then 
do
  // this here.
  emit signalLoadPrePlayers(stream);
+
+ // Switch back on the direct emitting of signals and emit the
+ // queued signals for properties.
+ // Unlocks properties before loading players in order to make game
+ // initializations related to properties before using them in players
+ // initialization
+ dataHandler()->unlockDirectEmit();

  // Load Playerobjects
  uint playercount;
@@ -252,10 +259,9 @@
  }

  // Switch back on the direct emitting of signals and emit the
- // queued signals.
+ // queued signals for players.
  // Note we habe to have this external locking to prevent the games unlocking
  // to access the players
- dataHandler()->unlockDirectEmit();
  for ( player=playerList()->first(); player != 0; 
player=playerList()->next() )
  {
    player->dataHandler()->unlockDirectEmit();



Regards,

Kleag

P.S.: after the comments I add the last time I proposed to import KsirK, I 
decided to do a new refactoring cycle (removing global timer, etc.). This one 
is in its way. The game works localy with AI players (with human(s) or not) 
and it's starting to work in network mode. I hop it will soon be ready for 
playground.

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

KGraphViewer - a GraphViz dot graphs viewer
http://extragear.kde.org/apps/kgraphviewer


More information about the kde-games-devel mailing list