* added: datetime
*/
-const GameModel =
-{
+const GameModel = {
+
checkGameInfo: function(g) {
return (
g.vid.toString().match(/^[0-9]+$/) &&
);
},
+ incrementCounter: function(vid, cb) {
+ db.serialize(function() {
+ let query =
+ "UPDATE GameStat " +
+ "SET total = total + 1 " +
+ "WHERE vid = " + vid;
+ db.run(query, cb);
+ });
+ },
+
create: function(vid, fen, randomness, cadence, players, cb) {
db.serialize(function() {
let query =
});
});
}
-}
+
+};
module.exports = GameModel;