relations: Move relations state from struct natstr to relatstr
Relations state is relatively bulky: it's a big chunk of struct natstr, and adds 200 bytes per country to xdump nat. Relations change rarely. Rewriting it to disk on every nation update and retransmitting it in every xdump nat is wasteful. To avoid this waste, move relations state to its own struct relatstr. 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:
parent
de24545963
commit
92693cba65
20 changed files with 223 additions and 155 deletions
|
@ -111,7 +111,6 @@ struct natstr {
|
|||
time_t nat_newstim; /* date news last read */
|
||||
time_t nat_annotim; /* date annos last read */
|
||||
float nat_level[4]; /* technology, etc */
|
||||
unsigned char nat_relate[MAXNOC]; /* enum relations */
|
||||
};
|
||||
|
||||
#define NAT_TLEV 0
|
||||
|
@ -140,6 +139,7 @@ struct relatstr {
|
|||
int rel_uid;
|
||||
time_t rel_timestamp;
|
||||
/* end of part matching struct empobj */
|
||||
unsigned char rel_relate[MAXNOC]; /* enum relations */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -232,9 +232,9 @@ enum ca_dump {
|
|||
* If NSC_DEITY is set in @ca_flags, only deities can use this
|
||||
* selector.
|
||||
* If NSC_HIDDEN is set in @ca_flags, the selector must be an array of
|
||||
* MAXNOC elements, indexed by country number, and the context object
|
||||
* must be EF_NATION. Array elements are masked for contact when
|
||||
* opt_HIDDEN is on.
|
||||
* MAXNOC elements, indexed by country number. Array elements are
|
||||
* masked for contact when opt_HIDDEN is on. Only implemented for
|
||||
* integer types and context object EF_RELAT.
|
||||
* @ca_dump specifies how xdump and xundump are to use the selector.
|
||||
*/
|
||||
struct castr {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue