Migrated away from using asctime() and ctime() - in favor of strftime().

Added year to several datestamps. Unbounded dates are locale-specific.
- Minor re-formatting was needed for STAT PLAYER and SHOW PLAYER.
The 'slay' feature of do_kill now requires a GRGOD or higher.
'last *' and 'last all' are now synonyms.
This commit is contained in:
wyld-sw
2015-09-18 09:16:04 -04:00
parent ffead13dc1
commit 5119361f15
10 changed files with 178 additions and 176 deletions

View File

@@ -196,7 +196,7 @@ int strn_cmp(const char *arg1, const char *arg2, int n)
void basic_mud_vlog(const char *format, va_list args)
{
time_t ct = time(0);
char *time_s = asctime(localtime(&ct));
char timestr[20];
if (logfile == NULL) {
puts("SYSERR: Using log() before stream was initialized!");
@@ -206,9 +206,9 @@ void basic_mud_vlog(const char *format, va_list args)
if (format == NULL)
format = "SYSERR: log() received a NULL format.";
time_s[strlen(time_s) - 1] = '\0';
strftime(timestr, sizeof(timestr), "%b %d %H:%M:%S %Y", localtime(&ct));
fprintf(logfile, "%-15.15s :: ", time_s + 4);
fprintf(logfile, "%-20.20s :: ", timestr);
vfprintf(logfile, format, args);
fputc('\n', logfile);
fflush(logfile);