contact: Move contact state from struct natstr to contactstr

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

Contact changes rarely.  Since we avoid unnecessary updates, it
doesn't change at all unless option HIDDEN is enabled.  Rewriting it
to disk on every nation update and retransmitting it in every deity
xdump nat is wasteful.

To avoid this waste, move contact state to its own struct contactstr.

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-25 19:38:02 +02:00
parent 4b4df53485
commit c8e7548f24
19 changed files with 141 additions and 132 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_contact[MAXNOC];
unsigned char nat_rejects[MAXNOC];
};
@ -157,6 +156,7 @@ struct contactstr {
int con_uid;
time_t con_timestamp;
/* end of part matching struct empobj */
unsigned char con_contact[MAXNOC];
};
extern char *relates[];