Store update disable flag in the game table to make it visible in
xdump: (gamestr): New member game_upd_disable. (game_ca): Update accordingly. (game_ctrl_update): New. (disa, enab): Use it. (updates_disabled): Rewrite and move to game.c (disablefil): Remove.
This commit is contained in:
parent
e7e8717e86
commit
286dda725e
8 changed files with 31 additions and 34 deletions
|
@ -50,6 +50,27 @@
|
|||
#include "prototypes.h"
|
||||
#include "server.h"
|
||||
|
||||
/*
|
||||
* Disable updates
|
||||
*/
|
||||
void
|
||||
game_ctrl_update(int enable)
|
||||
{
|
||||
struct gamestr *game = getgamep();
|
||||
|
||||
game->game_upd_disable = !enable;
|
||||
putgame();
|
||||
}
|
||||
|
||||
/*
|
||||
* Are updates disabled?
|
||||
*/
|
||||
int
|
||||
updates_disabled(void)
|
||||
{
|
||||
return getgamep()->game_upd_disable;
|
||||
}
|
||||
|
||||
/*
|
||||
* Record an update in the game file, the current time is NOW.
|
||||
*/
|
||||
|
|
|
@ -116,14 +116,3 @@ demandupdatecheck(void)
|
|||
&& demand_update_time(&now)
|
||||
&& demand_check();
|
||||
}
|
||||
|
||||
int
|
||||
updates_disabled(void)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if ((fd = open(disablefil, O_RDONLY, 0)) < 0)
|
||||
return 0;
|
||||
close(fd);
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue