Fixed bugreport:5722 now client "/" commands that use @command functionality will respect the atcommand_symbol config. Special Thanks to Lighta

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16108 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
shennetsind 2012-05-13 08:51:43 +00:00
parent bf1f8a237f
commit 13b40cc149
2 changed files with 53 additions and 49 deletions

View File

@ -9550,7 +9550,7 @@ void clif_parse_MapMove(int fd, struct map_session_data *sd)
map_name = (char*)RFIFOP(fd,2); map_name = (char*)RFIFOP(fd,2);
map_name[MAP_NAME_LENGTH_EXT-1]='\0'; map_name[MAP_NAME_LENGTH_EXT-1]='\0';
sprintf(command, "@mapmove %s %d %d", map_name, RFIFOW(fd,18), RFIFOW(fd,20)); sprintf(command, "%cmapmove %s %d %d", atcommand_symbol, map_name, RFIFOW(fd,18), RFIFOW(fd,20));
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }
@ -9933,7 +9933,7 @@ void clif_parse_Broadcast(int fd, struct map_session_data* sd)
// as the length varies depending on the command used, just block unreasonably long strings // as the length varies depending on the command used, just block unreasonably long strings
len = mes_len_check(msg, len, CHAT_SIZE_MAX); len = mes_len_check(msg, len, CHAT_SIZE_MAX);
sprintf(command, "@kami %s", msg); sprintf(command, "%ckami %s", atcommand_symbol, msg);
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }
@ -11068,12 +11068,15 @@ void clif_parse_SolveCharName(int fd, struct map_session_data *sd)
/// type: /// type:
/// 0 = state /// 0 = state
/// 1 = skill /// 1 = skill
void clif_parse_ResetChar(int fd, struct map_session_data *sd) void clif_parse_ResetChar(int fd, struct map_session_data *sd) {
{ char cmd[15];
if( RFIFOW(fd,2) ) if( RFIFOW(fd,2) )
is_atcommand(fd, sd, "@resetskill", 1); sprintf(cmd,"%cresetskill",atcommand_symbol);
else else
is_atcommand(fd, sd, "@resetstat", 1); sprintf(cmd,"%cresetstat",atcommand_symbol);
is_atcommand(fd, sd, cmd, 1);
} }
@ -11089,7 +11092,7 @@ void clif_parse_LocalBroadcast(int fd, struct map_session_data* sd)
// as the length varies depending on the command used, just block unreasonably long strings // as the length varies depending on the command used, just block unreasonably long strings
len = mes_len_check(msg, len, CHAT_SIZE_MAX); len = mes_len_check(msg, len, CHAT_SIZE_MAX);
sprintf(command, "@lkami %s", msg); sprintf(command, "%clkami %s", atcommand_symbol, msg);
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }
@ -12161,7 +12164,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd)
case BL_PC: case BL_PC:
{ {
char command[NAME_LENGTH+6]; char command[NAME_LENGTH+6];
sprintf(command, "@kick %s", status_get_name(target)); sprintf(command, "%ckick %s", atcommand_symbol, status_get_name(target));
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }
break; break;
@ -12185,7 +12188,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd)
case BL_NPC: case BL_NPC:
{ {
char command[NAME_LENGTH+11]; char command[NAME_LENGTH+11];
sprintf(command, "@unloadnpc %s", status_get_name(target)); sprintf(command, "%cunloadnpc %s", atcommand_symbol, status_get_name(target));
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }
break; break;
@ -12199,9 +12202,10 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd)
/// /killall (CZ_DISCONNECT_ALL_CHARACTER). /// /killall (CZ_DISCONNECT_ALL_CHARACTER).
/// Request to disconnect all characters. /// Request to disconnect all characters.
/// 00ce /// 00ce
void clif_parse_GMKickAll(int fd, struct map_session_data* sd) void clif_parse_GMKickAll(int fd, struct map_session_data* sd) {
{ char cmd[15];
is_atcommand(fd, sd, "@kickall", 1); sprintf(cmd,"%ckickall",atcommand_symbol);
is_atcommand(fd, sd, cmd, 1);
} }
@ -12220,7 +12224,7 @@ void clif_parse_GMShift(int fd, struct map_session_data *sd)
player_name = (char*)RFIFOP(fd,2); player_name = (char*)RFIFOP(fd,2);
player_name[NAME_LENGTH-1] = '\0'; player_name[NAME_LENGTH-1] = '\0';
sprintf(command, "@jumpto %s", player_name); sprintf(command, "%cjumpto %s", atcommand_symbol, player_name);
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }
@ -12237,7 +12241,7 @@ void clif_parse_GMRemove2(int fd, struct map_session_data* sd)
if( (pl_sd = map_id2sd(account_id)) != NULL ) if( (pl_sd = map_id2sd(account_id)) != NULL )
{ {
char command[NAME_LENGTH+8]; char command[NAME_LENGTH+8];
sprintf(command, "@jumpto %s", pl_sd->status.name); sprintf(command, "%cjumpto %s", atcommand_symbol, pl_sd->status.name);
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }
} }
@ -12258,7 +12262,7 @@ void clif_parse_GMRecall(int fd, struct map_session_data *sd)
player_name = (char*)RFIFOP(fd,2); player_name = (char*)RFIFOP(fd,2);
player_name[NAME_LENGTH-1] = '\0'; player_name[NAME_LENGTH-1] = '\0';
sprintf(command, "@recall %s", player_name); sprintf(command, "%crecall %s", atcommand_symbol, player_name);
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }
@ -12275,7 +12279,7 @@ void clif_parse_GMRecall2(int fd, struct map_session_data* sd)
if( (pl_sd = map_id2sd(account_id)) != NULL ) if( (pl_sd = map_id2sd(account_id)) != NULL )
{ {
char command[NAME_LENGTH+8]; char command[NAME_LENGTH+8];
sprintf(command, "@recall %s", pl_sd->status.name); sprintf(command, "%crecall %s", atcommand_symbol, pl_sd->status.name);
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }
} }
@ -12293,13 +12297,13 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd)
monster_item_name[NAME_LENGTH-1] = '\0'; monster_item_name[NAME_LENGTH-1] = '\0';
if( mobdb_searchname(monster_item_name) ) { if( mobdb_searchname(monster_item_name) ) {
snprintf(command, sizeof(command)-1, "@monster %s", monster_item_name); snprintf(command, sizeof(command)-1, "%cmonster %s", atcommand_symbol, monster_item_name);
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
return; return;
} }
if( itemdb_searchname(monster_item_name) ) { if( itemdb_searchname(monster_item_name) ) {
snprintf(command, sizeof(command)-1, "@item %s", monster_item_name); snprintf(command, sizeof(command)-1, "%citem %s", atcommand_symbol, monster_item_name);
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
return; return;
} }
@ -12310,9 +12314,12 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd)
/// 019d <effect state>.L /// 019d <effect state>.L
/// effect state: /// effect state:
/// TODO: Any OPTION_* ? /// TODO: Any OPTION_* ?
void clif_parse_GMHide(int fd, struct map_session_data *sd) void clif_parse_GMHide(int fd, struct map_session_data *sd) {
{ char cmd[6];
is_atcommand(fd, sd, "@hide", 1);
sprintf(cmd,"%chide",atcommand_symbol);
is_atcommand(fd, sd, cmd, 1);
} }
@ -12344,7 +12351,7 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd)
if( dstsd == NULL ) if( dstsd == NULL )
return; return;
sprintf(command, "@mute %d %s", value, dstsd->status.name); sprintf(command, "%cmute %d %s", atcommand_symbol, value, dstsd->status.name);
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }
@ -12358,7 +12365,7 @@ void clif_parse_GMRc(int fd, struct map_session_data* sd)
char *name = (char*)RFIFOP(fd,2); char *name = (char*)RFIFOP(fd,2);
name[NAME_LENGTH-1] = '\0'; name[NAME_LENGTH-1] = '\0';
sprintf(command, "@mute %d %s", 60, name); sprintf(command, "%cmute %d %s", atcommand_symbol, 60, name);
is_atcommand(fd, sd, command, 1); is_atcommand(fd, sd, command, 1);
} }

