Some advances. TODO: test board.js, and then game.js, and then implement room.js
[vchess.git] / routes / playing.js
index 37592c9..7af0a1b 100644 (file)
@@ -90,12 +90,8 @@ router.get("/gamesbyplayer", access.logged, access.ajax, (req,res) => {
        });
 });
 
-// Load a rules page
-router.get("/rules/:variant([a-zA-Z0-9]+)", access.ajax, (req,res) => {
-       res.render("rules/" + req.params["variant"]);
-});
-
 // TODO: if newmove fail, takeback in GUI // TODO: check move structure
+// TODO: for corr games, move should contain an optional "message" field ("corr chat" !)
 router.post("/moves", access.logged, access.ajax, (req,res) => {
        let gid = ObjectId(req.body.gid);
        let fen = req.body.fen;
@@ -111,16 +107,4 @@ router.post("/moves", access.logged, access.ajax, (req,res) => {
        });
 });
 
-//TODO: if new chat fails, do not show chat message locally
-router.post("/chats", access.logged, access.ajax, (req,res) => {
-       let gid = ObjectId(req.body.gid);
-       let uid = ObjectId(req.body.uid);
-       let msg = req.body.msg; //TODO: sanitize HTML (strip all tags...)
-       GameModel.addChat(gid, uid, msg, (err,game) => {
-               access.checkRequest(res, err, game, "Cannot find game", () => {
-                       res.json({});
-               });
-       });
-});
-
 module.exports = router;