reject: Move reject state from struct natstr to rejectstr

Reject state is relatively bulky: it's a big chunk of struct natstr,
and adds almost 200 bytes per country to xdump nat.

Reject state changes rarely.  Rewriting it to disk on every nation
update and retransmitting it in every xdump nat is wasteful.

To avoid this waste, move reject state to its own struct rejectstr.

This is of course an xdump compatibility break.  We're not maintaining
xdump compatibility in this release.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-10-31 13:48:48 +01:00
parent f35f16c0a2
commit eaa678c903
18 changed files with 149 additions and 150 deletions

View file

@ -112,7 +112,6 @@ struct natstr {
time_t nat_annotim; /* date annos last read */
float nat_level[4]; /* technology, etc */
unsigned char nat_relate[MAXNOC];
unsigned char nat_rejects[MAXNOC];
};
/* nation relation codes */
@ -169,6 +168,7 @@ struct rejectstr {
int rej_uid;
time_t rej_timestamp;
/* end of part matching struct empobj */
unsigned char rej_rejects[MAXNOC];
};
extern char *relates[];