View File

@ -5476,34 +5476,31 @@ void status_set_viewdata(struct block_list *bl, int class_)
if (pcdb_checkid(class_)) { if (pcdb_checkid(class_)) {
if (sd->sc.option&OPTION_WEDDING) if (sd->sc.option&OPTION_WEDDING)
class_ = JOB_WEDDING; class_ = JOB_WEDDING;
else else if (sd->sc.option&OPTION_SUMMER)
if (sd->sc.option&OPTION_SUMMER)
class_ = JOB_SUMMER; class_ = JOB_SUMMER;
else else if (sd->sc.option&OPTION_XMAS)
if (sd->sc.option&OPTION_XMAS)
class_ = JOB_XMAS; class_ = JOB_XMAS;
else else if (sd->sc.option&OPTION_RIDING) {
if (sd->sc.option&OPTION_RIDING) switch (class_) { //Adapt class to a Mounted one.
switch (class_) case JOB_KNIGHT:
{ //Adapt class to a Mounted one. class_ = JOB_KNIGHT2;
case JOB_KNIGHT: break;
class_ = JOB_KNIGHT2; case JOB_CRUSADER:
break; class_ = JOB_CRUSADER2;
case JOB_CRUSADER: break;
class_ = JOB_CRUSADER2; case JOB_LORD_KNIGHT:
break; class_ = JOB_LORD_KNIGHT2;
case JOB_LORD_KNIGHT: break;
class_ = JOB_LORD_KNIGHT2; case JOB_PALADIN:
break; class_ = JOB_PALADIN2;
case JOB_PALADIN: break;
class_ = JOB_PALADIN2; case JOB_BABY_KNIGHT:
break; class_ = JOB_BABY_KNIGHT2;
case JOB_BABY_KNIGHT: break;
class_ = JOB_BABY_KNIGHT2; case JOB_BABY_CRUSADER:
break; class_ = JOB_BABY_CRUSADER2;
case JOB_BABY_CRUSADER: break;
class_ = JOB_BABY_CRUSADER2; }
break;
} }
sd->vd.class_ = class_; sd->vd.class_ = class_;
clif_get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield); clif_get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield);