(NEWS_PERIOD, news_keep_days): Replace macro NEWS_PERIOD by new

configuration key news_keep_days.
This commit is contained in:
Markus Armbruster 2004-09-04 19:32:48 +00:00
parent 2dd13e096d
commit 3dc73b39d2
4 changed files with 7 additions and 7 deletions

View file

@ -291,6 +291,8 @@ EMPCFBOTH("trade_ally_cut", trade_ally_cut, float, NSC_FLOAT, 0,
EMPCF_COMMENT("\n\n### Misc.")
EMPCFBOTH("anno_keep_days", anno_keep_days, int, NSC_INT, KM_INTERNAL,
"How long until announcements expire (<0 means never)")
EMPCFBOTH("news_keep_days", news_keep_days, int, NSC_INT, KM_INTERNAL,
"How long until news expire")
EMPCFBOTH("fuel_mult", fuel_mult, int, NSC_INT, 0,
"Multiplier for fuel to mobility calculation")
EMPCFBOTH("lost_items_timeout", lost_items_timeout, int, NSC_INT, KM_INTERNAL,

View file

@ -157,8 +157,6 @@ struct rptstr {
#define N_TELE 11
#define N_MAX_PAGE 11
#define NEWS_PERIOD days(10)
#define getnews(n, p) \
ef_read(EF_NEWS, n, p)
#define putnews(n, p) \

View file

@ -82,6 +82,7 @@ int sect_mob_neg_factor = 2; /* ETU/neg_factor = negative amount of mobility
a sector has after being taken */
int anno_keep_days = 7; /* How long until annos expire (<0 never) */
int news_keep_days = 10; /* How long until news expire (<0 never) */
int lost_items_timeout = 172800; /* How long before removing from database */
double combat_mob = 5.0; /* how much mob do units spend for combat? */

View file

@ -38,6 +38,7 @@
#include "file.h"
#include "empio.h"
#include <fcntl.h>
#include "optlist.h"
#include "prototypes.h"
static void filereport(int, int, int, int);
@ -105,13 +106,11 @@ addfree(int n)
static void
findfree(void)
{
register time_t oldnewstime;
register int n;
time_t oldnewstime;
int n;
struct nwsstr news;
time_t newstime;
(void)time(&newstime);
oldnewstime = newstime - NEWS_PERIOD;
oldnewstime = time(NULL) - days(news_keep_days);
for (n = 0; getnews(n, &news); n++) {
if (news.nws_when < oldnewstime)
addfree(n);