summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/char/char.c b/src/char/char.c
index ae0c8593e..76dad5203 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -2345,7 +2345,7 @@ int parse_fromlogin(int fd)
{
WFIFOHEAD(i,3);
WFIFOW(i,0) = 0x81;
- WFIFOB(i,2) = 2;
+ WFIFOB(i,2) = 2; // "Someone has already logged in with this id"
WFIFOSET(i,3);
break;
}
@@ -3257,12 +3257,18 @@ int parse_char(int fd)
{
// request to connect
+ // 0065 <account id>.L <login id1>.L <login id2>.L <???>.W <sex>.B
case 0x65:
if (RFIFOREST(fd) < 17)
return 0;
{
+ int account_id = RFIFOL(fd,2);
+ int login_id1 = RFIFOL(fd,6);
+ int login_id2 = RFIFOL(fd,10);
+ int sex = RFIFOB(fd,16);
+
int GM_value;
- ShowInfo("request connect - account_id:%d/login_id1:%d/login_id2:%d\n", RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10));
+ ShowInfo("request connect - account_id:%d/login_id1:%d/login_id2:%d\n", account_id, login_id1, login_id2);
if (sd) {
//Received again auth packet for already authentified account?? Discard it.
@@ -3271,24 +3277,24 @@ int parse_char(int fd)
RFIFOSKIP(fd,17);
break;
}
- if ((GM_value = isGM(RFIFOL(fd,2))))
- ShowInfo("Account Logged On; Account ID: %d (GM level %d).\n", RFIFOL(fd,2), GM_value);
+ if( (GM_value = isGM(account_id)) != 0 )
+ ShowInfo("Account Logged On; Account ID: %d (GM level %d).\n", account_id, GM_value);
else
- ShowInfo("Account Logged On; Account ID: %d.\n", RFIFOL(fd,2));
+ ShowInfo("Account Logged On; Account ID: %d.\n", account_id);
CREATE(session[fd]->session_data, struct char_session_data, 1);
sd = (struct char_session_data*)session[fd]->session_data;
strncpy(sd->email, "no mail", 40); // put here a mail without '@' to refuse deletion if we don't receive the e-mail
sd->connect_until_time = 0; // unknown or unlimited (not displaying on map-server)
- sd->account_id = RFIFOL(fd,2);
- sd->login_id1 = RFIFOL(fd,6);
- sd->login_id2 = RFIFOL(fd,10);
- sd->sex = RFIFOB(fd,16);
+ sd->account_id = account_id;
+ sd->login_id1 = login_id1;
+ sd->login_id2 = login_id2;
+ sd->sex = sex;
sd->auth = false; // not authed yet
// send back account_id
WFIFOHEAD(fd,4);
- WFIFOL(fd,0) = RFIFOL(fd,2);
+ WFIFOL(fd,0) = account_id;
WFIFOSET(fd,4);
// search authentification