Код:
switch(inptype)
{
case 0x2E://InitCrypt
{
if(!in.readC())
QMessageBox::information(NULL, "L2M Alfa:Omg",
"Wrong protocol version can be troubles :'(");
for(int x=0;x<8;x+=1)
{
inxorkey[x]=in.readC();
outxorkey[x]=inxorkey[x];
}
xorkeyaccepted=true;
out.writeC(0x2b);
l2m_mstr a;
l2m_uch tmp[28];
for(int x=0;x<28;x+=1)
tmp[x]=0;
for(int x=0;x<14;x+=1)
tmp[x*2]=ulogin[x];
a.fromuch(tmp,28);
a.killzero();
out.writeS(&a,true);
out.writeC(0x00);
out.writeD(playOK[1]);
out.writeD(playOK[0]);
out.writeD(loginOK[0]);
out.writeD(loginOK[1]);
out.writeD(0);
out.writeD(0);
out.writeD(0);
sendpacket();
}
break;
}
Так у мну в клиенте а так на l2j серваке
Код:
public void writeImpl()
{
writeC(0x2e);
writeC(_id); //0 - wrong protocol, 1 - protocol ok
for (int i = 0; i < 8; i++)
{
writeC(_key[i]); // key
}
writeD(0x01);
writeD(0x01); // server id
writeC(0x01);
writeD(0x00); // obfuscation key
}