From b481d2b8c93323b73ec9b3e2740c32e1634f5187 Mon Sep 17 00:00:00 2001 From: Rick Bird Date: Wed, 11 May 2011 20:49:16 -0400 Subject: [PATCH] Gave Suspect logs their own number to differiate in events and changed intmax_t for %d va_arg to int to be friendlier. Signed-off-by: Rick Bird --- hdrs/log.h | 16 ++++++++-------- src/game.c | 2 +- src/log.c | 2 ++ src/modules.c | 2 +- src/parse.c | 15 ++++++++------- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/hdrs/log.h b/hdrs/log.h index 417a341..287ce10 100644 --- a/hdrs/log.h +++ b/hdrs/log.h @@ -2,14 +2,14 @@ #define LOG_H /* log types */ -#define LT_ERR 0 -#define LT_CMD 1 -#define LT_WIZ 2 -#define LT_CONN 3 -#define LT_TRACE 4 -#define LT_RPAGE 5 /* Obsolete */ -#define LT_CHECK 6 -#define LT_HUH 7 +#define LT_ERR 0 +#define LT_CMD 1 +#define LT_WIZ 2 +#define LT_CONN 3 +#define LT_TRACE 4 +#define LT_SUSPECT 5 /* Obsolete */ +#define LT_CHECK 6 +#define LT_HUH 7 /* From log.c */ extern void start_all_logs(void); diff --git a/src/game.c b/src/game.c index abf3a29..e161c3d 100644 --- a/src/game.c +++ b/src/game.c @@ -1238,7 +1238,7 @@ process_command(dbref player, char *command, dbref cause, dbref realcause, int log_activity(LA_CMD, player, msg); if (options.log_commands || Suspect(player)) - do_log(LT_CMD, player, NOTHING, "%s", msg); + do_log(Suspect(player) ? LT_SUSPECT : LT_CMD, player, NOTHING, "%s", msg); if Verbose (player) raw_notify(Owner(player), tprintf("#%d] %s", player, msg)); diff --git a/src/log.c b/src/log.c index a48e867..58c2ea5 100644 --- a/src/log.c +++ b/src/log.c @@ -217,6 +217,7 @@ do_rawlog(int logtype, const char *fmt, ...) case LT_ERR: f = stderr; break; + case LT_SUSPECT: case LT_HUH: case LT_CMD: start_log(&cmdlog_fp, CMDLOG); @@ -286,6 +287,7 @@ do_log(int logtype, dbref player, dbref object, const char *fmt, ...) case LT_ERR: do_rawlog(logtype, "RPT: %s", tbuf1); break; + case LT_SUSPECT: case LT_CMD: strcpy(unp1, quick_unparse(player)); if (GoodObject(object)) { diff --git a/src/modules.c b/src/modules.c index 016de4f..2765566 100644 --- a/src/modules.c +++ b/src/modules.c @@ -361,7 +361,7 @@ CHook_SC(struct core_entry_t *entry, const char *format, va_list arguments) case 'D': case 'd': global_eval_context.wenv[spot++] = - unparse_integer(va_arg(arguments, intmax_t)); + unparse_integer(va_arg(arguments, int)); next = 0; break; case 'S': diff --git a/src/parse.c b/src/parse.c index edd3058..21d01e2 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1145,14 +1145,7 @@ process_expression(char *buff, char **bp, char const **str, if (attrib) safe_str(atr_value(attrib), buff, bp); break; - default: /* just copy */ - safe_chr(savec, buff, bp); - } - if (isupper((unsigned char) savec)) - *savepos = UPCASE(*savepos); - } - break; case 'z': case 'Z': nextc = **str; @@ -1226,6 +1219,14 @@ process_expression(char *buff, char **bp, char const **str, break; } break; + default: /* just copy */ + safe_chr(savec, buff, bp); + } + + if (isupper((unsigned char) savec)) + *savepos = UPCASE(*savepos); + } + break; } case '{': /* "{}" parse group; recurse with no function check */ -- 2.30.2