Use the new Empire clock for implementing MOB_ACCESS:
(lndstr, plnstr, sctstr, shpstr): Change timestamp members lnd_access, pln_access, sct_access, shp_access from real time (time_t) to ETUs within a turn (short). (land_ca, plane_ca, sect_ca, ship_ca): Update accordingly. (build_ship, build_land, build_bridge, build_plane, build_tower) (explore, check_trade, bsanct, takeover, takeover_ship) (takeover_land): Use game_tick_to_now() instead of time() to update the timestamp. Change check_trade(), takeover_ship(), takeover_land() to do that only when MOB_ACCESS is enabled, for consistency. (lupgr, supgr, pupgr, takeover_ship): Don't touch the timestamp where mobility isn't touched either. (sct_do_upd_mob, shp_do_upd_mob, lnd_do_upd_mob, pln_do_upd_mob): Use game_tick_to_now() instead of increase_mob() to compute ETUs since the timestamp and update the timestamp. Closes #1012699. (increase_mob): Remove. (mob_sect, mob_ship, mob_land, mob_plane): sct_do_upd_mob() & friends no longer do the right thing at the update. Use game_reset_tick() and pass its result directly to do_mob_sect() & friends. This is only correct when argument is etu_per_update, which it always is. Remove parameter. Callers changed. (do_mob_sect, do_mob_ship, do_mob_land, do_mob_plane): Oops on negative argument. (mob_acc_globals, timestampfil, mobupdate, updating_mob) (update_all_mob, timestamp_fixing, update_timestamps, mobility_check): The mobupdate command was important to let deities manually synchronize mobility updating with updates. That's no longer needed. The code behind it is somewhat hairy and ugly, and updating it to work with the Empire clock is just not worth it. Remove. Users changed. (player_coms): Update accordingly. (upda): Remove display of mobility updating state. (mobility_init): No need to fix up mobility on startup, as the Empire clock runs normally even when the server is down. Remove. Caller changed.
This commit is contained in:
parent
aa34ef2b7b
commit
4bd19812af
25 changed files with 92 additions and 458 deletions
|
@ -83,15 +83,6 @@ typedef int pid_t;
|
|||
#define S_IRWUG S_IRGRP | S_IWGRP | S_IRUSR | S_IWUSR
|
||||
#endif
|
||||
|
||||
/* This is the structure we use to keep track of the global mobility
|
||||
things, such as when the server is supposed to start/stop updating
|
||||
mobility and the timestamp of when the game was last up. These
|
||||
times are in seconds. */
|
||||
struct mob_acc_globals {
|
||||
time_t timestamp; /* Last timestamp of when the game was up */
|
||||
time_t starttime; /* When we should start updating mobility again. */
|
||||
};
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define ATTRIBUTE(attrs) __attribute__ (attrs)
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue