Update api

This commit is contained in:
Loic Guegan 2019-05-12 11:16:16 +02:00
parent 4ce40ee01d
commit 8cba94e081
4 changed files with 17 additions and 21 deletions

View file

@ -43,8 +43,9 @@
(let* ((game-id (create-game gm)))
(let ((game-dump (dump gm game-id)))
(setf (getf game-dump :game-over) :null) ; Define nil as null (for json)
(to-json
(append (list :type "state") game-dump))))))
(string-downcase
(to-json
(append (list :type "state") game-dump)))))))
(defmethod handle-update ((api api) data)
(with-slots (gm) api
@ -54,8 +55,9 @@
(if dir
(refresh game :dir dir)
(refresh game))
(to-json
(append (list :type "state") (dump gm game-id))))))
(string-downcase
(to-json
(append (list :type "state") (dump gm game-id)))))))
(defmethod handle-request ((api api) request)