mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-15 12:28:06 +01:00
[Jun 11 2008] - Rumble
Added notification via prompt for new MOTD and news entries. (thanks Jamdog) Added all option to the restore command. (thanks Jamdog) Added new trigger variable hasattached. (thanks Fizban)
This commit is contained in:
parent
c486097e81
commit
cfe59d3e04
14 changed files with 169 additions and 7 deletions
17
src/db.c
17
src/db.c
|
|
@ -36,6 +36,7 @@
|
|||
#include "modify.h"
|
||||
#include "shop.h"
|
||||
#include "quest.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
/* declarations of most of the 'global' variables */
|
||||
struct config_data config_info; /* Game configuration list. */
|
||||
|
|
@ -107,6 +108,9 @@ struct help_index_element *help_table = NULL;
|
|||
struct social_messg *soc_mess_list = NULL; /* list of socials */
|
||||
int top_of_socialt = -1; /* number of socials */
|
||||
|
||||
time_t newsmod; /* Time news file was last modified. */
|
||||
time_t motdmod; /* Time motd file was last modified. */
|
||||
|
||||
struct time_info_data time_info; /* the infomation about the time */
|
||||
struct weather_data weather_info; /* the infomation about the weather */
|
||||
struct player_special_data dummy_mob; /* dummy spec area for mobs */
|
||||
|
|
@ -2878,6 +2882,7 @@ static int file_to_string(const char *name, char *buf)
|
|||
FILE *fl;
|
||||
char tmp[READ_SIZE + 3];
|
||||
int len;
|
||||
struct stat statbuf;
|
||||
|
||||
*buf = '\0';
|
||||
|
||||
|
|
@ -2886,6 +2891,18 @@ static int file_to_string(const char *name, char *buf)
|
|||
return (-1);
|
||||
}
|
||||
|
||||
/* Grab the date/time the file was last edited */
|
||||
if (!strcmp(name, NEWS_FILE))
|
||||
{
|
||||
fstat(fileno(fl), &statbuf);
|
||||
newsmod = statbuf.st_mtime;
|
||||
}
|
||||
if (!strcmp(name, MOTD_FILE))
|
||||
{
|
||||
fstat(fileno(fl), &statbuf);
|
||||
motdmod = statbuf.st_mtime;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (!fgets(tmp, READ_SIZE, fl)) /* EOF check */
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue