diff options
author | MadCamel <madcamel@gmail.com> | 2009-05-04 09:46:31 -0400 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-05-04 07:56:18 -0600 |
commit | fa939d8917abe20709ad72c40496b083cea5f86f (patch) | |
tree | 2e4ee86e2810e165a2ed11b22a72f83eb7bd87e3 | |
parent | 9e62b627642fb45f39ea948546be3c3dd1e6dd3d (diff) | |
download | tmwa-fa939d8917abe20709ad72c40496b083cea5f86f.tar.gz tmwa-fa939d8917abe20709ad72c40496b083cea5f86f.tar.bz2 tmwa-fa939d8917abe20709ad72c40496b083cea5f86f.tar.xz tmwa-fa939d8917abe20709ad72c40496b083cea5f86f.zip |
Added @wgm command to whisper all online GMs (if any)
-rw-r--r-- | src/map/atcommand.c | 13 | ||||
-rw-r--r-- | src/map/atcommand.h | 1 | ||||
-rw-r--r-- | src/map/tmw.c | 6 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index a981607..7d706e1 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -31,6 +31,7 @@ #include "trade.h" #include "core.h" +#include "tmw.h" #define STATE_BLIND 0x10 @@ -201,6 +202,7 @@ ATCOMMAND_FUNC(invisible); // [Fate] ATCOMMAND_FUNC(visible); // [Fate] ATCOMMAND_FUNC(iterate_forward_over_players); // [Fate] ATCOMMAND_FUNC(iterate_backwards_over_players); // [Fate] +ATCOMMAND_FUNC(wgm); /*========================================== *AtCommandInfo atcommand_info[]構造体の定義 @@ -387,6 +389,7 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_Visible, "@visible", 60, atcommand_visible }, // [Fate] { AtCommand_IterateForward, "@hugo", 60, atcommand_iterate_forward_over_players }, // [Fate] { AtCommand_IterateBackward, "@linus", 60, atcommand_iterate_backwards_over_players }, // [Fate] + { AtCommand_Wgm, "@wgm", 0, atcommand_wgm }, // add new commands before this line { AtCommand_Unknown, NULL, 1, NULL } @@ -638,7 +641,8 @@ is_atcommand(const int fd, struct map_session_data* sd, const char* message, int sprintf(output, msg_table[154], command); // %s failed. clif_displaymessage(fd, output); } else { - log_atcommand(sd, message); + if (get_atcommand_level(type) != 0) // Don't log level 0 commands + log_atcommand(sd, message); } } @@ -7050,3 +7054,10 @@ atcommand_iterate_backwards_over_players( return atcommand_jump_iterate(fd, sd, command, message, map_get_last_session, map_get_prev_session); } + +int atcommand_wgm( + const int fd, struct map_session_data* sd, + const char* command, const char* message) +{ + tmw_GmHackMsg("%s: %s", sd->status.name, message); +} diff --git a/src/map/atcommand.h b/src/map/atcommand.h index ae60537..575bad4 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -180,6 +180,7 @@ enum AtCommandType { AtCommand_Visible, AtCommand_IterateForward, AtCommand_IterateBackward, + AtCommand_Wgm, // end AtCommand_Unknown, AtCommand_MAX diff --git a/src/map/tmw.c b/src/map/tmw.c index da43138..6a2df32 100644 --- a/src/map/tmw.c +++ b/src/map/tmw.c @@ -112,5 +112,9 @@ void tmw_GmHackMsg(const char *fmt, ...) { vsnprintf(buf, 511, fmt, ap); va_end(ap); - intif_wis_message_to_gm(wisp_server_name, battle_config.hack_info_GM_level, buf, strlen(buf) + 1); + char outbuf[512+5]; + strcat(outbuf, "[GM] "); + strcat(outbuf, buf); + + intif_wis_message_to_gm(wisp_server_name, battle_config.hack_info_GM_level, outbuf, strlen(outbuf) + 1); } |