summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/atcommand.c13
-rw-r--r--src/map/atcommand.h1
-rw-r--r--src/map/tmw.c6
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);
}