[Kde-games-devel] Two questions about kbattleship

Erik Sigra sigra at home.se
Tue Aug 5 08:32:09 CEST 2003


söndagen den 3 augusti 2003 05.02 skrev Nathan Humbert:
> On Friday 01 August 2003 06:41 pm, Henry W. Miller wrote:
> > On Sat, 2 Aug 2003, Albert 'TSDgeos' Astals Cid wrote:
> > > At 00:22 02/08/2003 +0200, you wrote:
> > > >Don't the programs exchange ship positions on game start?
> > >
> > > I've looked at the code and i'm almost sure they don't, each time you
> > > click on a map position the client sends a message asking if it has
> > > water or a ship and the other player answers. It is better that way,
> > > because if the ships positions were exchanged at game start you could
> > > use tcpdump or a similar utility and cheat the game.
> >
> > Of course now you can write a client that won't place ships until you
> > tell it to, or there is now only one possible way for the ships to be
> > placed given the shots already taken.
>
> Create an algorithem that will generate a string from the positions of the
> peices, run the string through MD5, send the hash to the other client,
> start the game.
> At the end of the game send the positions of all the ships, run the
> algorithem put it through MD5 and see if the hash from the begining of the
> game matches the one at the end...

Sounds good. Can you do it?



More information about the kde-games-devel mailing list