diff --git a/.gitignore b/.gitignore index 9839557..3494b50 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ naledi.log +usocket_minimal.lisp diff --git a/.gitignore b/.gitignore index 9839557..3494b50 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ naledi.log +usocket_minimal.lisp diff --git a/README.md b/README.md index a03c806..655d6c5 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,18 @@ Note that these requirements limit the game to Linux. Download the latest source code from [https://git.synoikos.de/daniel/naledi](). -Then open up a REPL and run `(load "naledi.lisp")`. +Copy/symlink it into your Quicklisp `local_projects` directory. Then open up a +REPL and run `(ql:quickload "naledi")`. Finally, you can start a local game with +`(naledi:start-game)`, or alternately a server with `(naledi:start-server)`. Once Naledi ya Africa is ready for release, a pre-compiled binary will be supplied. ## Playing -Refer to the game manual (MANUAL file in the source code, or type `h` in-game). +Refer to the game manual (MANUAL file in the source code, or type `h` in-game). *TODO* --- -*Licensed under the terms of the MIT license.* +*Licensed under the terms of the MIT license.* © 2018 Daniel Vedder diff --git a/.gitignore b/.gitignore index 9839557..3494b50 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ naledi.log +usocket_minimal.lisp diff --git a/README.md b/README.md index a03c806..655d6c5 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,18 @@ Note that these requirements limit the game to Linux. Download the latest source code from [https://git.synoikos.de/daniel/naledi](). -Then open up a REPL and run `(load "naledi.lisp")`. +Copy/symlink it into your Quicklisp `local_projects` directory. Then open up a +REPL and run `(ql:quickload "naledi")`. Finally, you can start a local game with +`(naledi:start-game)`, or alternately a server with `(naledi:start-server)`. Once Naledi ya Africa is ready for release, a pre-compiled binary will be supplied. ## Playing -Refer to the game manual (MANUAL file in the source code, or type `h` in-game). +Refer to the game manual (MANUAL file in the source code, or type `h` in-game). *TODO* --- -*Licensed under the terms of the MIT license.* +*Licensed under the terms of the MIT license.* © 2018 Daniel Vedder diff --git a/package.lisp b/package.lisp index 164381d..e66ce0b 100644 --- a/package.lisp +++ b/package.lisp @@ -11,12 +11,21 @@ (:documentation "A multiplayer survival game set in Africa.") (:nicknames :naledi :nya) (:use :common-lisp) + ;;XXX export anything else? (:export - ;;XXX export anything else? + ;; standard game function start-game + ;; server functions start-server + runningp + age-of-the-world terminate init-world + ;; client functions - use with caution! + ;; XXX security risk? connect-server query-server disconnect)) + +;;convenience function +(defun start () (nya:start-game)) diff --git a/.gitignore b/.gitignore index 9839557..3494b50 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ naledi.log +usocket_minimal.lisp diff --git a/README.md b/README.md index a03c806..655d6c5 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,18 @@ Note that these requirements limit the game to Linux. Download the latest source code from [https://git.synoikos.de/daniel/naledi](). -Then open up a REPL and run `(load "naledi.lisp")`. +Copy/symlink it into your Quicklisp `local_projects` directory. Then open up a +REPL and run `(ql:quickload "naledi")`. Finally, you can start a local game with +`(naledi:start-game)`, or alternately a server with `(naledi:start-server)`. Once Naledi ya Africa is ready for release, a pre-compiled binary will be supplied. ## Playing -Refer to the game manual (MANUAL file in the source code, or type `h` in-game). +Refer to the game manual (MANUAL file in the source code, or type `h` in-game). *TODO* --- -*Licensed under the terms of the MIT license.* +*Licensed under the terms of the MIT license.* © 2018 Daniel Vedder diff --git a/package.lisp b/package.lisp index 164381d..e66ce0b 100644 --- a/package.lisp +++ b/package.lisp @@ -11,12 +11,21 @@ (:documentation "A multiplayer survival game set in Africa.") (:nicknames :naledi :nya) (:use :common-lisp) + ;;XXX export anything else? (:export - ;;XXX export anything else? + ;; standard game function start-game + ;; server functions start-server + runningp + age-of-the-world terminate init-world + ;; client functions - use with caution! + ;; XXX security risk? connect-server query-server disconnect)) + +;;convenience function +(defun start () (nya:start-game)) diff --git a/src/params.lisp b/src/params.lisp index 329904f..1a1f8bb 100644 --- a/src/params.lisp +++ b/src/params.lisp @@ -13,7 +13,7 @@ (defparameter *debugging* T) ;;Specify the logfile -(defparameter *logfile* "../naledi.log") +(defparameter *logfile* "naledi.log") ;;Size of the world (= length of one side of a square) (defparameter *world-size* 250) diff --git a/.gitignore b/.gitignore index 9839557..3494b50 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ naledi.log +usocket_minimal.lisp diff --git a/README.md b/README.md index a03c806..655d6c5 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,18 @@ Note that these requirements limit the game to Linux. Download the latest source code from [https://git.synoikos.de/daniel/naledi](). -Then open up a REPL and run `(load "naledi.lisp")`. +Copy/symlink it into your Quicklisp `local_projects` directory. Then open up a +REPL and run `(ql:quickload "naledi")`. Finally, you can start a local game with +`(naledi:start-game)`, or alternately a server with `(naledi:start-server)`. Once Naledi ya Africa is ready for release, a pre-compiled binary will be supplied. ## Playing -Refer to the game manual (MANUAL file in the source code, or type `h` in-game). +Refer to the game manual (MANUAL file in the source code, or type `h` in-game). *TODO* --- -*Licensed under the terms of the MIT license.* +*Licensed under the terms of the MIT license.* © 2018 Daniel Vedder diff --git a/package.lisp b/package.lisp index 164381d..e66ce0b 100644 --- a/package.lisp +++ b/package.lisp @@ -11,12 +11,21 @@ (:documentation "A multiplayer survival game set in Africa.") (:nicknames :naledi :nya) (:use :common-lisp) + ;;XXX export anything else? (:export - ;;XXX export anything else? + ;; standard game function start-game + ;; server functions start-server + runningp + age-of-the-world terminate init-world + ;; client functions - use with caution! + ;; XXX security risk? connect-server query-server disconnect)) + +;;convenience function +(defun start () (nya:start-game)) diff --git a/src/params.lisp b/src/params.lisp index 329904f..1a1f8bb 100644 --- a/src/params.lisp +++ b/src/params.lisp @@ -13,7 +13,7 @@ (defparameter *debugging* T) ;;Specify the logfile -(defparameter *logfile* "../naledi.log") +(defparameter *logfile* "naledi.log") ;;Size of the world (= length of one side of a square) (defparameter *world-size* 250) diff --git a/src/server.lisp b/src/server.lisp index fa4d470..00f9a5a 100644 --- a/src/server.lisp +++ b/src/server.lisp @@ -48,11 +48,12 @@ (let ((uptime 0) (world-thread NIL) (server-thread NIL) (player-threads NIL) (running NIL)) - (defun start-server (&optional (force NIL)) + (defun start-server (&optional (force T)) "Start the game server" ;;TODO cannot restart -> ADDRESS-IN-USE ERROR ;; -> comes from not closing connections properly? ;;FIXME causes Naledi to hang on `q' -> Is this really the problem? + ;;XXX change force back to NIL? (when force (reset-server-threads) (reset-world-age)) @@ -62,9 +63,11 @@ (setf world-thread (bt:make-thread #'update-loop :name "world-thread")) (setf server-thread - (bt:make-thread #'run-server :name "server-thread")))) + (bt:make-thread #'run-server :name "server-thread")) + (notify "Server initialized."))) (defun terminate () + ;;TODO do some error catching if the threads no longer exist (notify "Terminating the world.") (setf running NIL) ;;XXX have to use destroy-thread because the server mostly idles,