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
(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
(: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)
@ -25,7 +25,7 @@
(unwind-protect
(progn
(loop
(format stream "~a~%" (get-value 'pos))
(format stream "~a~%" (com.inuoe.jzon:stringify (get-value 'pos)))
(force-output stream)
(usocket:wait-for-input socket)
(format t "from server: ~a~%" (read-line stream)))))
@ -43,8 +43,6 @@
:projection :camera-perspective))
(cube-screen-pos (vec 0.0 0.0)))
(add-entry 'pos (camera3d-target camera))
(with-window (screen-width screen-height title)
(disable-cursor)
(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
do
(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))
(with-drawing
(clear-background :raywhite)

View File

@ -1,8 +1,8 @@
(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
(: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)