Fix small typo for Banking
-fix arraylenght for packet buffer causing bank_vault not to be refreshed correctly. -enforce sd check for mappacket -fix unused variables warnings
This commit is contained in:
parent
c83418a60a
commit
ea2954bf3f
@ -2185,13 +2185,13 @@ int loginif_parse_BankingAck(int fd){
|
|||||||
char not_fw = RFIFOB(fd,10);
|
char not_fw = RFIFOB(fd,10);
|
||||||
RFIFOSKIP(fd,11);
|
RFIFOSKIP(fd,11);
|
||||||
|
|
||||||
if(!not_fw) mapif_BankingAck(aid, bank_vault);
|
if(not_fw==0) mapif_BankingAck(aid, bank_vault);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//HZ 0x2b29 <aid>L <bank_vault>L
|
//HZ 0x2b29 <aid>L <bank_vault>L
|
||||||
int mapif_BankingAck(int32 account_id, int32 bank_vault){
|
int mapif_BankingAck(int32 account_id, int32 bank_vault){
|
||||||
unsigned char buf[14];
|
unsigned char buf[11];
|
||||||
WBUFW(buf,0) = 0x2b29;
|
WBUFW(buf,0) = 0x2b29;
|
||||||
WBUFL(buf,2) = account_id;
|
WBUFL(buf,2) = account_id;
|
||||||
WBUFL(buf,6) = bank_vault;
|
WBUFL(buf,6) = bank_vault;
|
||||||
|
@ -956,11 +956,13 @@ int parse_fromchar(int fd){
|
|||||||
if( !accounts->load_num(accounts, &acc, account_id) )
|
if( !accounts->load_num(accounts, &acc, account_id) )
|
||||||
ShowNotice("Char-server '%s': Error on banking (account: %d not found, ip: %s).\n", server[id].name, account_id, ip);
|
ShowNotice("Char-server '%s': Error on banking (account: %d not found, ip: %s).\n", server[id].name, account_id, ip);
|
||||||
else{
|
else{
|
||||||
unsigned char buf[11];
|
unsigned char buf[12];
|
||||||
if(type==2){ // upd and Save
|
if(type==2){ // upd and Save
|
||||||
acc.bank_vault = data;
|
acc.bank_vault = data;
|
||||||
accounts->save(accounts, &acc);
|
accounts->save(accounts, &acc);
|
||||||
WBUFB(buf,10) = 1;
|
WBUFB(buf,10) = 1;
|
||||||
|
} else {
|
||||||
|
WBUFB(buf,10) = 0;
|
||||||
}
|
}
|
||||||
// announce to other servers
|
// announce to other servers
|
||||||
WBUFW(buf,0) = 0x2741;
|
WBUFW(buf,0) = 0x2741;
|
||||||
|
@ -6140,7 +6140,10 @@ void clif_cart_additem_ack(struct map_session_data *sd, uint8 flag)
|
|||||||
|
|
||||||
// 09B7 <unknow data> (ZC_ACK_OPEN_BANKING)
|
// 09B7 <unknow data> (ZC_ACK_OPEN_BANKING)
|
||||||
void clif_bank_open(struct map_session_data *sd){
|
void clif_bank_open(struct map_session_data *sd){
|
||||||
int fd = sd->fd;
|
int fd;
|
||||||
|
|
||||||
|
nullpo_retv(sd);
|
||||||
|
fd = sd->fd;
|
||||||
|
|
||||||
WFIFOHEAD(fd,4);
|
WFIFOHEAD(fd,4);
|
||||||
WFIFOW(fd,0) = 0x09b7;
|
WFIFOW(fd,0) = 0x09b7;
|
||||||
@ -6155,6 +6158,7 @@ void clif_bank_open(struct map_session_data *sd){
|
|||||||
void clif_parse_BankOpen(int fd, struct map_session_data* sd) {
|
void clif_parse_BankOpen(int fd, struct map_session_data* sd) {
|
||||||
//TODO check if preventing trade or stuff like that
|
//TODO check if preventing trade or stuff like that
|
||||||
//also mark something in case char ain't available for saving, should we check now ?
|
//also mark something in case char ain't available for saving, should we check now ?
|
||||||
|
nullpo_retv(sd);
|
||||||
if( !battle_config.feature_banking ) {
|
if( !battle_config.feature_banking ) {
|
||||||
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,1496)); //Banking is disabled
|
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,1496)); //Banking is disabled
|
||||||
return;
|
return;
|
||||||
@ -6162,18 +6166,23 @@ void clif_parse_BankOpen(int fd, struct map_session_data* sd) {
|
|||||||
else {
|
else {
|
||||||
struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
|
struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
|
||||||
int aid = RFIFOL(fd,info->pos[0]); //unused should we check vs fd ?
|
int aid = RFIFOL(fd,info->pos[0]); //unused should we check vs fd ?
|
||||||
|
if(sd->status.account_id == aid){
|
||||||
sd->state.banking = 1;
|
sd->state.banking = 1;
|
||||||
}
|
|
||||||
//request save ?
|
//request save ?
|
||||||
// chrif_bankdata_request(sd->status.account_id, sd->status.char_id);
|
//chrif_bankdata_request(sd->status.account_id, sd->status.char_id);
|
||||||
//on succes open bank ?
|
//on succes open bank ?
|
||||||
clif_bank_open(sd);
|
clif_bank_open(sd);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 09B9 <unknow data> (ZC_ACK_CLOSE_BANKING)
|
// 09B9 <unknow data> (ZC_ACK_CLOSE_BANKING)
|
||||||
|
|
||||||
void clif_bank_close(struct map_session_data *sd){
|
void clif_bank_close(struct map_session_data *sd){
|
||||||
int fd = sd->fd;
|
int fd;
|
||||||
|
|
||||||
|
nullpo_retv(sd);
|
||||||
|
fd = sd->fd;
|
||||||
|
|
||||||
WFIFOHEAD(fd,4);
|
WFIFOHEAD(fd,4);
|
||||||
WFIFOW(fd,0) = 0x09B9;
|
WFIFOW(fd,0) = 0x09B9;
|
||||||
@ -6188,12 +6197,16 @@ void clif_bank_close(struct map_session_data *sd){
|
|||||||
void clif_parse_BankClose(int fd, struct map_session_data* sd) {
|
void clif_parse_BankClose(int fd, struct map_session_data* sd) {
|
||||||
struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
|
struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
|
||||||
int aid = RFIFOL(fd,info->pos[0]); //unused should we check vs fd ?
|
int aid = RFIFOL(fd,info->pos[0]); //unused should we check vs fd ?
|
||||||
|
|
||||||
|
nullpo_retv(sd);
|
||||||
if( !battle_config.feature_banking ) {
|
if( !battle_config.feature_banking ) {
|
||||||
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,1496)); //Banking is disabled
|
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,1496)); //Banking is disabled
|
||||||
//still allow to go trough to not stuck player if we have disable it while they was in
|
//still allow to go trough to not stuck player if we have disable it while they was in
|
||||||
}
|
}
|
||||||
|
if(sd->status.account_id == aid){
|
||||||
sd->state.banking = 0;
|
sd->state.banking = 0;
|
||||||
clif_bank_close(sd);
|
clif_bank_close(sd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -6269,6 +6282,7 @@ void clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK r
|
|||||||
* 09A7 <AID>L <Money>L (PACKET_CZ_REQ_BANKING_DEPOSIT)
|
* 09A7 <AID>L <Money>L (PACKET_CZ_REQ_BANKING_DEPOSIT)
|
||||||
*/
|
*/
|
||||||
void clif_parse_BankDeposit(int fd, struct map_session_data* sd) {
|
void clif_parse_BankDeposit(int fd, struct map_session_data* sd) {
|
||||||
|
nullpo_retv(sd);
|
||||||
if( !battle_config.feature_banking ) {
|
if( !battle_config.feature_banking ) {
|
||||||
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,1496)); //Banking is disabled
|
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,1496)); //Banking is disabled
|
||||||
return;
|
return;
|
||||||
@ -6316,6 +6330,7 @@ void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK
|
|||||||
* 09A9 <AID>L <Money>L (PACKET_CZ_REQ_BANKING_WITHDRAW)
|
* 09A9 <AID>L <Money>L (PACKET_CZ_REQ_BANKING_WITHDRAW)
|
||||||
*/
|
*/
|
||||||
void clif_parse_BankWithdraw(int fd, struct map_session_data* sd) {
|
void clif_parse_BankWithdraw(int fd, struct map_session_data* sd) {
|
||||||
|
nullpo_retv(sd);
|
||||||
if( !battle_config.feature_banking ) {
|
if( !battle_config.feature_banking ) {
|
||||||
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,1496)); //Banking is disabled
|
clif_colormes(sd,color_table[COLOR_RED],msg_txt(sd,1496)); //Banking is disabled
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user