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

List:       kde-games-devel
Subject:    Re: [Kde-games-devel] Network operations class?
From:       Andreas Beckermann <b_mann () gmx ! de>
Date:       2001-04-16 19:55:44
[Download RAW message or body]

On Monday 16 April 2001 20:41, Rob Kaper wrote:
[...]
> > The library shold be in a usable state as soon as my port has been
> > completed (removePlayer() is one of the tasks left and after that "only"
> > bug fixing, IIRC).
>
> I'll take a look then.. all I need from it is a way to connect to a server
> and exchange messages, I'd like to keep my own player/game handling.
> (because it's a dedicated server, all that stuff goes in the server, the
> client is nothing more than a way to display and modify game status)
>
> Rob

Maybe the KGameConnectDialog could be of interest to you. Nothing big - just 
a small dialog to query host and port. Just to keep a little bit default 
behaviour between the games :-)
I haven't changed this class for quite a while so I guess it is completed.

For game communication: well look if you can use KGameClient.
It will probably change as soon as Burkhard brings in his changes to the 
socket communication but I hope the API will stay. 
Usage: create a KGameClientSocket and/or KGameClient local on both sides (see 
KGameCommunicationServer and KGameNetwork code for an implementation) and you 
have a connection. For socket you will have to start a server (KServerSocket) 
to get a connection.
Then call sendMessage() to send your QByteArray or QDataStream message. See 
QT Docu for QDataStreams. The other client will emit signalSendMesage and 
that's it. 
So far it is working extremely stable. The problems are currently in player 
and game handling - the stuff you don't want to use...

The QDataStream stuff will probably change, too as Niko (the author of 
KBattleship) wants to use his xml messages. So I will (or Niko: do you want?) 
one day implement an overloaded sendMessage (and signalReceiveMessage) which 
takes xml as arguments.
But that's for future use.

CU
Andi
_______________________________________________
Kde-games-devel mailing list
Kde-games-devel@master.kde.org
http://master.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