summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-03-14 20:15:07 -0300
committershennetsind <ind@henn.et>2013-03-14 20:15:07 -0300
commit84e8f1872f0f00d6f82d6fe85974bb1f37247c53 (patch)
tree758980ea103f740ea98f2527a48869737f5f4f30 /src/char/char.c
parent54b5ec95ca29216dcdac7e913f8a0c959a6c14a4 (diff)
downloadhercules-84e8f1872f0f00d6f82d6fe85974bb1f37247c53.tar.gz
hercules-84e8f1872f0f00d6f82d6fe85974bb1f37247c53.tar.bz2
hercules-84e8f1872f0f00d6f82d6fe85974bb1f37247c53.tar.xz
hercules-84e8f1872f0f00d6f82d6fe85974bb1f37247c53.zip
Fixed Pin Code Feature
Now cross-platform, and stable ( after fixing I tested it a couple dozen times ). Special Thanks to Yommy for providing me with his packet list, without it I would have never figured what was wrong with it. Special Thanks to Jeroen who reported a inconsistency on the feature when used on windows. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 4223fdded..3436860d0 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -173,15 +173,6 @@ static DBMap* auth_db; // int account_id -> struct auth_node*
// Online User Database
//-----------------------------------------------------
-struct online_char_data {
- int account_id;
- int char_id;
- int fd;
- int waiting_disconnect;
- short server; // -2: unknown server, -1: not connected, 0+: id of server
-};
-
-static DBMap* online_char_db; // int account_id -> struct online_char_data*
static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, intptr_t data);
int delete_char_sql(int char_id);
@@ -4176,9 +4167,11 @@ int parse_char(int fd)
if( RFIFOREST(fd) < 10 )
return 0;
- if( RFIFOL(fd,2) == sd->account_id )
- pincode->check( fd, sd );
-
+ if( !sd->pincode_pass ) {
+ if( RFIFOL(fd,2) == sd->account_id )
+ pincode->check( fd, sd );
+ }
+
RFIFOSKIP(fd,10);
break;
@@ -4186,7 +4179,6 @@ int parse_char(int fd)
case 0x8c5:
if( RFIFOREST(fd) < 6 )
return 0;
-
if( RFIFOL(fd,2) == sd->account_id )
pincode->state( fd, sd, PINCODE_NOTSET );
@@ -4197,9 +4189,10 @@ int parse_char(int fd)
case 0x8be:
if( RFIFOREST(fd) < 14 )
return 0;
-
- if( RFIFOL(fd,2) == sd->account_id )
- pincode->change( fd, sd );
+ if( !sd->pincode_pass ) {
+ if( RFIFOL(fd,2) == sd->account_id )
+ pincode->change( fd, sd );
+ }
RFIFOSKIP(fd,14);
break;
@@ -4208,10 +4201,10 @@ int parse_char(int fd)
case 0x8ba:
if( RFIFOREST(fd) < 10 )
return 0;
-
- if( RFIFOL(fd,2) == sd->account_id )
- pincode->new( fd, sd );
-
+ if( !sd->pincode_pass ) {
+ if( RFIFOL(fd,2) == sd->account_id )
+ pincode->new( fd, sd );
+ }
RFIFOSKIP(fd,10);
break;