int chlogif_parse_ackaccreq(int fd, struct char_session_data* sd){
if (RFIFOREST(fd) < 25)
return 0;
{
int account_id = RFIFOL(fd,2);
uint32 login_id1 = RFIFOL(fd,6);
uint32 login_id2 = RFIFOL(fd,10);
uint8 sex = RFIFOB(fd,14);
uint8 result = RFIFOB(fd,15);
int request_id = RFIFOL(fd,16);
uint32 version = RFIFOL(fd,20);
ShowInfo("Checking char_logif output, version=%d, result=%d\n",version,(char)result);
uint8 clienttype = RFIFOB(fd,24);
RFIFOSKIP(fd,25);
if( session_isActive(request_id) && (sd=(struct char_session_data*)session[request_id]->session_data) &&
!sd->auth && sd->account_id == account_id && sd->login_id1 == login_id1 && sd->login_id2 == login_id2 && sd->sex == sex )
{
int client_fd = request_id;
sd->version = version;
sd->clienttype = clienttype;
//ShowWarning("Checking char_logif output, version=%d",sd->version);
if(sd->version != date2version(PACKETVER))
ShowWarning("s aid=%d has an incorect version=%d in clientinfo. Server compiled for %d\n",
sd->account_id,sd->version,date2version(PACKETVER));
switch( result )
{
case 0:// ok
char_auth_ok(client_fd, sd);
break;
case 1:// auth failed
WFIFOHEAD(client_fd,3);
WFIFOW(client_fd,0) = 0x6c;
WFIFOB(client_fd,2) = 0;// rejected from server
WFIFOSET(client_fd,3);
break;
}
}
}
return 1;
}