I was sort of dreading implementing the move validation because it's a bit tedious. But then I had an idea - since the javascript I'm using to validate a PGN file already validates individual moves, I should be able to just hook into that somehow. I need to mention that my PGN validator, jChess 1.0, was written by Ben Marini - thank you, Ben, wherever you are, you saved me so much work! I didn't have to reorganize much in Ben's code, and I now have a new move validator. All my code had to do was generate a new move in algebraic notation format, pass it in to the jChess PGN move validator, and catch any exception. Ben's code doesn't actually trap bad moves, it just chokes on them - so I just catch the resulting exception to know that the move is no good. Could hardly have been easier - whew!
Next up - server coding!
Showing posts with label status. Show all posts
Showing posts with label status. Show all posts
Tuesday, January 24, 2012
Status Update
I did all my initial development a couple of weeks ago, then got heavily involved in a project at my real job that prevented me from touching Chess Juice since. So far I have the basic board rendering at any resolution up to 800x800, which should be plenty big for computers and tablets. I've got the PGN engine done that can parse and replay a PGN game on the board as well. The server side will be storing all the games as just vanilla PGN files with ancillary data (like timestamp of last move) in a database. Next up for the board code is to allow making/validating the next move.
I'm still working out how I want the communication with the server to work. I'll likely just send up the PGN text - that's the easy part. How to send a move back to the server is the part I'm wrestling with. Sending the move in straight PGN/algebraic notation is obvious enough, but should I protect this with some sort of encrypted data to keep anyone from trying to hack a game? Seems like a reasonable thing to do.
Here is a screenshot of the board pre-loaded with a sample PGN file (don't pay much attention to the look of this page yet, just the board):
I'm still working out how I want the communication with the server to work. I'll likely just send up the PGN text - that's the easy part. How to send a move back to the server is the part I'm wrestling with. Sending the move in straight PGN/algebraic notation is obvious enough, but should I protect this with some sort of encrypted data to keep anyone from trying to hack a game? Seems like a reasonable thing to do.
Here is a screenshot of the board pre-loaded with a sample PGN file (don't pay much attention to the look of this page yet, just the board):
Subscribe to:
Posts (Atom)