Compare commits
3 Commits
48ba912d52
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 47acd93cfc | |||
| b234753eb8 | |||
| 325ae98cab |
@@ -9,14 +9,8 @@
|
|||||||
|
|
||||||
#+linux
|
#+linux
|
||||||
(progn
|
(progn
|
||||||
(labels ((all-subdirectories (path)
|
;; NOTE(grant): uiop:getcwd is provided by asdf
|
||||||
(let ((subdirs (uiop:subdirectories path)))
|
(asdf:initialize-source-registry `(:source-registry (:tree ,(uiop:getcwd)) :inherit-configuration))
|
||||||
(append subdirs
|
|
||||||
(mapcan #'all-subdirectories subdirs)))))
|
|
||||||
(setf asdf:*central-registry*
|
|
||||||
(list* #p"/build/"
|
|
||||||
(all-subdirectories "ocicl"))))
|
|
||||||
|
|
||||||
(asdf:load-system :lispostory))
|
(asdf:load-system :lispostory))
|
||||||
|
|
||||||
#+linux
|
#+linux
|
||||||
|
|||||||
21
main.lisp
21
main.lisp
@@ -5,7 +5,7 @@
|
|||||||
(defparameter *chronostory-gacha-url-format "https://chronostory.onrender.com/api/gacha-items?gachaId=~a")
|
(defparameter *chronostory-gacha-url-format "https://chronostory.onrender.com/api/gacha-items?gachaId=~a")
|
||||||
|
|
||||||
(defun print-version-information ()
|
(defun print-version-information ()
|
||||||
(let* ((program-name (car sb-ext:*posix-argv*))
|
(let* ((program-name (car (uiop:raw-command-line-arguments)))
|
||||||
(write-time (file-write-date program-name)))
|
(write-time (file-write-date program-name)))
|
||||||
(multiple-value-bind (second minute hour date month year)
|
(multiple-value-bind (second minute hour date month year)
|
||||||
(decode-universal-time write-time)
|
(decode-universal-time write-time)
|
||||||
@@ -27,9 +27,16 @@
|
|||||||
("mobs" (refresh (maybe-pass #'make-mob-data-source maybe-file-path)))
|
("mobs" (refresh (maybe-pass #'make-mob-data-source maybe-file-path)))
|
||||||
("spawns" (refresh (maybe-pass #'make-spawn-data-source maybe-file-path)))))
|
("spawns" (refresh (maybe-pass #'make-spawn-data-source maybe-file-path)))))
|
||||||
|
|
||||||
|
(defun disable-debugger ()
|
||||||
|
(setf *debugger-hook*
|
||||||
|
(lambda (condition hook)
|
||||||
|
(declare (ignore hook))
|
||||||
|
(format t "Unhandled error: ~a~%" condition)
|
||||||
|
(uiop:quit 1))))
|
||||||
|
|
||||||
(defun main ()
|
(defun main ()
|
||||||
(sb-ext:disable-debugger)
|
(disable-debugger)
|
||||||
(let ((args (rest sb-ext:*posix-argv*)))
|
(let ((args (uiop:raw-command-line-arguments)))
|
||||||
(when (find-string "--fail" args)
|
(when (find-string "--fail" args)
|
||||||
(error "Simulated error!"))
|
(error "Simulated error!"))
|
||||||
(when (find-string "--version" args)
|
(when (find-string "--version" args)
|
||||||
@@ -39,11 +46,12 @@
|
|||||||
(refresh-data arg maybe-file-path)))))
|
(refresh-data arg maybe-file-path)))))
|
||||||
|
|
||||||
(defun create-exe-and-die ()
|
(defun create-exe-and-die ()
|
||||||
(sb-ext:save-lisp-and-die
|
#+sbcl (sb-ext:save-lisp-and-die
|
||||||
"lispostory"
|
"lispostory"
|
||||||
:toplevel 'lispostory:main
|
:toplevel 'lispostory:main
|
||||||
:executable t
|
:executable t
|
||||||
:save-runtime-options :accept-runtime-options))
|
:save-runtime-options :accept-runtime-options
|
||||||
|
:compression t))
|
||||||
|
|
||||||
(comment
|
(comment
|
||||||
(maybe-pass #'make-spawn-data-source (get-arg "--output" '("/root/lispostory/lispostory" "refresh" "spawns" "--output" "/root/api/chronostory/spawns.json")))
|
(maybe-pass #'make-spawn-data-source (get-arg "--output" '("/root/lispostory/lispostory" "refresh" "spawns" "--output" "/root/api/chronostory/spawns.json")))
|
||||||
@@ -66,8 +74,6 @@
|
|||||||
mobs) "mob" "mob_name"))))
|
mobs) "mob" "mob_name"))))
|
||||||
(coerce (data (make-drop-data-source)) 'list)))
|
(coerce (data (make-drop-data-source)) 'list)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(reload-item-data
|
(reload-item-data
|
||||||
(filter-map
|
(filter-map
|
||||||
(lambda (m)
|
(lambda (m)
|
||||||
@@ -76,6 +82,5 @@
|
|||||||
(gethash "ITEMNAME" m))
|
(gethash "ITEMNAME" m))
|
||||||
(coerce *chronostory-drops* 'list)
|
(coerce *chronostory-drops* 'list)
|
||||||
|
|
||||||
|
|
||||||
(hash-table-keys (aref (@ *chronostory-spawns* :el-nath) 0))
|
(hash-table-keys (aref (@ *chronostory-spawns* :el-nath) 0))
|
||||||
(hash-table-keys (aref *chronostory-drops* 0))))))
|
(hash-table-keys (aref *chronostory-drops* 0))))))
|
||||||
|
|||||||
@@ -29,8 +29,9 @@
|
|||||||
(defun string->bool (s)
|
(defun string->bool (s)
|
||||||
(if (string-equal (string-downcase s) "true") t nil))
|
(if (string-equal (string-downcase s) "true") t nil))
|
||||||
|
|
||||||
|
|
||||||
(defun find-string (str seq)
|
(defun find-string (str seq)
|
||||||
(sequence:find str seq :test #'string-equal))
|
(find str seq :test #'string-equal))
|
||||||
|
|
||||||
(defclass data-source ()
|
(defclass data-source ()
|
||||||
((cache :initform nil :accessor cache)
|
((cache :initform nil :accessor cache)
|
||||||
|
|||||||
Reference in New Issue
Block a user