|
@@ -2889,8 +2889,9 @@ ACMD_FUNC(char_block)
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- chrif_req_login_operation(sd->status.account_id, atcmd_player_name, 1, 0, 0, 0); // type: 1 - block
|
|
|
- clif_displaymessage(fd, msg_txt(sd,88)); // Character name sent to char-server to ask it.
|
|
|
+ chrif_req_login_operation(sd->status.account_id, atcmd_player_name, CHRIF_OP_LOGIN_BLOCK, 0, 0, 0); // type: 1 - block
|
|
|
+ sprintf(atcmd_output, msg_txt(sd,88), "login"); // Sending request to %s server...
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -2903,15 +2904,15 @@ ACMD_FUNC(char_block)
|
|
|
ACMD_FUNC(char_ban)
|
|
|
{
|
|
|
char * modif_p;
|
|
|
- int32 timediff=0; //don't set this as uint as we may want to decrease banned time
|
|
|
- int bantype=0; //2=account block, 6=char specific
|
|
|
+ int32 timediff = 0; //don't set this as uint as we may want to decrease banned time
|
|
|
+ int bantype = 0; //2=account block, 6=char specific
|
|
|
|
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
memset(atcmd_output, '\0', sizeof(atcmd_output));
|
|
|
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
|
|
|
|
|
|
- bantype = strcmpi(command+1,"charban")?2:6; //! FIXME this breaking alias recognition
|
|
|
+ bantype = strcmpi(command+1,"charban") ? CHRIF_OP_LOGIN_BAN : CHRIF_OP_BAN; //! FIXME this breaking alias recognition
|
|
|
if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) {
|
|
|
clif_displaymessage(fd, msg_txt(sd,1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish <time> <char name>).
|
|
|
return -1;
|
|
@@ -2925,28 +2926,29 @@ ACMD_FUNC(char_ban)
|
|
|
|
|
|
if (timediff == 0) { //allow negative ?
|
|
|
char output[256];
|
|
|
- safesnprintf(output,sizeof(output),msg_txt(sd,85),bantype==6?"charban":"ban",timediff); // Invalid time for %s command (time=%d)
|
|
|
+ safesnprintf(output, sizeof(output), msg_txt(sd,85), bantype == CHRIF_OP_BAN ? "charban" : "ban", timediff); // Invalid time for %s command (time=%d)
|
|
|
clif_displaymessage(fd, output);
|
|
|
clif_displaymessage(fd, msg_txt(sd,702)); // Time parameter format is +/-<value> to alter. y/a = Year, m = Month, d/j = Day, h = Hour, n/mn = Minute, s = Second.
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
if( timediff<0 && (
|
|
|
- ( bantype==2 && !pc_can_use_command(sd, "unban", COMMAND_ATCOMMAND) )
|
|
|
- || ( bantype==6 && !pc_can_use_command(sd, "charunban", COMMAND_ATCOMMAND)) )
|
|
|
- ){
|
|
|
+ ( bantype==CHRIF_OP_LOGIN_BAN && !pc_can_use_command(sd, "unban", COMMAND_ATCOMMAND) )
|
|
|
+ || ( bantype==CHRIF_OP_BAN && !pc_can_use_command(sd, "charunban", COMMAND_ATCOMMAND)) )
|
|
|
+ )
|
|
|
+ {
|
|
|
clif_displaymessage(fd,msg_txt(sd,1023)); // You are not allowed to alter the time of a ban.
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- if(bantype==2)
|
|
|
- chrif_req_login_operation(sd->status.account_id, atcmd_player_name, 2, timediff, 0, 0); // type: 2 - ban
|
|
|
+ if (bantype == CHRIF_OP_LOGIN_BAN)
|
|
|
+ chrif_req_login_operation(sd->status.account_id, atcmd_player_name, CHRIF_OP_LOGIN_BAN, timediff, 0, 0); // type: 2 - ban
|
|
|
else
|
|
|
chrif_req_charban(sd->status.account_id, atcmd_player_name,timediff);
|
|
|
-
|
|
|
+
|
|
|
{
|
|
|
char output[256];
|
|
|
- safesnprintf(output,sizeof(output),msg_txt(sd,88),bantype==6?"char":"login"); // Sending request to %s server...
|
|
|
+ safesnprintf(output, sizeof(output), msg_txt(sd,88), bantype == CHRIF_OP_BAN ? "char" : "login"); // Sending request to %s server...
|
|
|
clif_displaymessage(fd, output);
|
|
|
}
|
|
|
return 0;
|
|
@@ -2967,8 +2969,9 @@ ACMD_FUNC(char_unblock)
|
|
|
}
|
|
|
|
|
|
// send answer to login server via char-server
|
|
|
- chrif_req_login_operation(sd->status.account_id, atcmd_player_name, 3, 0, 0, 0); // type: 3 - unblock
|
|
|
- clif_displaymessage(fd, msg_txt(sd,88)); // Character name sent to char-server to ask it.
|
|
|
+ chrif_req_login_operation(sd->status.account_id, atcmd_player_name, CHRIF_OP_LOGIN_UNBLOCK, 0, 0, 0); // type: 3 - unblock
|
|
|
+ sprintf(atcmd_output, msg_txt(sd,88), "login"); // Sending request to %s server...
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -2978,11 +2981,12 @@ ACMD_FUNC(char_unblock)
|
|
|
* char unban command (usage: charunban <player_name>)
|
|
|
*------------------------------------------*/
|
|
|
ACMD_FUNC(char_unban){
|
|
|
- int unbantype=0;
|
|
|
+ int unbantype = 0;
|
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
|
|
|
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
|
|
|
- unbantype = strcmpi(command+1,"charunban")?4:7; //! FIXME this breaking alias recognition
|
|
|
+ unbantype = strcmpi(command+1,"charunban") ? CHRIF_OP_LOGIN_UNBAN : CHRIF_OP_UNBAN; //! FIXME this breaking alias recognition
|
|
|
|
|
|
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
|
|
|
if(unbantype==4) clif_displaymessage(fd, msg_txt(sd,1025)); // Please enter a player name (usage: @unblock <char name>).
|
|
@@ -2990,11 +2994,12 @@ ACMD_FUNC(char_unban){
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- if(unbantype==4) // send answer to login server via char-server
|
|
|
- chrif_req_login_operation(sd->status.account_id, atcmd_player_name, 4, 0, 0, 0); // type: 4 - unban
|
|
|
+ if (unbantype == CHRIF_OP_LOGIN_UNBAN) // send answer to login server via char-server
|
|
|
+ chrif_req_login_operation(sd->status.account_id, atcmd_player_name, CHRIF_OP_LOGIN_UNBAN, 0, 0, 0); // type: 4 - unban
|
|
|
else //directly unban via char-serv
|
|
|
- chrif_req_charunban(sd->status.char_id);
|
|
|
- clif_displaymessage(fd, msg_txt(sd,88)); // Character name sent to char-server to ask it.
|
|
|
+ chrif_req_charunban(sd->status.account_id,atcmd_player_name);
|
|
|
+ sprintf(atcmd_output, msg_txt(sd,88), unbantype == CHRIF_OP_UNBAN ? "char":"login"); // Sending request to %s server...
|
|
|
+ clif_displaymessage(fd, atcmd_output);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -9395,7 +9400,7 @@ ACMD_FUNC(vip) {
|
|
|
clif_displaymessage(fd,atcmd_output);
|
|
|
}
|
|
|
}
|
|
|
- chrif_req_login_operation(pl_sd->status.account_id, pl_sd->status.name, 6, vipdifftime, 7, 0);
|
|
|
+ chrif_req_login_operation(pl_sd->status.account_id, pl_sd->status.name, CHRIF_OP_LOGIN_VIP, vipdifftime, 7, 0);
|
|
|
return 0;
|
|
|
}
|
|
|
|