mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-16 04:48:05 +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/comm.c
17
src/comm.c
|
|
@ -85,6 +85,9 @@
|
|||
#define INVALID_SOCKET (-1)
|
||||
#endif
|
||||
|
||||
extern time_t motdmod;
|
||||
extern time_t newsmod;
|
||||
|
||||
/* locally defined globals, used externally */
|
||||
struct descriptor_data *descriptor_list = NULL; /* master desc list */
|
||||
int buf_largecount = 0; /* # of large buffers which exist */
|
||||
|
|
@ -1212,6 +1215,20 @@ static char *make_prompt(struct descriptor_data *d)
|
|||
len += count;
|
||||
}
|
||||
|
||||
if (GET_LAST_NEWS(d->character) < newsmod)
|
||||
{
|
||||
count = snprintf(prompt + len, sizeof(prompt) - len, "(news) ");
|
||||
if (count >= 0)
|
||||
len += count;
|
||||
}
|
||||
|
||||
if (GET_LAST_MOTD(d->character) < motdmod)
|
||||
{
|
||||
count = snprintf(prompt + len, sizeof(prompt) - len, "(motd) ");
|
||||
if (count >= 0)
|
||||
len += count;
|
||||
}
|
||||
|
||||
if (len < sizeof(prompt))
|
||||
strncat(prompt, "> ", sizeof(prompt) - len - 1); /* strncat: OK */
|
||||
} else if (STATE(d) == CON_PLAYING && IS_NPC(d->character))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue