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