Link to home
Start Free TrialLog in
Avatar of James Hancock
James HancockFlag for United States of America

asked on

Help me plan my Java chess engine.

Hi
I'm trying to perfect my streams chess client server.
I've had some bad luck doing a board out of an 8x8 of characters, and I'm backing away from that, because chess servers out there prefer an 8x8 of piece objects. I still make the mistake of early 80's (4/5 years old) non-object-oriented thinking, occasionally. Some short-cuts are long-cuts.
I have no problems with move generation. In fact, I find that enjoyable. I want this to be all my own code, in case I move it to Python, - it will be totally smooth 4 me.
So,
I can maintain the state on my server and send legalMove objects to the clients.
For protection from hackers, if I go mobile with this project. - I'd like the clients to respond w the index of the legal move they choose to make. Hacking is a concern 4 if I go towards prizes and such.
Do I send the legal moves objects (and board) as an objectOutputStream, or a self-made block of legal move data? - maybe a DataOutputStream byte array
That I re-assemble on the client? I could do a thing where I send only object-to-move -and-destination data, and never the pieces, as they should always be correct on the client.
Would the clients need to know all the squares of the path of the move? Some examples do an 8x8 of square objects, where each square can hold a color and a piece.
?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of gelonida
gelonida
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if https / ssl is not a possible option, then things get a little trickier.

Ideally you'd use an asymmetric encryption algorithm to either exchange an encryption cypher for each channel so, that the entire communication would be encrypted.

Alternatively you could use the asymmetric keys to exchange each message in clear text but to sign each message (meaning nobody else could have sent it)

It's more difficult to get right than just using https. but it is also possible.
Avatar of James Hancock

ASKER

Thanks.