On Sep 19, 2012, at 10:39 AM, Ido Ran <[email protected]<mailto:[email protected]>> wrote:
I want to build game using CouchApp. It's not sensitive data but I don't want very easy way to cheat. It sounds like you want both players to have their own local CouchDB, and they’ll replicate with each other? In general, with a peer-to-peer system where you don’t trust the other peers, you have to strictly validate any updates you receive. So if there’s a document representing the game state, you have to verify that the new revision represents a valid move made from the state of the old revision. Particularly important are that player turns have to alternate, and that a revision received in replication has to represent a move by the other player. (So the document schema has to include an indication of who made the last move.) It gets trickier if the board state is expressed by multiple documents, because then you can’t validate the entire move at once. It might not be feasible to do it that way. —Jens
