From fff598e4cd2c9678ff99d85dfa498ea1399a2148 Mon Sep 17 00:00:00 2001 From: Lupus Date: Sat, 26 Mar 2005 21:56:42 +0000 Subject: added logging filters. optimized ATCommands temp strings usage git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1302 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-SVN.txt | 4 + conf-tmpl/log_athena.conf | 26 ++ src/map/atcommand.c | 1066 +++++++++++++++++++++------------------------ src/map/log.c | 109 ++++- src/map/log.h | 1 + src/map/mob.c | 3 + 6 files changed, 616 insertions(+), 593 deletions(-) diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt index 2219d2176..2e825db6b 100644 --- a/Changelog-SVN.txt +++ b/Changelog-SVN.txt @@ -1,6 +1,10 @@ Date Added 03/27 + * Added flexible Filter to the Monster Drops logging [Lupus] + - Now you can choose what types of items either to log or not. + - You can also log expensive items (you can set the min logging price) + * Optimized a bit ATCommands.c functions (inspired by Freya) [Lupus] * Added missing parenthesis in my Improve Dodge code, not giving +4/lv to proper jobs [DracoRPG] * Added all released cards into monsters drops and Old Card Album [Lupus] 03/25 diff --git a/conf-tmpl/log_athena.conf b/conf-tmpl/log_athena.conf index 35f5eb055..c1236480a 100644 --- a/conf-tmpl/log_athena.conf +++ b/conf-tmpl/log_athena.conf @@ -6,6 +6,32 @@ enable_logs: 1 // Use MySQL Logs? (SQL Version Only) sql_logs: 0 +// LOGGING FILTERS by Lupus +//========== It works for Monster Drops yet ======== +what_items_log: 1023 +//0 = none, 1023 = any +//Bits | +//1 - Healing items (Potions) +//2 - Usable Items +//4 - Etc Items +//8 - Weapon +//16 - Shields,Armor,Headgears,Accessories,etc +//32 - Cards +//64 - Pet Accessories +//128 - Eggs (well, monsters don't drop 'em but we'll use the same system for ALL logs) +//256 - Log expensive items ( >= price_log) +//512 - Log big amount of items ( >= amount_log) Note: Amount is ignored in Monster Drops Log +//1024 - Log items which have scripts (not implemented yet) + +//For example: 258 -> log all USABLE and all items which price is >= price_items_log +//For example: 568 -> log all CARDS,WEAPON,ARMOR and all items which amount >= amount_items_log + +//don't log it if the current item price < price_items_log +price_items_log: 1000 + +//don't log it if the current item amount < amount_items_log +amount_items_log: 100 +//================================================== // Log Dead Branch Usage log_branch: 0 diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 0dac4f09c..96a0ee29a 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -544,6 +544,13 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_Unknown, NULL, 1, NULL } }; +/*========================================= + * Generic variables + *----------------------------------------- + */ +unsigned char atcmd_output[200]; +unsigned char atcmd_player_name[100]; + /*==================================================== * This function return the name of the job (by [Yor]) *---------------------------------------------------- @@ -747,10 +754,9 @@ is_atcommand(const int fd, struct map_session_data* sd, const char* message, int type = atcommand(sd, gmlvl > 0 ? gmlvl : pc_isGM(sd), str, &info); if (type != AtCommand_None) { char command[100]; - char output[200]; const char* p = str; memset(command, '\0', sizeof(command)); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); while (*p && !isspace(*p)) p++; if (p - str >= sizeof(command)) // too long @@ -760,13 +766,13 @@ is_atcommand(const int fd, struct map_session_data* sd, const char* message, int p++; if (type == AtCommand_Unknown || info.proc == NULL) { - sprintf(output, msg_table[153], command); // %s is Unknown Command. - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[153], command); // %s is Unknown Command. + clif_displaymessage(fd, atcmd_output); } else { if (info.proc(fd, sd, command, p) != 0) { // Command can not be executed - sprintf(output, msg_table[154], command); // %s failed. - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[154], command); // %s failed. + clif_displaymessage(fd, atcmd_output); } } @@ -852,7 +858,6 @@ static int atmobsearch_sub(struct block_list *bl,va_list ap) int mob_id,fd; static int number=0; struct mob_data *md; - char output[128]; nullpo_retr(0, bl); @@ -866,9 +871,9 @@ static int atmobsearch_sub(struct block_list *bl,va_list ap) md = (struct mob_data *)bl; if(md && fd && (mob_id==-1 || (md->class_==mob_id))){ - snprintf(output, sizeof output, "%2d[%3d:%3d] %s", + snprintf(atcmd_output, sizeof atcmd_output, "%2d[%3d:%3d] %s", ++number,bl->x, bl->y,md->name); - clif_displaymessage(fd, output); + clif_displaymessage(fd, atcmd_output); } return 0; } @@ -1082,29 +1087,27 @@ int atcommand_where( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char character[100]; - char output[200]; struct map_session_data *pl_sd = NULL; nullpo_retr(-1, sd); if (!message || !*message) return -1; - memset(character, '\0', sizeof character); - if (sscanf(message, "%99[^\n]", character) < 1) + memset(atcmd_player_name, '\0', sizeof atcmd_player_name); + if (sscanf(message, "%99[^\n]", atcmd_player_name) < 1) return -1; - if(strncmp(sd->status.name,character,24)==0) + if(strncmp(sd->status.name,atcmd_player_name,24)==0) return -1; - if ((pl_sd = map_nick2sd(character)) == NULL) { - snprintf(output, sizeof output, "%s %d %d", + if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) { + snprintf(atcmd_output, sizeof atcmd_output, "%s %d %d", sd->mapname, sd->bl.x, sd->bl.y); - clif_displaymessage(fd, output); + clif_displaymessage(fd, atcmd_output); return -1; } - snprintf(output, sizeof output, "%s %s %d %d", - character, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); - clif_displaymessage(fd, output); + snprintf(atcmd_output, sizeof atcmd_output, "%s %s %d %d", + atcmd_player_name, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); + clif_displaymessage(fd, atcmd_output); return 0; } @@ -1117,24 +1120,22 @@ int atcommand_jumpto( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char character[100]; - char output[200]; struct map_session_data *pl_sd = NULL; nullpo_retr(-1, sd); - if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) { + if (!message || !*message || sscanf(message, "%99[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, "Please, enter a player name (usage: @jumpto/@warpto/@goto )."); return -1; } - memset(character, '\0', sizeof character); - if (sscanf(message, "%99[^\n]", character) < 1) + memset(atcmd_player_name, '\0', sizeof atcmd_player_name); + if (sscanf(message, "%99[^\n]", atcmd_player_name) < 1) return -1; - if(strncmp(sd->status.name,character,24)==0) //Yourself mate? Tsk tsk tsk. + if(strncmp(sd->status.name,atcmd_player_name,24)==0) //Yourself mate? Tsk tsk tsk. return -1; - if ((pl_sd = map_nick2sd(character)) != NULL) { + if ((pl_sd = map_nick2sd(atcmd_player_name)) != NULL) { if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) { clif_displaymessage(fd, msg_table[247]); return -1; @@ -1144,8 +1145,8 @@ int atcommand_jumpto( return -1; } pc_setpos(sd, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y, 3); - sprintf(output, msg_table[4], character); // Jump to %s - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[4], atcmd_player_name); // Jump to %s + clif_displaymessage(fd, atcmd_output); } else { clif_displaymessage(fd, msg_table[3]); // Character not found. return -1; @@ -1162,12 +1163,11 @@ int atcommand_jump( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char output[200]; int x = 0, y = 0; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); sscanf(message, "%d %d", &x, &y); @@ -1181,8 +1181,8 @@ int atcommand_jump( return -1; } pc_setpos(sd, sd->mapname, x, y, 3); - sprintf(output, msg_table[5], x, y); // Jump to %d %d - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[5], x, y); // Jump to %d %d + clif_displaymessage(fd, atcmd_output); } else { clif_displaymessage(fd, msg_table[2]); // Coordinates out of range. return -1; @@ -1199,7 +1199,6 @@ int atcommand_who( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char output[200]; struct map_session_data *pl_sd; int i, j, count; int pl_GM_level, GM_level; @@ -1208,7 +1207,7 @@ int atcommand_who( nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(match_text, '\0', sizeof(match_text)); memset(player_name, '\0', sizeof(player_name)); @@ -1228,10 +1227,10 @@ int atcommand_who( player_name[j] = tolower(player_name[j]); if (strstr(player_name, match_text) != NULL) { // search with no case sensitive if (pl_GM_level > 0) - sprintf(output, "(CID:%d/AID:%d) Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.char_id, pl_sd->status.account_id, pl_sd->status.name, pl_GM_level, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); + sprintf(atcmd_output, "(CID:%d/AID:%d) Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.char_id, pl_sd->status.account_id, pl_sd->status.name, pl_GM_level, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); else - sprintf(output, "(CID:%d/AID:%d) Name: %s | Location: %s %d %d", pl_sd->status.char_id, pl_sd->status.account_id, pl_sd->status.name, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "(CID:%d/AID:%d) Name: %s | Location: %s %d %d", pl_sd->status.char_id, pl_sd->status.account_id, pl_sd->status.name, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); + clif_displaymessage(fd, atcmd_output); count++; } } @@ -1243,8 +1242,8 @@ int atcommand_who( else if (count == 1) clif_displaymessage(fd, msg_table[29]); // 1 player found. else { - sprintf(output, msg_table[30], count); // %d players found. - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[30], count); // %d players found. + clif_displaymessage(fd, atcmd_output); } return 0; @@ -1258,7 +1257,6 @@ int atcommand_who2( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char output[200]; struct map_session_data *pl_sd; int i, j, count; int pl_GM_level, GM_level; @@ -1267,7 +1265,7 @@ int atcommand_who2( nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(match_text, '\0', sizeof(match_text)); memset(player_name, '\0', sizeof(player_name)); @@ -1287,10 +1285,10 @@ int atcommand_who2( player_name[j] = tolower(player_name[j]); if (strstr(player_name, match_text) != NULL) { // search with no case sensitive if (pl_GM_level > 0) - sprintf(output, "Name: %s (GM:%d) | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_GM_level, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); + sprintf(atcmd_output, "Name: %s (GM:%d) | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_GM_level, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); else - sprintf(output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); + clif_displaymessage(fd, atcmd_output); count++; } } @@ -1302,8 +1300,8 @@ int atcommand_who2( else if (count == 1) clif_displaymessage(fd, msg_table[29]); // 1 player found. else { - sprintf(output, msg_table[30], count); // %d players found. - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[30], count); // %d players found. + clif_displaymessage(fd, atcmd_output); } return 0; @@ -1319,7 +1317,6 @@ int atcommand_who3( { char temp0[100]; char temp1[100]; - char output[200]; struct map_session_data *pl_sd; int i, j, count; int pl_GM_level, GM_level; @@ -1332,7 +1329,7 @@ int atcommand_who3( memset(temp0, '\0', sizeof(temp0)); memset(temp1, '\0', sizeof(temp1)); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(match_text, '\0', sizeof(match_text)); memset(player_name, '\0', sizeof(player_name)); @@ -1362,10 +1359,10 @@ int atcommand_who3( else sprintf(temp0, "%s", p->name); if (pl_GM_level > 0) - sprintf(output, "Name: %s (GM:%d) | Party: '%s' | Guild: '%s'", pl_sd->status.name, pl_GM_level, temp0, temp1); + sprintf(atcmd_output, "Name: %s (GM:%d) | Party: '%s' | Guild: '%s'", pl_sd->status.name, pl_GM_level, temp0, temp1); else - sprintf(output, "Name: %s | Party: '%s' | Guild: '%s'", pl_sd->status.name, temp0, temp1); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Name: %s | Party: '%s' | Guild: '%s'", pl_sd->status.name, temp0, temp1); + clif_displaymessage(fd, atcmd_output); count++; } } @@ -1377,8 +1374,8 @@ int atcommand_who3( else if (count == 1) clif_displaymessage(fd, msg_table[29]); // 1 player found. else { - sprintf(output, msg_table[30], count); // %d players found. - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[30], count); // %d players found. + clif_displaymessage(fd, atcmd_output); } return 0; @@ -1392,14 +1389,13 @@ int atcommand_whomap( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char output[200]; struct map_session_data *pl_sd; int i, count; int pl_GM_level, GM_level; int map_id; char map_name[100]; - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(map_name, '\0', sizeof(map_name)); if (!message || !*message) @@ -1420,10 +1416,10 @@ int atcommand_whomap( if (!((battle_config.hide_GM_session || (pl_sd->status.option & OPTION_HIDE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level if (pl_sd->bl.m == map_id) { if (pl_GM_level > 0) - sprintf(output, "Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.name, pl_GM_level, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); + sprintf(atcmd_output, "Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.name, pl_GM_level, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); else - sprintf(output, "Name: %s | Location: %s %d %d", pl_sd->status.name, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Name: %s | Location: %s %d %d", pl_sd->status.name, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); + clif_displaymessage(fd, atcmd_output); count++; } } @@ -1431,13 +1427,13 @@ int atcommand_whomap( } if (count == 0) - sprintf(output, msg_table[54], map[map_id].name); // No player found in map '%s'. + sprintf(atcmd_output, msg_table[54], map[map_id].name); // No player found in map '%s'. else if (count == 1) - sprintf(output, msg_table[55], map[map_id].name); // 1 player found in map '%s'. + sprintf(atcmd_output, msg_table[55], map[map_id].name); // 1 player found in map '%s'. else { - sprintf(output, msg_table[56], count, map[map_id].name); // %d players found in map '%s'. + sprintf(atcmd_output, msg_table[56], count, map[map_id].name); // %d players found in map '%s'. } - clif_displaymessage(fd, output); + clif_displaymessage(fd, atcmd_output); return 0; } @@ -1450,7 +1446,6 @@ int atcommand_whomap2( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char output[200]; struct map_session_data *pl_sd; int i, count; int pl_GM_level, GM_level; @@ -1459,7 +1454,7 @@ int atcommand_whomap2( nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(map_name, '\0', sizeof(map_name)); if (!message || !*message) @@ -1480,10 +1475,10 @@ int atcommand_whomap2( if (!((battle_config.hide_GM_session || (pl_sd->status.option & OPTION_HIDE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level if (pl_sd->bl.m == map_id) { if (pl_GM_level > 0) - sprintf(output, "Name: %s (GM:%d) | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_GM_level, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); + sprintf(atcmd_output, "Name: %s (GM:%d) | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_GM_level, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); else - sprintf(output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); + clif_displaymessage(fd, atcmd_output); count++; } } @@ -1491,13 +1486,13 @@ int atcommand_whomap2( } if (count == 0) - sprintf(output, msg_table[54], map[map_id].name); // No player found in map '%s'. + sprintf(atcmd_output, msg_table[54], map[map_id].name); // No player found in map '%s'. else if (count == 1) - sprintf(output, msg_table[55], map[map_id].name); // 1 player found in map '%s'. + sprintf(atcmd_output, msg_table[55], map[map_id].name); // 1 player found in map '%s'. else { - sprintf(output, msg_table[56], count, map[map_id].name); // %d players found in map '%s'. + sprintf(atcmd_output, msg_table[56], count, map[map_id].name); // %d players found in map '%s'. } - clif_displaymessage(fd, output); + clif_displaymessage(fd, atcmd_output); return 0; } @@ -1512,7 +1507,6 @@ int atcommand_whomap3( { char temp0[100]; char temp1[100]; - char output[200]; struct map_session_data *pl_sd; int i, count; int pl_GM_level, GM_level; @@ -1525,7 +1519,7 @@ int atcommand_whomap3( memset(temp0, '\0', sizeof(temp0)); memset(temp1, '\0', sizeof(temp1)); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(map_name, '\0', sizeof(map_name)); if (!message || !*message) @@ -1556,10 +1550,10 @@ int atcommand_whomap3( else sprintf(temp0, "%s", p->name); if (pl_GM_level > 0) - sprintf(output, "Name: %s (GM:%d) | Party: '%s' | Guild: '%s'", pl_sd->status.name, pl_GM_level, temp0, temp1); + sprintf(atcmd_output, "Name: %s (GM:%d) | Party: '%s' | Guild: '%s'", pl_sd->status.name, pl_GM_level, temp0, temp1); else - sprintf(output, "Name: %s | Party: '%s' | Guild: '%s'", pl_sd->status.name, temp0, temp1); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Name: %s | Party: '%s' | Guild: '%s'", pl_sd->status.name, temp0, temp1); + clif_displaymessage(fd, atcmd_output); count++; } } @@ -1567,13 +1561,13 @@ int atcommand_whomap3( } if (count == 0) - sprintf(output, msg_table[54], map[map_id].name); // No player found in map '%s'. + sprintf(atcmd_output, msg_table[54], map[map_id].name); // No player found in map '%s'. else if (count == 1) - sprintf(output, msg_table[55], map[map_id].name); // 1 player found in map '%s'. + sprintf(atcmd_output, msg_table[55], map[map_id].name); // 1 player found in map '%s'. else { - sprintf(output, msg_table[56], count, map[map_id].name); // %d players found in map '%s'. + sprintf(atcmd_output, msg_table[56], count, map[map_id].name); // %d players found in map '%s'. } - clif_displaymessage(fd, output); + clif_displaymessage(fd, atcmd_output); return 0; } @@ -1588,7 +1582,6 @@ int atcommand_whogm( { char temp0[100]; char temp1[100]; - char output[200]; struct map_session_data *pl_sd; int i, j, count; int pl_GM_level, GM_level; @@ -1601,7 +1594,7 @@ int atcommand_whogm( memset(temp0, '\0', sizeof(temp0)); memset(temp1, '\0', sizeof(temp1)); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(match_text, '\0', sizeof(match_text)); memset(player_name, '\0', sizeof(player_name)); @@ -1621,10 +1614,10 @@ int atcommand_whogm( for (j = 0; player_name[j]; j++) player_name[j] = tolower(player_name[j]); if (strstr(player_name, match_text) != NULL) { // search with no case sensitive - sprintf(output, "Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.name, pl_GM_level, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); - clif_displaymessage(fd, output); - sprintf(output, " BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.name, pl_GM_level, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y); + clif_displaymessage(fd, atcmd_output); + sprintf(atcmd_output, " BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); + clif_displaymessage(fd, atcmd_output); g = guild_search(pl_sd->status.guild_id); if (g == NULL) sprintf(temp1, "None"); @@ -1635,8 +1628,8 @@ int atcommand_whogm( sprintf(temp0, "None"); else sprintf(temp0, "%s", p->name); - sprintf(output, " Party: '%s' | Guild: '%s'", temp0, temp1); - clif_displaymessage(fd, output); + sprintf(atcmd_output, " Party: '%s' | Guild: '%s'", temp0, temp1); + clif_displaymessage(fd, atcmd_output); count++; } } @@ -1649,8 +1642,8 @@ int atcommand_whogm( else if (count == 1) clif_displaymessage(fd, msg_table[151]); // 1 GM found. else { - sprintf(output, msg_table[152], count); // %d GMs found. - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[152], count); // %d GMs found. + clif_displaymessage(fd, atcmd_output); } return 0; @@ -1660,7 +1653,6 @@ int atcommand_whozeny( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char output[200]; struct map_session_data *pl_sd; int i, j, count,c; char match_text[100]; @@ -1672,7 +1664,7 @@ int atcommand_whozeny( nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(match_text, '\0', sizeof(match_text)); memset(player_name, '\0', sizeof(player_name)); @@ -1704,8 +1696,8 @@ int atcommand_whozeny( continue; if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && zeny[c] && counted[i]==0) { if(pl_sd->status.zeny==zeny[c]) { - sprintf(output, "Name: %s | Zeny: %d", pl_sd->status.name, pl_sd->status.zeny); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Name: %s | Zeny: %d", pl_sd->status.name, pl_sd->status.zeny); + clif_displaymessage(fd, atcmd_output); zeny[c]=0; counted[i]=1; } @@ -1718,8 +1710,8 @@ int atcommand_whozeny( else if (count == 1) clif_displaymessage(fd, msg_table[29]); // 1 player found. else { - sprintf(output, msg_table[30], count); // %d players found. - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[30], count); // %d players found. + clif_displaymessage(fd, atcmd_output); } aFree(zeny); @@ -1808,16 +1800,15 @@ int atcommand_speed( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char output[200]; int speed; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message) { - sprintf(output, "Please, enter a speed value (usage: @speed <%d-%d>).", MIN_WALK_SPEED, MAX_WALK_SPEED); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Please, enter a speed value (usage: @speed <%d-%d>).", MIN_WALK_SPEED, MAX_WALK_SPEED); + clif_displaymessage(fd, atcmd_output); return -1; } @@ -1829,8 +1820,8 @@ int atcommand_speed( clif_updatestatus(sd, SP_SPEED); clif_displaymessage(fd, msg_table[8]); // Speed changed. } else { - sprintf(output, "Please, enter a valid speed value (usage: @speed <%d-%d>).", MIN_WALK_SPEED, MAX_WALK_SPEED); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Please, enter a valid speed value (usage: @speed <%d-%d>).", MIN_WALK_SPEED, MAX_WALK_SPEED); + clif_displaymessage(fd, atcmd_output); return -1; } @@ -2149,18 +2140,17 @@ int atcommand_kill( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char character[100]; struct map_session_data *pl_sd; nullpo_retr(-1, sd); - memset(character, '\0', sizeof(character)); + memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); - if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) { + if (!message || !*message || sscanf(message, "%99[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, "Please, enter a player name (usage: @kill )."); return -1; } - if ((pl_sd = map_nick2sd(character)) != NULL) { + if ((pl_sd = map_nick2sd(atcmd_player_name)) != NULL) { if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can kill only lower or same level pc_damage(NULL, pl_sd, pl_sd->status.hp + 1); clif_displaymessage(fd, msg_table[14]); // Character killed. @@ -2209,18 +2199,17 @@ int atcommand_kami( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char output[200]; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message) { clif_displaymessage(fd, "Please, enter a message (usage: @kami )."); return -1; } - sscanf(message, "%199[^\n]", output); - intif_GMmessage(output, strlen(output) + 1, (*(command + 5) == 'b') ? 0x10 : 0); + sscanf(message, "%199[^\n]", atcmd_output); + intif_GMmessage(atcmd_output, strlen(atcmd_output) + 1, (*(command + 5) == 'b') ? 0x10 : 0); return 0; } @@ -2767,15 +2756,14 @@ int atcommand_model( const char* command, const char* message) { int hair_style = 0, hair_color = 0, cloth_color = 0; - char output[200]; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d %d %d", &hair_style, &hair_color, &cloth_color) < 1) { - sprintf(output, "Please, enter at least a value (usage: @model ).", + sprintf(atcmd_output, "Please, enter at least a value (usage: @model ).", MIN_HAIR_STYLE, MAX_HAIR_STYLE, MIN_HAIR_COLOR, MAX_HAIR_COLOR, MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); - clif_displaymessage(fd, output); + clif_displaymessage(fd, atcmd_output); return -1; } @@ -2808,14 +2796,13 @@ int atcommand_model( int atcommand_dye(const int fd, struct map_session_data* sd, const char* command, const char* message) { int cloth_color = 0; - char output[200]; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &cloth_color) < 1) { - sprintf(output, "Please, enter a clothes color (usage: @dye/@ccolor ).", MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Please, enter a clothes color (usage: @dye/@ccolor ).", MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); + clif_displaymessage(fd, atcmd_output); return -1; } @@ -2837,14 +2824,13 @@ int atcommand_dye(const int fd, struct map_session_data* sd, const char* command int atcommand_hair_style(const int fd, struct map_session_data* sd, const char* command, const char* message) { int hair_style = 0; - char output[200]; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &hair_style) < 1) { - sprintf(output, "Please, enter a hair style (usage: @hairstyle/@hstyle ).", MIN_HAIR_STYLE, MAX_HAIR_STYLE); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Please, enter a hair style (usage: @hairstyle/@hstyle ).", MIN_HAIR_STYLE, MAX_HAIR_STYLE); + clif_displaymessage(fd, atcmd_output); return -1; } @@ -2883,14 +2869,13 @@ atcommand_charhairstyle(const int fd, struct map_session_data* sd, int atcommand_hair_color(const int fd, struct map_session_data* sd, const char* command, const char* message) { int hair_color = 0; - char output[200]; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &hair_color) < 1) { - sprintf(output, "Please, enter a hair color (usage: @haircolor/@hcolor ).", MIN_HAIR_COLOR, MAX_HAIR_COLOR); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Please, enter a hair color (usage: @haircolor/@hcolor ).", MIN_HAIR_COLOR, MAX_HAIR_COLOR); + clif_displaymessage(fd, atcmd_output); return -1; } @@ -2921,7 +2906,6 @@ int atcommand_go( int i; int town; char map_name[100]; - char output[200]; int m; const struct { char map[16]; int x, y; } data[] = { @@ -2954,7 +2938,7 @@ int atcommand_go( } memset(map_name, '\0', sizeof(map_name)); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); // get the number town = atoi(message); @@ -3051,8 +3035,8 @@ int atcommand_go( return -1; } } else { - sprintf(output, msg_table[164], -town-1); // Your memo point #%d doesn't exist. - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[164], -town-1); // Your memo point #%d doesn't exist. + clif_displaymessage(fd, atcmd_output); return -1; } } else if (town >= 0 && town < (int)(sizeof(data) / sizeof(data[0]))) { @@ -3090,7 +3074,6 @@ int atcommand_monster( { char name[100]; char monster[100]; - char output[200]; int mob_id; int number = 0; int x = 0, y = 0; @@ -3101,7 +3084,7 @@ int atcommand_monster( memset(name, '\0', sizeof(name)); memset(monster, '\0', sizeof(monster)); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || (sscanf(message, "\"%[^\"]\" %99s %d %d %d", name, monster, &number, &x, &y) < 2 && @@ -3161,8 +3144,8 @@ int atcommand_monster( if (number == count) clif_displaymessage(fd, msg_table[39]); // All monster summoned! else { - sprintf(output, msg_table[240], count); // %d monster(s) summoned! - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[240], count); // %d monster(s) summoned! + clif_displaymessage(fd, atcmd_output); } else { clif_displaymessage(fd, msg_table[40]); // Invalid monster ID or name. @@ -3181,7 +3164,6 @@ int atcommand_spawn( const char* command, const char* message) { char name[100]; char monster[100]; - char output[200]; int mob_id; int number = 0; int x = 0, y = 0; @@ -3192,7 +3174,7 @@ int atcommand_spawn( nullpo_retr(-1, sd); memset(name, '\0', sizeof(name)); memset(monster, '\0', sizeof(monster)); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || (sscanf(message, "\"%[^\"]\" %99s %d %d %d", name, monster, &number, &x, &y) < 2 && @@ -3253,8 +3235,8 @@ int atcommand_spawn( if (number == count) clif_displaymessage(fd, msg_table[39]); // All monster summoned! else { - sprintf(output, msg_table[240], count); // %d monster(s) summoned! - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[240], count); // %d monster(s) summoned! + clif_displaymessage(fd, atcmd_output); } else { clif_displaymessage(fd, msg_table[40]); // Invalid monster ID or name. @@ -3487,10 +3469,9 @@ int atcommand_refine( { int i, position = 0, refine = 0, current_position, final_refine; int count; - char output[200]; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) { clif_displaymessage(fd, "Please, enter a position and a amount (usage: @refine <+/- amount>)."); @@ -3533,8 +3514,8 @@ int atcommand_refine( else if (count == 1) clif_displaymessage(fd, msg_table[167]); // 1 item has been refined! else { - sprintf(output, msg_table[168], count); // %d items have been refined! - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[168], count); // %d items have been refined! + clif_displaymessage(fd, atcmd_output); } return 0; @@ -3553,10 +3534,9 @@ int atcommand_produce( int flag = 0; struct item_data *item_data; struct item tmp_item; - char output[200]; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(item_name, '\0', sizeof(item_name)); if (!message || !*message || sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1) { @@ -3593,10 +3573,10 @@ int atcommand_produce( if (battle_config.error_log) printf("@produce NOT WEAPON [%d]\n", item_id); if (item_id != 0 && itemdb_exists(item_id)) - sprintf(output, msg_table[169], item_id, item_data->name); // This item (%d: '%s') is not an equipment. + sprintf(atcmd_output, msg_table[169], item_id, item_data->name); // This item (%d: '%s') is not an equipment. else - sprintf(output, msg_table[170]); // This item is not an equipment. - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[170]); // This item is not an equipment. + clif_displaymessage(fd, atcmd_output); return -1; } @@ -3609,19 +3589,18 @@ int atcommand_produce( */ void atcommand_memo_sub(struct map_session_data* sd) { int i; - char output[200]; if (!sd) return; - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); clif_displaymessage(sd->fd, "Your actual memo positions are (except respawn point):"); for (i = MIN_PORTAL_MEMO; i <= MAX_PORTAL_MEMO; i++) { if (sd->status.memo_point[i].map[0]) - sprintf(output, "%d - %s (%d,%d)", i, sd->status.memo_point[i].map, sd->status.memo_point[i].x, sd->status.memo_point[i].y); + sprintf(atcmd_output, "%d - %s (%d,%d)", i, sd->status.memo_point[i].map, sd->status.memo_point[i].x, sd->status.memo_point[i].y); else - sprintf(output, msg_table[171], i); // %d - void - clif_displaymessage(sd->fd, output); + sprintf(atcmd_output, msg_table[171], i); // %d - void + clif_displaymessage(sd->fd, atcmd_output); } return; @@ -3636,10 +3615,9 @@ int atcommand_memo( const char* command, const char* message) { int position = 0; - char output[200]; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &position) < 1) atcommand_memo_sub(sd); @@ -3650,8 +3628,8 @@ int atcommand_memo( return -1; } if (sd->status.memo_point[position].map[0]) { - sprintf(output, msg_table[172], position, sd->status.memo_point[position].map, sd->status.memo_point[position].x, sd->status.memo_point[position].y); // You replace previous memo position %d - %s (%d,%d). - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[172], position, sd->status.memo_point[position].map, sd->status.memo_point[position].x, sd->status.memo_point[position].y); // You replace previous memo position %d - %s (%d,%d). + clif_displaymessage(fd, atcmd_output); } memcpy(sd->status.memo_point[position].map, map[sd->bl.m].name, 24); sd->status.memo_point[position].x = sd->bl.x; @@ -3661,8 +3639,8 @@ int atcommand_memo( clif_displaymessage(fd, msg_table[173]); // Note: you don't have the 'Warp' skill level to use it. atcommand_memo_sub(sd); } else { - sprintf(output, "Please, enter a valid position (usage: @memo ).", MIN_PORTAL_MEMO, MAX_PORTAL_MEMO); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Please, enter a valid position (usage: @memo ).", MIN_PORTAL_MEMO, MAX_PORTAL_MEMO); + clif_displaymessage(fd, atcmd_output); atcommand_memo_sub(sd); return -1; } @@ -3679,14 +3657,13 @@ int atcommand_gat( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char output[200]; int y; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); for (y = 2; y >= -2; y--) { - sprintf(output, "%s (x= %d, y= %d) %02X %02X %02X %02X %02X", + sprintf(atcmd_output, "%s (x= %d, y= %d) %02X %02X %02X %02X %02X", map[sd->bl.m].name, sd->bl.x - 2, sd->bl.y + y, map_getcell(sd->bl.m, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE), map_getcell(sd->bl.m, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE), @@ -3694,7 +3671,7 @@ int atcommand_gat( map_getcell(sd->bl.m, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE), map_getcell(sd->bl.m, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE)); - clif_displaymessage(fd, output); + clif_displaymessage(fd, atcmd_output); } return 0; @@ -3845,14 +3822,13 @@ int atcommand_param( &sd->status.str, &sd->status.agi, &sd->status.vit, &sd->status.int_, &sd->status.dex, &sd->status.luk }; - char output[200]; nullpo_retr(-1, sd); - memset(output, '\0', sizeof(output)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) { - sprintf(output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustement>)."); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustement>)."); + clif_displaymessage(fd, atcmd_output); return -1; } @@ -3864,8 +3840,8 @@ int atcommand_param( } } if (index < 0 || index > MAX_STATUS_TYPE) { // normaly impossible... - sprintf(output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustement>)."); - clif_displaymessage(fd, output); + sprintf(atcmd_output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustement>)."); + clif_displaymessage(fd, atcmd_output); return -1; } @@ -4168,24 +4144,22 @@ atcommand_recall( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char character[100]; - char output[200]; struct map_session_data *pl_sd = NULL; nullpo_retr(-1, sd); - if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) { + if (!message || !*message || sscanf(message, "%99[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, "Please, enter a player name (usage: @recall )."); return -1; } - memset(character, '\0', sizeof character); - if(sscanf(message, "%99[^\n]", character) < 1) + memset(atcmd_player_name, '\0', sizeof atcmd_player_name); + if(sscanf(message, "%99[^\n]", atcmd_player_name) < 1) return -1; - if(strncmp(sd->status.name,character,24)==0) + if(strncmp(sd->status.name,atcmd_player_name,24)==0) return -1; - if ((pl_sd = map_nick2sd(character)) != NULL) { + if ((pl_sd = map_nick2sd(atcmd_player_name)) != NULL) { if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can recall only lower or same level if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) { clif_displaymessage(fd, "You are not authorised to warp somenone to your actual map."); @@ -4196,8 +4170,8 @@ atcommand_recall( return -1; } pc_setpos(pl_sd, sd->mapname, sd->bl.x, sd->bl.y, 2); - sprintf(output, msg_table[46], character); // %s recalled! - clif_displaymessage(fd, output); + sprintf(atcmd_output, msg_table[46], atcmd_player_name); // %s recalled! + clif_displaymessage(fd, atcmd_output); } else { clif_displaymessage(fd, msg_table[81]); // Your GM level don't authorise you to do this action on this player. return -1; @@ -4218,18 +4192,17 @@ int atcommand_revive( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char character[100]; struct map_session_data *pl_sd; nullpo_retr(-1, sd); - memset(character, '\0', sizeof(character)); + memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); - if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) { + if (!message || !*message || sscanf(message, "%99[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, "Please, enter a player name (usage: @revive )."); return -1; } - if ((pl_sd = map_nick2sd(character)) != NULL) { + if ((pl_sd = map_nick2sd(atcmd_player_name)) != NULL) { if (pc_isdead(pl_sd)) { pl_sd->status.hp = pl_sd->status.max_hp; clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1); @@ -4259,25 +4232,24 @@ int atcommand_char_change_sex( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char character[100]; nullpo_retr(-1, sd); - memset(character, '\0', sizeof(character)); + memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); - if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) { + if (!message || !*message || sscanf(message, "%99[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, "Please, enter a player name (usage: @charchangesex )."); return -1; } // check player name - if (strlen(character) < 4) { + if (strlen(atcmd_player_name) < 4) { clif_displaymessage(fd, msg_table[86]); // Sorry, but a player name have at least 4 characters. return -1; - } else if (strlen(character) > 23) { + } else if (strlen(atcmd_player_name) > 23) { clif_displaymessage(fd, msg_table[87]); // Sorry, but a player name have 23 characters maximum. return -1; } else { - chrif_char_ask_name(sd->status.account_id, character, 5, 0, 0, 0, 0, 0, 0); // type: 5 - changesex + chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 5, 0, 0, 0, 0, 0, 0); // type: 5 - changesex clif_displaymessage(fd, msg_table[88]); // Character name sends to char-server to ask it. } @@ -4293,25 +4265,24 @@ int atcommand_char_block( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char character[100]; nullpo_retr(-1, sd); - memset(character, '\0', sizeof(character)); + memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); - if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) { + if (!message || !*message || sscanf(message, "%99[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, "Please, enter a player name (usage: @charblock/@block )."); return -1; } // check player name - if (strlen(character) < 4) { + if (strlen(atcmd_player_name) < 4) { clif_displaymessage(fd, msg_table[86]); // Sorry, but a player name have at least 4 characters. return -1; - } else if (strlen(character) > 23) { + } else if (strlen(atcmd_player_name) > 23) { clif_displaymessage(fd, msg_table[87]); // Sorry, but a player name have 23 characters maximum. return -1; } else { - chrif_char_ask_name(sd->status.account_id, character, 1, 0, 0, 0, 0, 0, 0); // type: 1 - block + chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 1, 0, 0, 0, 0, 0, 0); // type: 1 - block clif_displaymessage(fd, msg_table[88]); // Character name sends to char-server to ask it. } @@ -4338,23 +4309,21 @@ int atcommand_char_ban( const int fd, struct map_session_data* sd, const char* command, const char* message) { - char modif[100], character[100]; char * modif_p; int year, month, day, hour, minute, second, value; nullpo_retr(-1, sd); - memset(modif, '\0', sizeof(modif)); - memset(character, '\0', sizeof(character)); + memset(atcmd_output, '\0', sizeof(atcmd_output)); + memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); - if (!message || !*message || sscanf(message, "%s %99[^\n]", modif, character) < 2) { + if (!message || !*message || sscanf(message, "%s %99[^\n]", atcmd_output, atcmd_player_name) < 2) { clif_displaymessage(fd, "Please, enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish