[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-games-devel
Subject:    [Kde-games-devel] KGame patch
From:       Kleag <kleag () free ! fr>
Date:       2007-02-26 23:15:44
Message-ID: 200702270015.45067.kleag () free ! fr
[Download RAW message or body]

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
_______________________________________________
kde-games-devel mailing list
kde-games-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-games-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic