diff --git a/client/networking.lisp b/client/networking.lisp index ad66491..10a37d2 100644 --- a/client/networking.lisp +++ b/client/networking.lisp @@ -26,7 +26,7 @@ ;; to the caller. Otherwise, they cause a crash. ;;TODO the client should handle errors gracefully (unless naledi-server ;XXX do this with exceptions - (return-from query-server "You are not connected to a server!")) + (error "You are not connected to a server!")) (let* ((servstr (usocket:socket-stream naledi-server)) (ig-errors (find ':ignore-errors request)) (req (string-from-list diff --git a/client/networking.lisp b/client/networking.lisp index ad66491..10a37d2 100644 --- a/client/networking.lisp +++ b/client/networking.lisp @@ -26,7 +26,7 @@ ;; to the caller. Otherwise, they cause a crash. ;;TODO the client should handle errors gracefully (unless naledi-server ;XXX do this with exceptions - (return-from query-server "You are not connected to a server!")) + (error "You are not connected to a server!")) (let* ((servstr (usocket:socket-stream naledi-server)) (ig-errors (find ':ignore-errors request)) (req (string-from-list diff --git a/client/user-interface.lisp b/client/user-interface.lisp index 107d7a0..49d908b 100644 --- a/client/user-interface.lisp +++ b/client/user-interface.lisp @@ -127,6 +127,7 @@ "Ask for username/password and log the user in" (let* ((uname (query-user scr "User name:" :cls T)) (upass (query-user scr "Password:" :cls T)) + ;;FIXME breaks on multi-word names (reply (query-server "login" uname upass ':ignore-errors))) (cond ((search "bad password" reply) (inform-user scr "Bad password!" T) @@ -168,10 +169,12 @@ ;;(#\c -> command console ;;(#\p -> pickup item ;;(#\i -> manage inventory - (#\q (disconnect) - ;;terminate if we're running a local game - (when (runningp) (terminate)) - (return-from croatoan:event-case)) + (#\q (if (user-confirm-p scr "Really quit?") + (progn (disconnect) + ;;terminate if we're running a local game + (when (runningp) (terminate)) + (return-from croatoan:event-case)) + (ui-update))) (#\n (set-popup 'NEWS) (ui-update)) ;;XXX How about moving diagonally? (:up (query-server "move n") (ui-update)) diff --git a/client/networking.lisp b/client/networking.lisp index ad66491..10a37d2 100644 --- a/client/networking.lisp +++ b/client/networking.lisp @@ -26,7 +26,7 @@ ;; to the caller. Otherwise, they cause a crash. ;;TODO the client should handle errors gracefully (unless naledi-server ;XXX do this with exceptions - (return-from query-server "You are not connected to a server!")) + (error "You are not connected to a server!")) (let* ((servstr (usocket:socket-stream naledi-server)) (ig-errors (find ':ignore-errors request)) (req (string-from-list diff --git a/client/user-interface.lisp b/client/user-interface.lisp index 107d7a0..49d908b 100644 --- a/client/user-interface.lisp +++ b/client/user-interface.lisp @@ -127,6 +127,7 @@ "Ask for username/password and log the user in" (let* ((uname (query-user scr "User name:" :cls T)) (upass (query-user scr "Password:" :cls T)) + ;;FIXME breaks on multi-word names (reply (query-server "login" uname upass ':ignore-errors))) (cond ((search "bad password" reply) (inform-user scr "Bad password!" T) @@ -168,10 +169,12 @@ ;;(#\c -> command console ;;(#\p -> pickup item ;;(#\i -> manage inventory - (#\q (disconnect) - ;;terminate if we're running a local game - (when (runningp) (terminate)) - (return-from croatoan:event-case)) + (#\q (if (user-confirm-p scr "Really quit?") + (progn (disconnect) + ;;terminate if we're running a local game + (when (runningp) (terminate)) + (return-from croatoan:event-case)) + (ui-update))) (#\n (set-popup 'NEWS) (ui-update)) ;;XXX How about moving diagonally? (:up (query-server "move n") (ui-update)) diff --git a/naledi.asd b/naledi.asd index 7051d2b..750f158 100644 --- a/naledi.asd +++ b/naledi.asd @@ -45,5 +45,6 @@ (:file "user-interface")))) :build-operation "program-op" ;;TODO builds in a cache directory - but `merge-pathnames' is not evaluated - :build-pathname "naledi" ;;(merge-pathnames "naledi" (uiop:getcwd)) + ;; -> probably requires a read macro, should be fixed with "#," + :build-pathname "naledi" ;;#,(merge-pathnames "naledi" (uiop:getcwd)) ;;"naledi" :entry-point "naledi:start-game")