summaryrefslogtreecommitdiff
path: root/src/char/pincode.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-09 17:44:22 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-15 11:47:30 +0300
commit13b0b431785e0fce57064b395de132c664d8fe7d (patch)
tree914f459fce65adcc63753261cc621025f1650fff /src/char/pincode.c
parentbf851b3d39371874cb7478d55f4c94a2d5107a8e (diff)
downloadhercules-13b0b431785e0fce57064b395de132c664d8fe7d.tar.gz
hercules-13b0b431785e0fce57064b395de132c664d8fe7d.tar.bz2
hercules-13b0b431785e0fce57064b395de132c664d8fe7d.tar.xz
hercules-13b0b431785e0fce57064b395de132c664d8fe7d.zip
Move global variable into interface in char.c
Other variables better move to future char_config.
Diffstat (limited to 'src/char/pincode.c')
-rw-r--r--src/char/pincode.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/char/pincode.c b/src/char/pincode.c
index 6034b5a0c..c8a76719f 100644
--- a/src/char/pincode.c
+++ b/src/char/pincode.c
@@ -24,7 +24,7 @@ unsigned int pincode_multiplier = 0x3498;
unsigned int pincode_baseSeed = 0x881234;
void pincode_handle ( int fd, struct char_session_data* sd ) {
- struct online_char_data* character = (struct online_char_data*)idb_get(online_char_db, sd->account_id);
+ struct online_char_data* character = (struct online_char_data*)idb_get(chr->online_char_db, sd->account_id);
if( character && character->pincode_enable > *pincode->charselect ){
character->pincode_enable = *pincode->charselect * 2;
@@ -53,7 +53,7 @@ void pincode_check(int fd, struct char_session_data* sd) {
pincode->decrypt(sd->pincode_seed, pin);
if( pincode->compare( fd, sd, pin ) ){
struct online_char_data* character;
- if( (character = (struct online_char_data*)idb_get(online_char_db, sd->account_id)) )
+ if( (character = (struct online_char_data*)idb_get(chr->online_char_db, sd->account_id)) )
character->pincode_enable = *pincode->charselect * 2;
pincode->sendstate( fd, sd, PINCODE_OK );
}
@@ -116,18 +116,18 @@ void pincode_sendstate(int fd, struct char_session_data* sd, uint16 state) {
}
void pincode_notifyLoginPinUpdate(int account_id, char* pin) {
- WFIFOHEAD(login_fd,11);
- WFIFOW(login_fd,0) = 0x2738;
- WFIFOL(login_fd,2) = account_id;
- strncpy( (char*)WFIFOP(login_fd,6), pin, 5 );
- WFIFOSET(login_fd,11);
+ WFIFOHEAD(chr->login_fd,11);
+ WFIFOW(chr->login_fd,0) = 0x2738;
+ WFIFOL(chr->login_fd,2) = account_id;
+ strncpy( (char*)WFIFOP(chr->login_fd,6), pin, 5 );
+ WFIFOSET(chr->login_fd,11);
}
void pincode_notifyLoginPinError(int account_id) {
- WFIFOHEAD(login_fd,6);
- WFIFOW(login_fd,0) = 0x2739;
- WFIFOL(login_fd,2) = account_id;
- WFIFOSET(login_fd,6);
+ WFIFOHEAD(chr->login_fd,6);
+ WFIFOW(chr->login_fd,0) = 0x2739;
+ WFIFOL(chr->login_fd,2) = account_id;
+ WFIFOSET(chr->login_fd,6);
}
void pincode_decrypt(unsigned int userSeed, char* pin) {