]> git.pond.sub.org Git - empserver/commit
Make server check game state file sizes on startup
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 17 May 2008 15:00:57 +0000 (17:00 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 17 May 2008 15:00:57 +0000 (17:00 +0200)
commit5750107b65f7cbcb28b542d8beaffbcd9479fa72
treeeb66b68510b75a4b76a585755fa7732accfa4af1
parentb37ebbbde3d583578efd80df58598ce5827994d7
Make server check game state file sizes on startup

Certain tables have a fixed size depending on configuration: EF_SECTOR
has WORLD_SZ() elements, EF_NATION, EF_MAP and EF_BMAP have MAXNOC
elements, and EF_REALM has MAXNOC * MAXNOR elements.  Bad things
happen if the files backing them are shorter.

Pass expected size to ef_open(), and make it fail when the actual size
differs.
include/file.h
src/lib/common/file.c
src/lib/subs/fileinit.c
src/util/empdump.c
src/util/files.c