diff options
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 20 | ||||
-rw-r--r-- | src/char/inter.c | 17 |
2 files changed, 21 insertions, 16 deletions
diff --git a/src/char/char.c b/src/char/char.c index 863692492..0d96d40cb 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -4750,8 +4750,7 @@ int parse_char(int fd) // checks the entered pin case 0x8b8: - if( RFIFOREST(fd) < 10 ) - return 0; + FIFOSD_CHECK(10); if( RFIFOL(fd,2) == sd->account_id ) pincode->check( fd, sd ); @@ -4761,8 +4760,8 @@ int parse_char(int fd) // request for PIN window case 0x8c5: - if( RFIFOREST(fd) < 6 ) - return 0; + FIFOSD_CHECK(6); + if( RFIFOL(fd,2) == sd->account_id ) pincode->sendstate( fd, sd, PINCODE_NOTSET ); @@ -4771,8 +4770,8 @@ int parse_char(int fd) // pincode change request case 0x8be: - if( RFIFOREST(fd) < 14 ) - return 0; + FIFOSD_CHECK(14); + if( RFIFOL(fd,2) == sd->account_id ) pincode->change( fd, sd ); @@ -4781,8 +4780,8 @@ int parse_char(int fd) // activate PIN system and set first PIN case 0x8ba: - if( RFIFOREST(fd) < 10 ) - return 0; + FIFOSD_CHECK(10); + if( RFIFOL(fd,2) == sd->account_id ) pincode->setnew( fd, sd ); RFIFOSKIP(fd,10); @@ -4790,9 +4789,8 @@ int parse_char(int fd) /* 0x8d4 <from>.W <to>.W <unused>.W (2+2+2+2) */ case 0x8d4: - if( RFIFOREST(fd) < 8 ) - return 0; - else { + FIFOSD_CHECK(8); + { bool ret; ret = char_slotchange(sd, fd, RFIFOW(fd, 2), RFIFOW(fd, 4)); WFIFOHEAD(fd, 8); diff --git a/src/char/inter.c b/src/char/inter.c index a7794c9c9..e5a7d411c 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -694,7 +694,11 @@ void mapif_parse_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int acc void inter_savereg(int account_id, int char_id, const char *key, unsigned int index, intptr_t val, bool is_string) { /* to login server we go! */ if( key[0] == '#' && key[1] == '#' ) {/* global account reg */ - global_accreg_to_login_add(key,index,val,is_string); + if( session_isValid(login_fd) ) + global_accreg_to_login_add(key,index,val,is_string); + else { + ShowError("Login server unavailable, cant perform update on '%s' variable for AID:%d CID:%d\n",key,account_id,char_id); + } } else if ( key[0] == '#' ) {/* local account reg */ if( is_string ) { if( val ) { @@ -1301,8 +1305,10 @@ int mapif_parse_Registry(int fd) int cursor = 14, i; char key[32], sval[254]; unsigned int index; - - global_accreg_to_login_start(account_id,char_id); + bool isLoginActive = session_isActive(login_fd); + + if( isLoginActive ) + global_accreg_to_login_start(account_id,char_id); for(i = 0; i < count; i++) { safestrncpy(key, (char*)RFIFOP(fd, cursor + 1), RFIFOB(fd, cursor)); @@ -1336,8 +1342,9 @@ int mapif_parse_Registry(int fd) } } - - global_accreg_to_login_send(); + + if( isLoginActive ) + global_accreg_to_login_send(); } return 0; } |