summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorremoitnane <remoit(DOT)nane(AT)gmail(DOT)com>2010-08-14 01:39:32 -0700
committerChuck Miller <shadowmil@gmail.com>2010-08-15 13:45:21 -0400
commit0d89804dd07e811d0a8573d3a428bddc476c26bb (patch)
tree4c0bebf5aa333458022006c6b811a0aa2b0d823b /src/map/atcommand.c
parent7d1050ac6dfb32e9375a20001d71d052148689e9 (diff)
downloadtmwa-0d89804dd07e811d0a8573d3a428bddc476c26bb.tar.gz
tmwa-0d89804dd07e811d0a8573d3a428bddc476c26bb.tar.bz2
tmwa-0d89804dd07e811d0a8573d3a428bddc476c26bb.tar.xz
tmwa-0d89804dd07e811d0a8573d3a428bddc476c26bb.zip
Centralize chat validation and simplify at-command processing
Signed-off-by: Chuck Miller <shadowmil@gmail.com>
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index cfd46a7..8d69b21 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -710,8 +710,6 @@ AtCommandType
is_atcommand (const int fd, struct map_session_data *sd, const char *message,
int gmlvl)
{
- const char *str = message;
- int s_flag = 0;
AtCommandInfo info;
AtCommandType type;
@@ -721,22 +719,14 @@ is_atcommand (const int fd, struct map_session_data *sd, const char *message,
return AtCommand_None;
memset (&info, 0, sizeof (info));
- str += strlen (sd->status.name);
- while (*str && (isspace (*str) || (s_flag == 0 && *str == ':')))
- {
- if (*str == ':')
- s_flag = 1;
- str++;
- }
- if (!*str)
- return AtCommand_None;
- type = atcommand (gmlvl > 0 ? gmlvl : pc_isGM (sd), str, &info);
+ type = atcommand (gmlvl > 0 ? gmlvl : pc_isGM (sd), message, &info);
if (type != AtCommand_None)
{
char command[100];
char output[200];
- const char *p = str;
+ const char *str = message;
+ const char *p = message;
memset (command, '\0', sizeof (command));
memset (output, '\0', sizeof (output));
while (*p && !isspace (*p))