[Kde-games-devel] KGame bug?

Andreas Beckermann b_mann at gmx.de
Thu Apr 5 15:58:47 UTC 2012


On Thursday 05 April 2012, Zsuró Tibor wrote:
> Hello

Hi

> I want use the 'bool connectToServer( QString, int )' function in
> KGame(KGameNetwork) class, to connect to server. If the server is not run
> or the ip address is incorrect, always return true.
> 
> In the API: "Returns: true if connected".
> 
> This is bug?
> 
> I want show error messagge, when the connection is fail.

Looking at the code, I'd say it's a lack of documentation. A comment in the 
code:

 // OK: We say that we already have connected, but this isn't so yet!
 // If the connection cannot be established, it will look as being 
disconnected
 // again ("slotConnectionLost" is called).
 // Shall we differ between these?

So it seems to me that the code merely returns true here if the connection was 
initiated (not established) successfully and once the host not reachable (or 
whatever) message is received, the connection is considered "lost".
So KGameNetwork should emit the signalConnectionBroken() signal then.

btw: The KGame library of libkdegames is unmaintained these days, I recommend 
against using it in new games. In fact it is supposed to be moved out of 
libkdegames for that very reason, see
http://community.kde.org/KDE_Games/API_cleanup
and the recent discussion of this on this list.

> Zsuró Tibor

Greetings
Andi


More information about the kde-games-devel mailing list