From 54e14006564ff34c8249b9ddb357201759d77101 Mon Sep 17 00:00:00 2001 From: Gerd Flaig Date: Mon, 9 Jan 2012 23:15:40 +0100 Subject: [PATCH] Add a game state log dumping facility that produces a (load)able sexpr-log. Example: (setf *my-parser* (xdump:make-parser)) (xdump:with-parser *my-parser* (load "testdata/gamestate-1")) --- empire.lisp | 9 +- log.lisp | 7 + package.lisp | 5 +- testdata/gamestate-1 | 858 +++++++++++++++++++++++++++++++++++++++++++ xdump.lisp | 58 ++- 5 files changed, 914 insertions(+), 23 deletions(-) create mode 100644 testdata/gamestate-1 diff --git a/empire.lisp b/empire.lisp index 7ac17d4..f4fb8b2 100644 --- a/empire.lisp +++ b/empire.lisp @@ -351,11 +351,14 @@ (if (and (<= dump-index (fill-pointer dump-queue)) (not (null (aref dump-queue dump-index)))) (send-message connection (format nil "xdump meta ~a" (xdump-data:name (aref dump-queue dump-index)))))) - (set-new-mode (connection-mode connection) 'play-mode)))))))) + (progn + (xdump:checkpoint) + (set-new-mode (connection-mode connection) 'play-mode))))))))) (defmethod special-xup ((c connection)) - (setf (xdump c) (xdump:make-parser)) - (send-message c "xdump meta meta" :next-mode 'xdump-mode)) + (let ((user-log (empire-log:open-user-log (user c)))) + (setf (xdump c) (xdump:make-parser :user-log user-log)) + (send-message c "xdump meta meta" :next-mode 'xdump-mode))) (defmethod special-command ((c connection) line) (cond ((string= line "xup") (special-xup c)) diff --git a/log.lisp b/log.lisp index 478e372..8aeec2f 100644 --- a/log.lisp +++ b/log.lisp @@ -1,6 +1,13 @@ (in-package :empire-log) +(defvar *user-log-path* #p"/tmp/") + (defun info (&rest args) (apply #'format *standard-output* args) (terpri *standard-output*)) +(defun user-log-path (user-name) + (make-pathname :defaults *user-log-prefix* :name user-name)) + +(defun open-user-log (user-name) + (open (user-log-path user-name) :direction :output :if-exists :supersede)) diff --git a/package.lisp b/package.lisp index 1eafd00..ff6e59b 100644 --- a/package.lisp +++ b/package.lisp @@ -20,12 +20,13 @@ (:export :start :send :prompt :data)) (defpackage :empire-log (:use :cl) - (:export :info)) + (:export :info :open-user-log)) (defpackage :xdump-data (:use :cl) (:export :name)) (defpackage :xdump (:use :cl) - (:export :make-parser :with-parser :parse-line :table :get-table-entry)) + (:export :make-parser :with-parser :parse-line :table :get-table-entry + :checkpoint)) (defpackage :empire-tests (:use :cl :lift))) diff --git a/testdata/gamestate-1 b/testdata/gamestate-1 new file mode 100644 index 0000000..f5c518e --- /dev/null +++ b/testdata/gamestate-1 @@ -0,0 +1,858 @@ + +(XDUMP::DEFINE-META-TABLE + #(("name" 3 4 0 -1) ("type" 4 4 0 34) ("flags" 5 12 0 33) ("len" 7 4 0 -1) + ("table" 8 4 0 -1))) +(XDUMP::DEFINE-TABLE "table" #(("uid" 8 0 0 27) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "table" 1326142920 + #((0 "sect") (1 "ship") (2 "plane") (3 "land") (4 "nuke") + (5 "news") (6 "treaty") (7 "trade") (9 "nat") (10 "loan") + (13 "commodity") (14 "lost") (15 "realm") (16 "game") + (17 "item") (18 "product") (19 "sect-chr") (20 "ship-chr") + (21 "plane-chr") (22 "land-chr") (23 "nuke-chr") + (24 "news-chr") (25 "infrastructure") (26 "updates") + (27 "table") (28 "version") (29 "meta") + (30 "agreement-status") (31 "land-chr-flags") (32 "level") + (33 "meta-flags") (34 "meta-type") (35 "missions") + (36 "nation-flags") (37 "nation-rejects") + (38 "nation-relationships") (39 "nation-status") + (40 "nuke-chr-flags") (41 "packing") (42 "page-headings") + (43 "plague-stages") (44 "plane-chr-flags") + (45 "plane-flags") (46 "resources") (47 "retreat-flags") + (48 "sector-navigation") (49 "ship-chr-flags") + (50 "treaty-flags") (51 "country"))) +(XDUMP::DEFINE-TABLE "meta-type" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "meta-type" 1326142920 + #((1 "d") (2 "g") (3 "s") (4 "d") (5 "d") (6 "d") (7 "d") + (8 "d") (9 "d") (10 "d") (11 "d") (12 "d") (13 "g") + (14 "c"))) +(XDUMP::DEFINE-TABLE "sect" + #(("owner" 5 0 0 9) ("xloc" 9 4 0 -1) ("yloc" 10 4 0 -1) + ("des" 4 0 0 19) ("effic" 4 0 0 -1) ("mobil" 4 0 0 -1) + ("off" 5 0 0 -1) ("terr0" 5 0 0 -1) ("terr1" 5 0 0 -1) + ("terr2" 5 0 0 -1) ("terr3" 5 0 0 -1) ("xdist" 9 0 0 -1) + ("ydist" 10 0 0 -1) ("avail" 6 0 0 -1) ("work" 5 0 0 -1) + ("coastal" 5 0 0 -1) ("newdes" 4 0 0 19) + ("min" 5 0 0 -1) ("gold" 5 0 0 -1) ("fert" 5 0 0 -1) + ("ocontent" 5 0 0 -1) ("uran" 5 0 0 -1) + ("oldown" 5 0 0 9) ("civil" 6 0 0 -1) ("milit" 6 0 0 -1) + ("shell" 6 0 0 -1) ("gun" 6 0 0 -1) ("petrol" 6 0 0 -1) + ("iron" 6 0 0 -1) ("dust" 6 0 0 -1) ("bar" 6 0 0 -1) + ("food" 6 0 0 -1) ("oil" 6 0 0 -1) ("lcm" 6 0 0 -1) + ("hcm" 6 0 0 -1) ("uw" 6 0 0 -1) ("rad" 6 0 0 -1) + ("c_dist" 6 0 0 -1) ("m_dist" 6 0 0 -1) + ("s_dist" 6 0 0 -1) ("g_dist" 6 0 0 -1) + ("p_dist" 6 0 0 -1) ("i_dist" 6 0 0 -1) + ("d_dist" 6 0 0 -1) ("b_dist" 6 0 0 -1) + ("f_dist" 6 0 0 -1) ("o_dist" 6 0 0 -1) + ("l_dist" 6 0 0 -1) ("h_dist" 6 0 0 -1) + ("u_dist" 6 0 0 -1) ("r_dist" 6 0 0 -1) + ("c_del" 6 0 0 -1) ("m_del" 6 0 0 -1) ("s_del" 6 0 0 -1) + ("g_del" 6 0 0 -1) ("p_del" 6 0 0 -1) ("i_del" 6 0 0 -1) + ("d_del" 6 0 0 -1) ("b_del" 6 0 0 -1) ("f_del" 6 0 0 -1) + ("o_del" 6 0 0 -1) ("l_del" 6 0 0 -1) ("h_del" 6 0 0 -1) + ("u_del" 6 0 0 -1) ("r_del" 6 0 0 -1) + ("fallout" 7 0 0 -1) ("access" 6 0 0 -1) + ("road" 5 0 0 -1) ("rail" 5 0 0 -1) ("dfense" 5 0 0 -1))) +(XDUMP::LOAD-TABLE "sect" 1326142920 + #((1 -1 -1 4 0 60 0 0 0 0 0 -1 -1 0 100 0 4 100 65 0 0 88 1 + 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) + (1 1 -1 4 0 60 0 0 0 0 0 1 -1 0 100 0 4 100 80 0 0 100 1 0 + 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) + (1 0 0 5 100 127 0 0 0 0 0 0 0 664 100 1 5 100 100 100 100 + 100 1 1000 52 0 0 0 0 0 0 0 0 0 0 87 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) + (1 2 0 5 100 127 0 0 0 0 0 2 0 664 100 0 5 100 100 100 100 + 100 1 1000 55 0 0 0 0 0 0 0 0 0 0 86 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) + (1 1 1 4 0 60 0 0 0 0 0 1 1 0 100 1 4 91 56 0 0 68 1 0 1 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0))) +(XDUMP::DEFINE-TABLE "ship" + #(("uid" 8 0 0 1) ("owner" 5 0 0 9) ("xloc" 9 0 0 -1) + ("yloc" 10 0 0 -1) ("type" 4 0 0 20) ("effic" 4 0 0 -1) + ("mobil" 4 0 0 -1) ("off" 5 0 0 -1) ("tech" 6 0 0 -1) + ("opx" 9 0 0 -1) ("opy" 10 0 0 -1) ("mission" 6 0 0 35) + ("radius" 6 0 0 -1) ("fleet" 14 0 1 -1) + ("xstart" 9 0 0 -1) ("xend" 9 0 0 -1) + ("ystart" 10 0 0 -1) ("yend" 10 0 0 -1) + ("cargostart" 4 0 6 17) ("cargoend" 4 0 6 17) + ("amtstart" 6 0 6 -1) ("amtend" 6 0 6 -1) + ("autonav" 5 0 0 -1) ("civil" 6 0 0 -1) + ("milit" 6 0 0 -1) ("shell" 6 0 0 -1) ("gun" 6 0 0 -1) + ("petrol" 6 0 0 -1) ("iron" 6 0 0 -1) ("dust" 6 0 0 -1) + ("bar" 6 0 0 -1) ("food" 6 0 0 -1) ("oil" 6 0 0 -1) + ("lcm" 6 0 0 -1) ("hcm" 6 0 0 -1) ("uw" 6 0 0 -1) + ("rad" 6 0 0 -1) ("access" 6 0 0 -1) ("mquota" 5 0 0 -1) + ("path" 14 0 28 -1) ("follow" 8 0 0 -1) + ("name" 14 0 24 -1) ("rflags" 8 8 0 47) + ("rpath" 14 0 10 -1))) +(XDUMP::LOAD-TABLE "ship" 1326142920 #()) +(XDUMP::DEFINE-TABLE "plane" + #(("uid" 8 0 0 2) ("owner" 5 0 0 9) ("xloc" 9 0 0 -1) + ("yloc" 10 0 0 -1) ("type" 4 0 0 21) ("effic" 4 0 0 -1) + ("mobil" 4 0 0 -1) ("off" 5 0 0 -1) ("tech" 6 0 0 -1) + ("opx" 9 0 0 -1) ("opy" 10 0 0 -1) ("mission" 6 0 0 35) + ("radius" 6 0 0 -1) ("wing" 14 0 1 -1) + ("range" 5 0 0 -1) ("ship" 8 0 0 -1) ("land" 8 0 0 -1) + ("harden" 4 0 0 -1) ("flags" 4 8 0 45) + ("access" 6 0 0 -1) ("theta" 13 0 0 -1))) +(XDUMP::LOAD-TABLE "plane" 1326142920 #()) +(XDUMP::DEFINE-TABLE "land" + #(("uid" 8 0 0 3) ("owner" 5 0 0 9) ("xloc" 9 0 0 -1) + ("yloc" 10 0 0 -1) ("type" 4 0 0 22) ("effic" 4 0 0 -1) + ("mobil" 4 0 0 -1) ("off" 5 0 0 -1) ("tech" 6 0 0 -1) + ("opx" 9 0 0 -1) ("opy" 10 0 0 -1) ("mission" 6 0 0 35) + ("radius" 6 0 0 -1) ("army" 14 0 1 -1) ("ship" 8 0 0 -1) + ("harden" 4 0 0 -1) ("retreat" 6 0 0 -1) + ("rflags" 8 8 0 47) ("rpath" 14 0 10 -1) + ("civil" 6 0 0 -1) ("milit" 6 0 0 -1) ("shell" 6 0 0 -1) + ("gun" 6 0 0 -1) ("petrol" 6 0 0 -1) ("iron" 6 0 0 -1) + ("dust" 6 0 0 -1) ("bar" 6 0 0 -1) ("food" 6 0 0 -1) + ("oil" 6 0 0 -1) ("lcm" 6 0 0 -1) ("hcm" 6 0 0 -1) + ("uw" 6 0 0 -1) ("rad" 6 0 0 -1) ("land" 8 0 0 -1) + ("access" 6 0 0 -1))) +(XDUMP::LOAD-TABLE "land" 1326142920 #()) +(XDUMP::DEFINE-TABLE "nuke" + #(("uid" 8 0 0 4) ("owner" 5 0 0 9) ("xloc" 9 0 0 -1) + ("yloc" 10 0 0 -1) ("type" 4 0 0 23) ("effic" 4 0 0 -1) + ("mobil" 4 0 0 -1) ("off" 5 0 0 -1) ("tech" 6 0 0 -1) + ("opx" 9 0 0 -1) ("opy" 10 0 0 -1) ("mission" 6 0 0 35) + ("radius" 6 0 0 -1) ("plane" 8 0 0 -1))) +(XDUMP::LOAD-TABLE "nuke" 1326142920 #()) +(XDUMP::DEFINE-TABLE "news" + #(("actor" 5 0 0 9) ("action" 5 0 0 24) ("victim" 5 0 0 9) + ("times" 4 0 0 -1) ("duration" 6 0 0 -1) + ("time" 12 0 0 -1))) +(XDUMP::LOAD-TABLE "news" 1326142920 #()) +(XDUMP::DEFINE-TABLE "treaty" + #(("uid" 8 0 0 6) ("cna" 5 0 0 9) ("cnb" 5 0 0 9) + ("status" 4 0 0 30) ("acond" 6 8 0 50) + ("bcond" 6 8 0 50) ("exp" 12 0 0 -1))) +(XDUMP::LOAD-TABLE "treaty" 1326142920 #()) +(XDUMP::DEFINE-TABLE "trade" + #(("uid" 8 0 0 7) ("owner" 5 0 0 9) ("type" 4 0 0 27) + ("unitid" 8 0 0 -1) ("price" 1 0 0 -1) + ("maxbidder" 8 0 0 9) ("markettime" 12 0 0 -1))) +(XDUMP::LOAD-TABLE "trade" 1326142920 #()) +(XDUMP::DEFINE-TABLE "nat" + #(("cnum" 5 0 0 9) ("stat" 8 0 0 39) ("cname" 14 0 20 -1) + ("relations" 11 0 99 38) ("rejects" 5 8 99 37))) +(XDUMP::LOAD-TABLE "nat" 1326142920 + #((0 5 "POGO" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0) + (1 4 "1" 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 + 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 + 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 + 4 4 4 4 4 4 4 4 4 4 4 4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 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 + 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0))) +(XDUMP::DEFINE-TABLE "loan" + #(("uid" 8 0 0 10) ("loaner" 5 0 0 9) ("loanee" 5 0 0 9) + ("status" 4 0 0 30) ("irate" 8 0 0 -1) ("ldur" 8 0 0 -1) + ("amtpaid" 1 0 0 -1) ("amtdue" 1 0 0 -1) + ("lastpay" 12 0 0 -1) ("duedate" 12 0 0 -1))) +(XDUMP::LOAD-TABLE "loan" 1326142920 #()) +(XDUMP::DEFINE-TABLE "commodity" + #(("uid" 8 0 0 13) ("owner" 5 0 0 9) ("type" 4 0 0 17) + ("amount" 8 0 0 -1) ("price" 13 0 0 -1) + ("maxbidder" 8 0 0 9) ("markettime" 12 0 0 -1))) +(XDUMP::LOAD-TABLE "commodity" 1326142920 #()) +(XDUMP::DEFINE-TABLE "lost" + #(("timestamp" 12 0 0 -1) ("owner" 5 0 0 9) + ("type" 4 0 0 27) ("id" 8 0 0 -1) ("x" 9 0 0 -1) + ("y" 10 0 0 -1))) +(XDUMP::LOAD-TABLE "lost" 1326142920 #()) +(XDUMP::DEFINE-TABLE "realm" + #(("cnum" 5 4 0 9) ("realm" 7 4 0 -1) ("xl" 9 0 0 -1) + ("xh" 9 0 0 -1) ("yl" 10 0 0 -1) ("yh" 10 0 0 -1))) +(XDUMP::LOAD-TABLE "realm" 1326142920 + #((1 0 -8 10 -5 5) (1 1 -8 10 -5 5) (1 2 -8 10 -5 5) + (1 3 -8 10 -5 5) (1 4 -8 10 -5 5) (1 5 -8 10 -5 5) + (1 6 -8 10 -5 5) (1 7 -8 10 -5 5) (1 8 -8 10 -5 5) + (1 9 -8 10 -5 5) (1 10 -8 10 -5 5) (1 11 -8 10 -5 5) + (1 12 -8 10 -5 5) (1 13 -8 10 -5 5) (1 14 -8 10 -5 5) + (1 15 -8 10 -5 5) (1 16 -8 10 -5 5) (1 17 -8 10 -5 5) + (1 18 -8 10 -5 5) (1 19 -8 10 -5 5) (1 20 -8 10 -5 5) + (1 21 -8 10 -5 5) (1 22 -8 10 -5 5) (1 23 -8 10 -5 5) + (1 24 -8 10 -5 5) (1 25 -8 10 -5 5) (1 26 -8 10 -5 5) + (1 27 -8 10 -5 5) (1 28 -8 10 -5 5) (1 29 -8 10 -5 5) + (1 30 -8 10 -5 5) (1 31 -8 10 -5 5) (1 32 -8 10 -5 5) + (1 33 -8 10 -5 5) (1 34 -8 10 -5 5) (1 35 -8 10 -5 5) + (1 36 -8 10 -5 5) (1 37 -8 10 -5 5) (1 38 -8 10 -5 5) + (1 39 -8 10 -5 5) (1 40 -8 10 -5 5) (1 41 -8 10 -5 5) + (1 42 -8 10 -5 5) (1 43 -8 10 -5 5) (1 44 -8 10 -5 5) + (1 45 -8 10 -5 5) (1 46 -8 10 -5 5) (1 47 -8 10 -5 5) + (1 48 -8 10 -5 5) (1 49 -8 10 -5 5))) +(XDUMP::DEFINE-TABLE "game" + #(("upd_disable" 4 0 0 -1) ("down" 4 0 0 -1) + ("turn" 6 0 0 -1))) +(XDUMP::LOAD-TABLE "game" 1326142920 #((0 0 2))) +(XDUMP::DEFINE-TABLE "item" + #(("uid" 4 0 0 17) ("name" 3 0 0 -1) ("mnem" 14 4 1 -1) + ("value" 8 0 0 -1) ("sell" 8 0 0 -1) ("lbs" 8 0 0 -1) + ("pkg" 8 0 5 -1) ("melt_denom" 8 0 0 -1))) +(XDUMP::LOAD-TABLE "item" 1326142920 + #((0 "civilians" "c" 1 0 1 1 10 10 10 10 4) + (1 "military" "m" 0 0 1 1 1 1 1 1 20) + (2 "shells" "s" 5 1 1 1 1 10 1 1 80) + (3 "guns" "g" 60 1 10 1 1 10 1 1 100) + (4 "petrol" "p" 4 1 1 1 1 10 1 1 50) + (5 "iron040ore" "i" 2 1 1 1 1 10 1 1 100) + (6 "dust040(gold)" "d" 20 1 5 1 1 10 1 1 100) + (7 "bars040of040gold" "b" 280 1 50 1 1 5 1 4 200) + (8 "food" "f" 0 1 1 1 1 10 1 1 2) + (9 "oil" "o" 8 1 1 1 1 10 1 1 50) + (10 "light040products" "l" 2 1 1 1 1 10 1 1 100) + (11 "heavy040products" "h" 4 1 1 1 1 10 1 1 100) + (12 "uncompensated040workers" "u" 1 1 2 1 1 2 1 1 2) + (13 "radioactive040materials" "r" 150 1 8 1 1 10 1 1 + 1000))) +(XDUMP::DEFINE-TABLE "product" + #(("uid" 8 0 0 18) ("name" 3 0 0 -1) ("sname" 3 4 0 -1) + ("ctype" 4 0 3 17) ("camt" 7 0 3 -1) ("type" 4 0 0 17) + ("level" 8 0 0 32) ("cost" 8 0 0 -1) ("nrndx" 8 0 0 46) + ("nrdep" 8 0 0 -1) ("nlndx" 8 0 0 32) ("nlmin" 8 0 0 -1) + ("nllag" 8 0 0 -1))) +(XDUMP::LOAD-TABLE "product" 1326142920 + #((0 "iron040ore" "iron" -1 -1 -1 0 0 0 5 -1 0 45 0 -1 0 0) + (1 "gold040dust" "dust" -1 -1 -1 0 0 0 6 -1 0 46 20 -1 0 + 0) + (2 "food" "food" -1 -1 -1 0 0 0 8 -1 0 47 0 0 -10 10) + (3 "oil" "oil" -1 -1 -1 0 0 0 9 -1 0 48 10 0 -10 10) + (4 "radioactive040materials" "rad" -1 -1 -1 0 0 0 13 -1 2 + 49 35 0 40 10) + (5 "shells" "shells" 10 11 -1 2 1 0 2 -1 3 0 0 0 20 10) + (6 "guns" "guns" 9 10 11 1 5 10 3 -1 30 0 0 0 20 10) + (7 "petrol" "petrol" 9 -1 -1 1 0 0 4 -1 1 0 0 0 20 10) + (8 "gold040bars" "bars" 6 -1 -1 5 0 0 7 -1 10 0 0 -1 0 0) + (9 "light040construction040materials" "lcm" 5 -1 -1 1 0 0 + 10 -1 0 0 0 0 -10 10) + (10 "heavy040construction040materials" "hcm" 5 -1 -1 2 0 0 + 11 -1 0 0 0 0 -10 10) + (11 "technological040breakthroughs" "tech" 6 9 10 1 5 10 + -1 0 300 0 0 2 5 10) + (12 "medical040discoveries" "medical" 6 9 10 1 5 10 -1 1 + 90 0 0 2 5 10) + (13 "a040class040of040graduates" "edu" 10 -1 -1 1 0 0 -1 2 + 9 0 0 -1 0 0) + (14 "happy040strollers" "happy" 10 -1 -1 1 0 0 -1 3 9 0 0 + -1 0 0))) +(XDUMP::DEFINE-TABLE "sect-chr" + #(("uid" 5 0 0 19) ("name" 3 0 0 -1) ("mnem" 14 4 1 -1) + ("terrain" 5 0 0 19) ("prd" 8 0 0 18) + ("peffic" 8 0 0 -1) ("mob0" 13 0 0 -1) + ("mob1" 13 0 0 -1) ("nav" 8 0 0 48) ("pkg" 8 0 0 41) + ("ostr" 13 0 0 -1) ("dstr" 13 0 0 -1) ("value" 8 0 0 -1) + ("cost" 8 0 0 -1) ("build" 8 0 0 -1) ("lcms" 8 0 0 -1) + ("hcms" 8 0 0 -1) ("maint" 8 0 0 -1) + ("maxpop" 8 0 0 -1))) +(XDUMP::LOAD-TABLE "sect-chr" 1326142920 + #((0 "sea" "." 0 -1 0 -1.0 -1.0 1 1 0.0 0.0 0 -1 0 0 0 0 0) + (1 "mountain" "^" 1 1 75 2.4 1.2 0 1 1.0 4.0 5 -1 1 0 0 0 + 100) + (2 "sanctuary" "s" 4 -1 0 -1.0 -1.0 0 1 0.0 99.0 127 -1 0 + 0 0 0 1000) + (3 "wasteland" "134" 3 -1 0 -1.0 -1.0 0 1 0.0 99.0 0 -1 0 + 0 0 0 0) + (4 "wilderness" "-" 4 -1 0 0.4 0.4 0 1 1.0 2.0 1 0 0 0 0 0 + 1000) + (5 "capital" "c" 4 -1 0 0.4 0.2 0 1 1.0 2.0 30 0 1 0 0 1 + 1000) + (6 "uranium040mine" "u" 4 4 100 0.4 0.2 0 1 1.0 2.0 15 0 1 + 0 0 0 1000) + (7 "park" "p" 4 14 100 0.4 0.2 0 1 1.0 1.5 5 0 1 0 0 0 + 1000) + (8 "defense040plant" "d" 4 6 100 0.4 0.2 0 1 1.0 1.5 7 0 1 + 0 0 0 1000) + (9 "shell040industry" "i" 4 5 100 0.4 0.2 0 1 1.0 1.5 6 0 + 1 0 0 0 1000) + (10 "mine" "m" 4 0 100 0.4 0.2 0 1 1.0 2.0 5 0 1 0 0 0 + 1000) + (11 "gold040mine" "g" 4 1 100 0.4 0.2 0 1 1.0 2.0 8 0 1 0 + 0 0 1000) + (12 "harbor" "h" 4 -1 0 0.4 0.2 2 2 1.0 1.5 12 0 1 0 0 0 + 1000) + (13 "warehouse" "w" 4 -1 0 0.4 0.2 0 2 1.0 1.5 7 0 1 0 0 0 + 1000) + (14 "airfield" "*" 4 -1 0 0.4 0.2 0 1 1.0 1.25 12 0 1 0 0 + 0 1000) + (15 "agribusiness" "a" 4 2 900 0.4 0.2 0 1 1.0 1.5 2 0 1 0 + 0 0 1000) + (16 "oil040field" "o" 4 3 100 0.4 0.2 0 1 1.0 1.5 5 0 1 0 + 0 0 1000) + (17 "light040manufacturing" "j" 4 9 100 0.4 0.2 0 1 1.0 + 1.5 3 0 1 0 0 0 1000) + (18 "heavy040manufacturing" "k" 4 10 100 0.4 0.2 0 1 1.0 + 1.5 4 0 1 0 0 0 1000) + (19 "fortress" "f" 4 -1 0 0.4 0.2 0 1 2.0 4.0 10 0 5 0 1 0 + 1000) + (20 "technical040center" "t" 4 11 100 0.4 0.2 0 1 1.0 1.5 + 10 0 1 0 0 0 1000) + (21 "research040lab" "r" 4 12 100 0.4 0.2 0 1 1.0 1.5 9 0 + 1 0 0 0 1000) + (22 "nuclear040plant" "n" 4 -1 0 0.4 0.2 0 1 1.0 2.0 10 0 + 1 0 0 0 1000) + (23 "library/school" "l" 4 13 100 0.4 0.2 0 1 1.0 1.5 4 0 + 1 0 0 0 1000) + (24 "highway" "+" 4 -1 0 0.4 0.0 0 1 1.0 1.0 3 0 1 0 0 0 + 1000) + (25 "radar040installation" ")" 4 -1 0 0.4 0.2 0 1 1.0 1.5 + 4 0 1 0 0 0 1000) + (26 "headquarters" "!" 4 -1 0 0.4 0.2 0 1 1.0 1.5 12 0 1 0 + 0 0 1000) + (27 "bridge040head" "#" 4 -1 0 0.4 0.0 0 1 1.0 1.0 3 0 1 0 + 0 0 1000) + (28 "bridge040span" "=" 0 -1 0 0.4 0.0 4 1 1.0 1.0 5 -1 1 + 0 0 0 100) + (29 "bank" "b" 4 8 100 0.4 0.2 0 4 1.0 2.25 10 0 1 0 0 0 + 1000) + (30 "refinery" "%" 4 7 1000 0.4 0.2 0 1 1.0 1.5 2 0 1 0 0 + 0 1000) + (31 "enlistment040center" "e" 4 -1 0 0.4 0.2 0 1 1.0 2.0 7 + 0 1 0 0 0 1000) + (32 "plains" "~" 32 -1 0 0.4 0.2 0 1 1.0 1.5 1 -1 1 0 0 0 + 100) + (33 "bridge040tower" "@" 0 -1 0 0.4 0.0 0 1 1.0 1.5 4 -1 1 + 0 0 0 100))) +(XDUMP::DEFINE-TABLE "ship-chr" + #(("type" 4 0 0 20) ("name" 3 0 0 -1) ("civil" 6 0 0 -1) + ("milit" 6 0 0 -1) ("shell" 6 0 0 -1) ("gun" 6 0 0 -1) + ("petrol" 6 0 0 -1) ("iron" 6 0 0 -1) ("dust" 6 0 0 -1) + ("bar" 6 0 0 -1) ("food" 6 0 0 -1) ("oil" 6 0 0 -1) + ("lcm" 6 0 0 -1) ("hcm" 6 0 0 -1) ("uw" 6 0 0 -1) + ("rad" 6 0 0 -1) ("l_build" 8 0 0 -1) + ("h_build" 8 0 0 -1) ("armor" 8 0 0 -1) + ("speed" 8 0 0 -1) ("visib" 8 0 0 -1) ("vrnge" 8 0 0 -1) + ("frnge" 8 0 0 -1) ("glim" 8 0 0 -1) + ("nxlight" 5 0 0 -1) ("nchoppers" 5 0 0 -1) + ("tech" 8 0 0 -1) ("cost" 8 0 0 -1) ("flags" 1 8 0 49) + ("nplanes" 5 0 0 -1) ("nland" 5 0 0 -1))) +(XDUMP::LOAD-TABLE "ship-chr" 1326142920 + #((0 "fb040040040fishing040boat" 300 10 0 0 0 0 0 0 900 0 0 + 0 15 0 25 15 10 10 15 2 0 0 0 0 0 180 524289 0 0) + (4 "ss040040040slave040ship" 20 80 0 0 0 0 0 0 200 0 0 0 + 1200 0 60 40 20 10 35 3 0 0 1 0 0 300 0 0 0) + (6 "frg040040frigate" 0 60 10 2 0 0 0 0 60 0 0 0 0 0 30 30 + 50 25 25 3 1 1 1 0 0 600 16384 0 2))) +(XDUMP::DEFINE-TABLE "plane-chr" + #(("type" 4 0 0 21) ("name" 3 0 0 -1) ("l_build" 8 0 0 -1) + ("h_build" 8 0 0 -1) ("cost" 8 0 0 -1) ("tech" 8 0 0 -1) + ("acc" 8 0 0 -1) ("load" 8 0 0 -1) ("att" 8 0 0 -1) + ("def" 8 0 0 -1) ("range" 8 0 0 -1) ("crew" 8 0 0 -1) + ("fuel" 8 0 0 -1) ("stealth" 8 0 0 -1) + ("flags" 8 8 0 44))) +(XDUMP::LOAD-TABLE "plane-chr" 1326142920 #()) +(XDUMP::DEFINE-TABLE "land-chr" + #(("type" 4 0 0 22) ("name" 3 0 0 -1) ("civil" 6 0 0 -1) + ("milit" 6 0 0 -1) ("shell" 6 0 0 -1) ("gun" 6 0 0 -1) + ("petrol" 6 0 0 -1) ("iron" 6 0 0 -1) ("dust" 6 0 0 -1) + ("bar" 6 0 0 -1) ("food" 6 0 0 -1) ("oil" 6 0 0 -1) + ("lcm" 6 0 0 -1) ("hcm" 6 0 0 -1) ("uw" 6 0 0 -1) + ("rad" 6 0 0 -1) ("l_build" 8 0 0 -1) + ("h_build" 8 0 0 -1) ("tech" 8 0 0 -1) ("cost" 8 0 0 -1) + ("att" 13 0 0 -1) ("def" 13 0 0 -1) ("vul" 8 0 0 -1) + ("spd" 8 0 0 -1) ("vis" 8 0 0 -1) ("spy" 8 0 0 -1) + ("rmax" 8 0 0 -1) ("frg" 8 0 0 -1) ("acc" 8 0 0 -1) + ("dam" 8 0 0 -1) ("ammo" 8 0 0 -1) ("aaf" 8 0 0 -1) + ("nxlight" 5 0 0 -1) ("nland" 5 0 0 -1) + ("flags" 1 8 0 31))) +(XDUMP::LOAD-TABLE "land-chr" 1326142920 #()) +(XDUMP::DEFINE-TABLE "nuke-chr" + #(("type" 4 0 0 23) ("name" 3 0 0 -1) ("l_build" 8 0 0 -1) + ("h_build" 8 0 0 -1) ("o_build" 8 0 0 -1) + ("r_build" 8 0 0 -1) ("blast" 8 0 0 -1) ("dam" 8 0 0 -1) + ("cost" 8 0 0 -1) ("tech" 8 0 0 -1) ("weight" 8 0 0 -1) + ("flags" 8 8 0 40))) +(XDUMP::LOAD-TABLE "nuke-chr" 1326142920 #()) +(XDUMP::DEFINE-TABLE "news-chr" + #(("uid" 4 0 0 24) ("newstory" 3 0 2 -1) + ("good_will" 8 0 0 -1) ("newspage" 8 0 0 42))) +(XDUMP::LOAD-TABLE "news-chr" 1326142920 + #((1 "infantry040capture040%s040territory" + "shock040troops040overrun040one040of040%s's040sectors" -4 + 2) + (2 "infantry040beaten040back040by040%s040troops" + "shock040troops040annihilated040in040failed040attack040on040%s" + -4 2) + (3 "spy040shot040by040%s040firing040squad" + "spy040captured040and040shot040by040%s" -1 10) + (4 "sends040a040telegram040to040%s" "telexes040%s" 1 11) + (5 "diplomats040sign040a040treaty040with040%s" + "ambassador040agrees040to040a040treaty040with040%s" 3 1) + (6 "bankers040make040a040loan040to040%s" + "Ministry040of040Finance040lends040money040to040%s" 2 7) + (7 "repays040a040loan040from040%s" + "makes040last040payment040on040loan040from040%s" 1 7) + (8 "makes040a040sale040to040%s" "sells040goods040to040%s" + 0 7) + (9 "violates040%s040airspace" "overflies040%s040territory" + -1 4) + (10 "gunners040bombard040%s040territory" + "artillery040fires040on040%s040sectors" -2 6) + (11 "shells040a040ship040owned040by040%s" + "fires040on040%s040ships" -2 3) + (12 "takes040over040unoccupied040land" + "attacks040unowned040land040for040some040reason" 0 2) + (13 "ships040torpedoed040by040enemy040wolf-packs" + "ships040torpedoed040by040marauding040U-boats" 0 3) + (14 "gunners040fire040on040%s040in040self-defense" + "gunners040decimate040%s040aggressors" 0 6) + (15 "breaks040sanctuary" + "no040longer040has040a040sanctuary" 0 1) + (16 "planes040divebomb040one040of040%s's040sectors" + "bombers040wreak040havoc040on040%s" -2 4) + (17 "divebombs040a040ship040flying040the040flag040of040%s" + "airforce040bombs040%s040ships" -2 3) + (18 "seadogs040board040one040of040%s's040ships" + "pirates040board040%s040ship" -2 3) + (19 + "is040repelled040by040%s040while040attempting040to040board040a040ship" + "pirates040prove040inept040at040boarding040%s's040ships" + -3 3) + (21 + "seizes040a040sector040from040%s040to040collect040on040a040loan" + "collects040one040of040%s's040sectors040in040repayment040of040a040loan" + -2 7) + (22 + "considers040an040action040which040would040violate040a040treaty040with040%s" + "decides040not040to040violate040treaty040with040%s040(yet)" + -1 1) + (23 "violates040a040treaty040with040%s" + "actions040violate040treaty040with040%s" -4 1) + (25 "ship040hits040a040mine" + "ship040severely040damaged040in040mine040field" 0 3) + (26 "announces040an040alliance040with040%s" + "/040%s040alliance040declared" 5 1) + (28 "declares040TOTAL040WAR040on040%s" + "gets040serious040with040%s040and040declares040WAR" -5 1) + (29 "diplomats040disavow040former040alliance040with040%s" + "is040no040longer040allied040with040%s" 0 1) + (30 "is040no040longer040at040war040with040%s" + "Foreign040Ministry040declares040042No040more040war040with040%s042" + 5 1) + (31 "reports040outbreak040of040the040black040plague" + "sector040infected040with040bubonic040plague" 0 9) + (32 "citizens040die040from040bubonic040plague" + "sector040reports040plague040deaths" 0 9) + (33 "goes040through040a040name040change" + "adopts040a040new040country040name" 0 1) + (34 "citizens040starve040in040disastrous040famine" + "loses040citizens040to040mass040starvation" 0 9) + (36 "pilots040down040%s040planes" + "victorious040in040air-to-air040combat040against040%s" -3 + 4) + (37 "nuclear040device040devastates040%s040sector" + "explodes040a040nuclear040device040damaging040%s040territory" + -10 5) + (38 + "terrorists040shoot040it040out040with040%s040special040forces" + "underground040rises040up040against040%s040occupation" 0 + 9) + (39 + "execution040squads040gun040down040helpless040%s040civilians" + "firing040squads040massacre040defenseless040%s040workers" + -2 9) + (40 "launches040a040satellite040into040orbit" + "continues040its040conquest040of040space040with040a040successful040launch" + 0 5) + (41 "strikes040a040%s040big040bird" + "rockets040damage040a040%s040satellite" -8 5) + (42 "makes040a040contribution040to040%s" + "helps040out040%s" 4 7) + (43 "aids040%s040with040divine040intervention" + "smiles040upon040%s" 2 9) + (44 "hurts040%s040with040divine040intervention" + "frowns040upon040%s" -3 9) + (45 "sacrifices040to040%s" + "makes040divine040payment040to040%s" -4 7) + (46 "abms040intercept040a040%s040missile" + "strategic040defense040systems040destroy040a040%s040missile" + -10 5) + (47 "missile040fired040at040one040of040%s's040sectors" + "missile040wreaks040havoc040on040%s" -2 5) + (48 + "missile040fired040at040a040ship040flying040the040flag040of040%s" + "missiles040hit040%s040ships" -2 5) + (49 "engages040in040friendly040trade040with040%s" + "profits040from040a040merchant040venture040with040%s" 2 + 7) + (50 "pirates040dispose040of040%s040booty040in040trade" + "buccaneers040sell040their040%s040goods" 0 7) + (51 "pirates040keep040their040%s040booty" + "buccaneers040laugh040and040bury040their040%s040goods" 0 + 7) + (52 "ships040torpedoed040by040%s040torpedo-boats" + "ships040sunk040by040marauding040%s040torpedo-boats" 0 3) + (53 "planes040bomb040a040skulking040%s040submarine" + "planes040drop040depth-charges040on040a040%s040sub" 0 3) + (55 "divebombs040a040brave040%s040unit" + "airforce040bombs040%s040units" -2 4) + (56 "troops040run040afoul040of040a040landmine" + "troops040severely040damaged040in040mine040field" 0 2) + (57 + "fortress040gunners040support040troops040attacking040%s" + "fortress040artillery040massacres040%s040defenders" -2 6) + (58 "gunners040support040troops040attacking040%s" + "artillery040battery040massacres040%s040defenders" -2 6) + (59 "naval040gunners040support040troops040attacking040%s" + "naval040gunfire040massacres040%s040defenders" -2 6) + (60 "sacks040%s040capital" + "captures040and040pillages040%s's040capital" 10 1) + (61 "announces040friendly040trade040relations040with040%s" + "upgrades040%s's040trade040status040to040triple-A" 3 1) + (62 "downgrades040relations040with040%s040to040friendly" + "cools040relations040with040%s040to040friendly" 0 1) + (63 "upgrades040relations040with040%s040to040neutral" + "Foreign040Ministry040declares040042%s040is040A-OK.042" 2 + 1) + (64 "downgrades040relations040with040%s040to040neutral" + "gives040the040cold040shoulder040to040%s040and040declares040neutral040relations" + 0 1) + (65 "upgrades040relations040with040%s040to040hostile" + "forgives040%s040of040past040war040crimes040but040remains040hostile" + 3 1) + (66 "downgrades040relations040with040%s040to040hostile" + "is040suspicious040that040%s040has040hostile040intentions" + 3 1) + (67 + "sector040is040struck040by040a040sub-launched040missile" + "sector040devastated040by040missile" 0 5) + (68 "ship040is040hit040by040a040sub-launched040missile" + "ship040damaged040by040marine040missile" 0 5) + (69 "pilgrims040settle040on040a040new040island" + "discovers040new040land040and040starts040a040colony" 0 8) + (70 + "abms040intercept040an040incoming040sub-launched040missile" + "strategic040defense040systems040destroy040an040incoming040sub-launched040warhead" + 0 5) + (71 "missile040fired040at040%s040ground040troops" + "missile040hits040%s040troops" 2 5) + (72 "regiment040struck040by040sub-launched040missile" + "ground040troops040hit040by040missile" 0 5) + (73 "navy040secures040a040beachhead040on040%s040territory" + "sailors040take040a040coastal040sector040from040%s" -4 2) + (74 "paratroopers040comandeer040a040sector040from040%s" + "air040force040parachutists040overwhelm040a040%s040sector" + -4 2) + (75 "parachutists040grab040unoccupied040land" + "paratroopers040break040new040ground" 0 8) + (76 "sailors040repelled040by040%s040coast-guard" + "naval040forces040massacred040in040failed040assault040of040%s" + 4 2) + (77 + "paratroopers040destroyed040in040failed040air-assault040on040%s" + "loses040parachutists040in040failed040air-assault040of040%s" + 4 2) + (80 + "is040unable040to040fulfill040its040financial040obligations040to040%s" + "welches040on040a040deal040with040%s" 0 7) + (81 + "is040repelled040by040%s040while040attempting040to040board040a040land040unit" + "forces040prove040inept040at040boarding040%s's040land040unit" + -3 2) + (82 "mercenaries040board040one040of040%s's040land040units" + "elite040forces040board040%s040land040unit" -2 2))) +(XDUMP::DEFINE-TABLE "infrastructure" + #(("name" 3 4 0 -1) ("lcms" 5 0 0 -1) ("hcms" 5 0 0 -1) + ("dcost" 5 0 0 -1) ("mcost" 5 0 0 -1) + ("enable" 5 0 0 -1))) +(XDUMP::LOAD-TABLE "infrastructure" 1326142920 + #(("road040network" 2 2 2 1 1) ("rail040network" 1 1 1 1 1) + ("defense040factor" 1 1 1 1 0))) +(XDUMP::DEFINE-TABLE "updates" #(("time" 12 0 0 -1))) +(XDUMP::LOAD-TABLE "updates" 1326142920 + #((0) (0) (0) (0) (0) (0) (0) (0) (0) (0) (0) (0) (0) (0) + (0))) +(XDUMP::DEFINE-TABLE "table" #(("uid" 8 0 0 27) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "table" 1326142920 + #((0 "sect") (1 "ship") (2 "plane") (3 "land") (4 "nuke") + (5 "news") (6 "treaty") (7 "trade") (9 "nat") (10 "loan") + (13 "commodity") (14 "lost") (15 "realm") (16 "game") + (17 "item") (18 "product") (19 "sect-chr") (20 "ship-chr") + (21 "plane-chr") (22 "land-chr") (23 "nuke-chr") + (24 "news-chr") (25 "infrastructure") (26 "updates") + (27 "table") (28 "version") (29 "meta") + (30 "agreement-status") (31 "land-chr-flags") (32 "level") + (33 "meta-flags") (34 "meta-type") (35 "missions") + (36 "nation-flags") (37 "nation-rejects") + (38 "nation-relationships") (39 "nation-status") + (40 "nuke-chr-flags") (41 "packing") (42 "page-headings") + (43 "plague-stages") (44 "plane-chr-flags") + (45 "plane-flags") (46 "resources") (47 "retreat-flags") + (48 "sector-navigation") (49 "ship-chr-flags") + (50 "treaty-flags") (51 "country"))) +(XDUMP::DEFINE-TABLE "version" + #(("version" 14 0 23 -1) ("maxnoc" 1 0 0 -1) + ("privname" 3 0 0 -1) ("privlog" 3 0 0 -1) + ("WORLD_X" 8 0 0 -1) ("WORLD_Y" 8 0 0 -1) + ("etu_per_update" 8 0 0 -1) ("update_window" 8 0 0 -1) + ("update_demand" 8 0 0 -1) ("update_wantmin" 8 0 0 -1) + ("update_demandtimes" 3 0 0 -1) ("game_days" 3 0 0 -1) + ("game_hours" 3 0 0 -1) ("ALL_BLEED" 8 0 0 -1) + ("AUTO_POWER" 8 0 0 -1) ("BLITZ" 8 0 0 -1) + ("BRIDGETOWERS" 8 0 0 -1) ("EASY_BRIDGES" 8 0 0 -1) + ("FALLOUT" 8 0 0 -1) ("GODNEWS" 8 0 0 -1) + ("GO_RENEW" 8 0 0 -1) ("GUINEA_PIGS" 8 0 0 -1) + ("HIDDEN" 8 0 0 -1) ("INTERDICT_ATT" 8 0 0 -1) + ("LANDSPIES" 8 0 0 -1) ("LOANS" 8 0 0 -1) + ("LOSE_CONTACT" 8 0 0 -1) ("MARKET" 8 0 0 -1) + ("MOB_ACCESS" 8 0 0 -1) ("NOFOOD" 8 0 0 -1) + ("NOMOBCOST" 8 0 0 -1) ("NO_FORT_FIRE" 8 0 0 -1) + ("NO_PLAGUE" 8 0 0 -1) ("RAILWAYS" 8 0 0 -1) + ("RES_POP" 8 0 0 -1) ("SAIL" 8 0 0 -1) + ("SLOW_WAR" 8 0 0 -1) ("SUPER_BARS" 8 0 0 -1) + ("TECH_POP" 8 0 0 -1) ("TRADESHIPS" 8 0 0 -1) + ("TREATIES" 8 0 0 -1) ("btu_build_rate" 13 0 0 -1) + ("m_m_p_d" 8 0 0 -1) ("max_btus" 8 0 0 -1) + ("max_idle" 8 0 0 -1) ("players_at_00" 8 0 0 -1) + ("war_cost" 8 0 0 -1) ("easy_tech" 13 0 0 -1) + ("level_age_rate" 13 0 0 -1) ("tech_log_base" 13 0 0 -1) + ("ally_factor" 13 0 0 -1) ("edu_avg" 13 0 0 -1) + ("hap_avg" 13 0 0 -1) ("edu_cons" 2 0 0 -1) + ("hap_cons" 2 0 0 -1) ("sect_mob_scale" 13 0 0 -1) + ("sect_mob_max" 8 0 0 -1) ("buil_bh" 8 0 0 -1) + ("buil_bc" 2 0 0 -1) ("buil_bt" 2 0 0 -1) + ("buil_tower_bh" 8 0 0 -1) ("buil_tower_bc" 2 0 0 -1) + ("buil_tower_bt" 2 0 0 -1) ("land_mob_scale" 13 0 0 -1) + ("land_grow_scale" 13 0 0 -1) ("land_mob_max" 8 0 0 -1) + ("money_land" 2 0 0 -1) ("plane_mob_scale" 13 0 0 -1) + ("plane_grow_scale" 13 0 0 -1) + ("plane_mob_max" 8 0 0 -1) ("money_plane" 2 0 0 -1) + ("ship_mob_scale" 13 0 0 -1) + ("ship_grow_scale" 13 0 0 -1) ("ship_mob_max" 8 0 0 -1) + ("money_ship" 2 0 0 -1) ("torpedo_damage" 8 0 0 -1) + ("fort_max_interdiction_range" 8 0 0 -1) + ("land_max_interdiction_range" 8 0 0 -1) + ("ship_max_interdiction_range" 8 0 0 -1) + ("flakscale" 13 0 0 -1) ("combat_mob" 2 0 0 -1) + ("people_damage" 2 0 0 -1) ("unit_damage" 2 0 0 -1) + ("collateral_dam" 2 0 0 -1) ("assault_penalty" 2 0 0 -1) + ("fire_range_factor" 13 0 0 -1) + ("sect_mob_neg_factor" 8 0 0 -1) ("uwbrate" 2 0 0 -1) + ("money_civ" 2 0 0 -1) ("money_mil" 2 0 0 -1) + ("money_res" 2 0 0 -1) ("money_uw" 2 0 0 -1) + ("babyeat" 2 0 0 -1) ("bankint" 2 0 0 -1) + ("eatrate" 2 0 0 -1) ("fcrate" 2 0 0 -1) + ("fgrate" 2 0 0 -1) ("obrate" 2 0 0 -1) + ("rollover_avail_max" 8 0 0 -1) + ("decay_per_etu" 2 0 0 -1) ("fallout_spread" 2 0 0 -1) + ("drnuke_const" 13 0 0 -1) ("MARK_DELAY" 8 0 0 -1) + ("TRADE_DELAY" 8 0 0 -1) ("buytax" 2 0 0 -1) + ("tradetax" 2 0 0 -1) ("trade_1_dist" 8 0 0 -1) + ("trade_2_dist" 8 0 0 -1) ("trade_3_dist" 8 0 0 -1) + ("trade_1" 13 0 0 -1) ("trade_2" 13 0 0 -1) + ("trade_3" 13 0 0 -1) ("trade_ally_bonus" 13 0 0 -1) + ("trade_ally_cut" 13 0 0 -1))) +(XDUMP::LOAD-TABLE "version" 1326142920 + #(("Wolfpack040Empire0404.3.27" 99 "Segora" + "gefla@pond.sub.org" 64 32 60 0 2 1 "" "" "" 1 0 1 1 1 1 + 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 0 1 0 0 0 0 1 0.0012 1440 + 640 15 0 1000 1.0 96.0 2.0 2.0 192.0 48.0 600000 600000 + 1.0 127 100 1000.0 10.0 400 3000.0 100.0 1.0 2.0 127 + -0.001 1.0 2.0 127 -0.001 1.5 3.0 127 -0.001 40 8 8 8 + 1.75 5.0 1.0 0.3 0.1 0.5 1.0 2 0.0025 0.0083333 + -0.0833333 -0.0083333 0.0017777 0.006 0.25 5.e-4 0.0013 + 0.0012 0.005 0 0.006 0.005 0.0 7200 7200 1.0 0.99 8 14 25 + 0.025 0.035 0.05 0.2 0.1))) +(XDUMP::DEFINE-TABLE "agreement-status" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "agreement-status" 1326142920 + #((0 "free") (1 "proposed") (2 "signed"))) +(XDUMP::DEFINE-TABLE "land-chr-flags" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "land-chr-flags" 1326142920 + #((2 "engineer") (4 "supply") (8 "security") (16 "light") + (32 "marine") (64 "recon") (128 "radar") (256 "assault") + (512 "flak") (1024 "spy") (2048 "train") (4096 "heavy"))) +(XDUMP::DEFINE-TABLE "level" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "level" 1326142920 + #((-1 "none") (0 "technology") (1 "research") + (2 "education") (3 "happiness"))) +(XDUMP::DEFINE-TABLE "meta-flags" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "meta-flags" 1326142920 + #((1 "deity") (2 "extra") (4 "const") (8 "bits"))) +(XDUMP::DEFINE-TABLE "meta-type" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "meta-type" 1326142920 + #((1 "d") (2 "g") (3 "s") (4 "d") (5 "d") (6 "d") (7 "d") + (8 "d") (9 "d") (10 "d") (11 "d") (12 "d") (13 "g") + (14 "c"))) +(XDUMP::DEFINE-TABLE "missions" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "missions" 1326142920 + #((0 "none") (1 "interdiction") (2 "support") (3 "reserve") + (4 "escort") (6 "air040defense") (7 "defensive040support") + (8 "offensive040support"))) +(XDUMP::DEFINE-TABLE "nation-flags" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "nation-flags" 1326142920 + #((1 "inform") (2 "flash") (4 "beep") (8 "coastwatch") + (16 "sonar") (32 "techlists") (64 "sacked"))) +(XDUMP::DEFINE-TABLE "nation-rejects" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "nation-rejects" 1326142920 + #((1 "telegrams") (2 "treaties") (4 "announcements") + (8 "loans"))) +(XDUMP::DEFINE-TABLE "nation-relationships" + #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "nation-relationships" 1326142920 + #((-1 "unknown") (0 "at-war") (1 "sitzkrieg") + (2 "mobilization") (3 "hostile") (4 "neutral") + (5 "friendly") (6 "allied"))) +(XDUMP::DEFINE-TABLE "nation-status" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "nation-status" 1326142920 + #((0 "unused") (1 "new") (2 "visitor") (3 "sanctuary") + (4 "active") (5 "deity"))) +(XDUMP::DEFINE-TABLE "nuke-chr-flags" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "nuke-chr-flags" 1326142920 #((1 "neutron"))) +(XDUMP::DEFINE-TABLE "packing" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "packing" 1326142920 + #((0 "inefficient") (1 "normal") (2 "warehouse") (3 "urban") + (4 "bank"))) +(XDUMP::DEFINE-TABLE "page-headings" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "page-headings" 1326142920 + #((0 "Comics") (1 "Foreign040Affairs") + (2 "The040Front040Line") (3 "The040High040Seas") + (4 "Sky040Watch") (5 "Guidance040Systems") + (6 "Firestorms") (7 "Business040&040Economics") + (8 "The040Frontier") (9 "The040Home040Front") + (10 "Espionage") (11 "Telecommunications"))) +(XDUMP::DEFINE-TABLE "plague-stages" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "plague-stages" 1326142920 + #((0 "healthy") (1 "dying") (2 "infect") (3 "incubate") + (4 "exposed"))) +(XDUMP::DEFINE-TABLE "plane-chr-flags" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "plane-chr-flags" 1326142920 + #((2 "tactical") (1 "bomber") (4 "intercept") (8 "cargo") + (16 "VTOL") (32 "missile") (64 "light") (128 "spy") + (256 "image") (512 "satellite") (2048 "SDI") + (8192 "x-light") (16384 "helo") (32768 "ASW") + (65536 "para") (131072 "escort") (262144 "mine") + (524288 "sweep") (1048576 "marine"))) +(XDUMP::DEFINE-TABLE "plane-flags" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "plane-flags" 1326142920 + #((1 "launched") (2 "synchronous") (4 "airburst"))) +(XDUMP::DEFINE-TABLE "resources" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "resources" 1326142920 + #((0 "none") (45 "min") (46 "gold") (47 "fert") + (48 "ocontent") (49 "uran"))) +(XDUMP::DEFINE-TABLE "retreat-flags" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "retreat-flags" 1326142920 + #((1 "group") (2 "injured") (4 "torped") (8 "sonared") + (16 "helpless") (32 "bombed") (64 "depth-charged") + (128 "boarded"))) +(XDUMP::DEFINE-TABLE "sector-navigation" + #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "sector-navigation" 1326142920 + #((0 "land") (1 "sea") (2 "harbor") (3 "canal") + (4 "bridge"))) +(XDUMP::DEFINE-TABLE "ship-chr-flags" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "ship-chr-flags" 1326142920 + #((1 "fish") (2 "torp") (4 "dchrg") (8 "plane") (16 "miss") + (32 "oil") (64 "sonar") (128 "mine") (256 "sweep") + (512 "sub") (2048 "land") (4096 "sub-torp") (8192 "trade") + (16384 "semi-land") (262144 "supply") (524288 "canal") + (1048576 "anti-missile"))) +(XDUMP::DEFINE-TABLE "treaty-flags" #(("value" 8 4 0 -1) ("name" 3 4 0 -1))) +(XDUMP::LOAD-TABLE "treaty-flags" 1326142920 + #((1 "no040attacks040on040any040land040units") + (2 "no040attacks040on040any040ships") + (4 "no040shelling040any040ships") + (1024 "no040depth-charging040any040subs") + (8 "no040sector040attacks") + (16 "no040shelling040any040land") + (32 "no040building040ships") + (64 "no040new040nuclear040weapons") + (128 "no040building040planes") + (256 "no040building040land040units") + (512 "no040enlistment"))) +(XDUMP::DEFINE-TABLE "country" + #(("cnum" 5 0 0 9) ("ip" 14 0 32 -1) + ("hostname" 14 0 512 -1) ("userid" 14 0 32 -1) + ("xcap" 9 0 0 -1) ("ycap" 10 0 0 -1) ("update" 4 0 0 -1) + ("tgms" 7 0 0 -1) ("ann" 7 0 0 -1) ("timeused" 8 0 0 -1) + ("btu" 6 0 0 -1) ("access" 6 0 0 -1) + ("milreserve" 1 0 0 -1) ("money" 1 0 0 -1) + ("login" 12 0 0 -1) ("logout" 12 0 0 -1) + ("newstim" 12 0 0 -1) ("annotim" 12 0 0 -1) + ("tech" 13 0 0 -1) ("research" 13 0 0 -1) + ("education" 13 0 0 -1) ("happiness" 13 0 0 -1) + ("flags" 1 8 0 36))) +(XDUMP::LOAD-TABLE "country" 1326142921 + #((1 "127.0.0.1" "" "" 0 0 0 0 0 667 640 0 0 25351 + 1326142254 1326033398 0 0 0.0 0.0 0.0 0.0 62))) \ No newline at end of file diff --git a/xdump.lisp b/xdump.lisp index dd878ee..a1cf596 100644 --- a/xdump.lisp +++ b/xdump.lisp @@ -42,7 +42,8 @@ (index-by-name :accessor index-by-name :initform (make-hash-table :size 128 :test 'equal)) (meta-index :accessor meta-index :initform (make-array 5)) - (meta-meta :accessor meta-meta :initform (make-array 5)))) + (meta-meta :accessor meta-meta :initform (make-array 5)) + (user-log :accessor user-log :initarg :user-log))) (defgeneric get-table (xdump-parser table-name)) (defgeneric get-table-entry (xdump-parser table-name index)) @@ -55,6 +56,7 @@ (defgeneric header-parser (xdump-parser line)) (defgeneric parse-line (xdump-parser line)) (defgeneric reset-table-parser (xdump-parser)) +(defgeneric flush-log (xdump-parser)) (defgeneric entry-from-vector (xdump-parser class meta-table entry-vector &key array-support-p)) @@ -71,8 +73,11 @@ (defun table (table-name &optional (parser *current-parser*)) (get-table parser table-name)) +(defun checkpoint (&optional (parser *current-parser*)) + (flush-log parser)) + (defmethod get-table-entry ((parser xdump-parser) table-name index) - (aref (table-entries (get-table table-name)) index)) + (aref (table-entries (get-table parser table-name)) index)) (defmethod sym-by-value ((parser xdump-parser) table-name value) (with-slots (table-classes-package) parser @@ -93,8 +98,9 @@ name nil timestamp nil))) -(defun meta-meta-finalizer (parser) - (with-slots (entry-buffer meta-index meta-meta) parser +(defun define-meta-table (entry-buffer) + (with-slots (meta-index meta-meta user-log) *current-parser* + (print `(define-meta-table ,entry-buffer) user-log) ; build meta-index from integer index to ; slot symbol (loop @@ -112,6 +118,10 @@ do (setf (slot-value meta-meta-column slot) field)) (setf (aref meta-meta i) meta-meta-column))))) +(defun meta-meta-finalizer (parser) + (with-parser parser + (define-meta-table (entry-buffer parser)))) + (defun table-entry-defclass-form (name class-name package slot-list) `(defclass ,(find-symbol class-name package) () ,(mapcar #'(lambda (raw-slot-name) @@ -123,18 +133,17 @@ :accessor (intern accessor-name package)))) slot-list))) -(defun meta-finalizer (parser) +(defun define-table (name entry-buffer) (let ((meta-table (make-array 1 :fill-pointer 0 :adjustable t))) - (with-slots (entry-buffer name meta-index meta-by-index index-by-name - table-by-index) - parser + (with-slots (meta-index meta-by-index index-by-name table-by-index user-log) + *current-parser* + (print `(define-table ,name ,entry-buffer) user-log) (loop for entry across entry-buffer do (let ((meta (make-instance 'table-column-meta))) (loop for slot across meta-index for field in entry do (setf (slot-value meta slot) field)) (vector-push-extend meta meta-table))) - (format t "~a~%~a~%~a~%" name meta-table entry-buffer) (let ((table-index (if (string= "table" name) ; voodoo: the first column of the table of tables ; is the uid @@ -150,7 +159,7 @@ ;; create xdump-table instance and entry class (let* ((class-name (string-upcase (format nil "~a-table-entry" name))) - (package (table-classes-package parser)) + (package (table-classes-package *current-parser*)) (table-instance (make-instance 'xdump-table :name name :index table-index @@ -160,10 +169,14 @@ (slot-list (loop for entry across entry-buffer collect (car entry)))) (setf (aref table-by-index table-index) table-instance) - (format t "slot-list: ~a~%" slot-list) (eval (table-entry-defclass-form name class-name package slot-list))))))) +(defun meta-finalizer (parser) + (with-parser parser + (with-slots (name entry-buffer) parser + (define-table name entry-buffer)))) + (defmethod array-p ((parser xdump-parser) column) (let ((column-len (meta-len column)) (column-type (sym-by-value parser "meta-type" (meta-type column)))) @@ -199,13 +212,14 @@ :initial-element nil)) (setf (aref entries index) entry))) -(defun table-finalizer (parser) - (with-slots (entry-buffer name timestamp index-by-name meta-by-index - table-by-index table-classes-package) parser +(defun load-table (name timestamp entry-buffer) + (with-slots (index-by-name meta-by-index table-by-index table-classes-package + user-log) + *current-parser* + (print `(load-table ,name ,timestamp ,entry-buffer) user-log) (if (string= name "table") ; special magic: prefill index-by-name (loop for entry across entry-buffer do (setf (gethash (second entry) index-by-name) (first entry)))) - (format t "table-finalizer: ~a~%" name) (let* ((table-index (gethash name index-by-name)) (meta-table (aref meta-by-index table-index)) (table (aref table-by-index table-index)) @@ -213,7 +227,7 @@ (array-support-p (not (or (string= name "table") (string= name "meta-type"))))) (loop for entry across entry-buffer do - (let ((entry-instance (entry-from-vector parser + (let ((entry-instance (entry-from-vector *current-parser* (table-entry-class table) meta-table entry @@ -225,6 +239,11 @@ (vector-push-extend entry-instance (table-entries table))))) (setf (table-last-update table) timestamp)))) +(defun table-finalizer (parser) + (with-parser parser + (with-slots (name timestamp entry-buffer) parser + (load-table name timestamp entry-buffer)))) + (defmethod finish-table ((parser xdump-parser) number-of-records) (if (not (equal number-of-records (length (entry-buffer parser)))) (error "Table row count mismatch")) @@ -280,8 +299,8 @@ (parse-table parser name timestamp))))) nil) -(defun make-parser () - (let ((parser (make-instance 'xdump-parser))) +(defun make-parser (&key user-log) + (let ((parser (make-instance 'xdump-parser :user-log user-log))) (setf (line-parser parser) #'header-parser) parser)) @@ -297,6 +316,9 @@ (with-open-file (s filename) (parse-stream parser s))) +(defmethod flush-log ((parser xdump-parser)) + (finish-output (user-log parser))) + (defun t1 () (let ((parser (make-parser))) (setf *current-parser* parser) -- 2.43.0