Add jzon to serialize data

This commit is contained in:
zongor 2023-12-31 16:00:52 -05:00
parent 1efecbd0c6
commit 36618a500c
2 changed files with 6 additions and 8 deletions

View File

@ -1,8 +1,8 @@
(load "~/quicklisp/setup.lisp") ; need to load quicklisp (load "~/quicklisp/setup.lisp") ; need to load quicklisp
(ql:quickload '(:cl-raylib :cl-bcrypt :usocket :bordeaux-threads :alexandria)) (ql:quickload '(:cl-raylib :cl-bcrypt :usocket :bordeaux-threads :alexandria :com.inuoe.jzon))
(defpackage :mmo-client (defpackage :mmo-client
(:use :common-lisp :cl-raylib :3d-vectors :usocket :bordeaux-threads :alexandria)) (:use :common-lisp :cl-raylib :3d-vectors :usocket :bordeaux-threads :alexandria :com.inuoe.jzon))
(in-package :mmo-client) (in-package :mmo-client)
@ -25,7 +25,7 @@
(unwind-protect (unwind-protect
(progn (progn
(loop (loop
(format stream "~a~%" (get-value 'pos)) (format stream "~a~%" (com.inuoe.jzon:stringify (get-value 'pos)))
(force-output stream) (force-output stream)
(usocket:wait-for-input socket) (usocket:wait-for-input socket)
(format t "from server: ~a~%" (read-line stream))))) (format t "from server: ~a~%" (read-line stream)))))
@ -43,8 +43,6 @@
:projection :camera-perspective)) :projection :camera-perspective))
(cube-screen-pos (vec 0.0 0.0))) (cube-screen-pos (vec 0.0 0.0)))
(add-entry 'pos (camera3d-target camera))
(with-window (screen-width screen-height title) (with-window (screen-width screen-height title)
(disable-cursor) (disable-cursor)
(set-target-fps 60) ; Set our game to run at 60 FPS (set-target-fps 60) ; Set our game to run at 60 FPS
@ -52,7 +50,7 @@
until (window-should-close) ; detect window close button or ESC key until (window-should-close) ; detect window close button or ESC key
do do
(update-camera camera :camera-third-person) (update-camera camera :camera-third-person)
(add-entry 'pos (camera3d-target camera)) (add-entry 'pos (list (camera3d-target camera) username :red :move))
(setf cube-screen-pos (get-world-to-screen (v+ (camera3d-target camera) (vec 0 1.0 0)) camera)) (setf cube-screen-pos (get-world-to-screen (v+ (camera3d-target camera) (vec 0 1.0 0)) camera))
(with-drawing (with-drawing
(clear-background :raywhite) (clear-background :raywhite)

View File

@ -1,8 +1,8 @@
(load "~/quicklisp/setup.lisp") (load "~/quicklisp/setup.lisp")
(ql:quickload '(:usocket :bordeaux-threads :cl-bcrypt :datafly :sxql :alexandria)) (ql:quickload '(:usocket :bordeaux-threads :cl-bcrypt :datafly :sxql :alexandria :com.inuoe.jzon))
(defpackage :mmo-server (defpackage :mmo-server
(:use :common-lisp :usocket :bordeaux-threads :cl-bcrypt :datafly :sxql :alexandria)) (:use :common-lisp :usocket :bordeaux-threads :cl-bcrypt :datafly :sxql :alexandria :com.inuoe.jzon))
(in-package :mmo-server) (in-package :mmo-server)