public static byte[] getAuthSuccess(MapleClient c) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.LOGIN_STATUS.getValue());
mplew.writeInt(0);
mplew.writeShort(0);
/*
* v99 = CInPacket::Decode4(a3); // ID
v98 = (unsigned __int8)CInPacket::Decode1(a3);// Gender
LOBYTE(v96) = CInPacket::Decode1(a3);// Admin
v47 = (unsigned __int16)CInPacket::Decode2(a3);//gm level
8248 is set to v96, 8260 is set to v47
v4 = (int)((char *)v1 + 8260);
if ( TSecType_unsigned_char_::GetData(v4) & 0x20 )
{
result = 2;
}
else
{
if ( TSecType_unsigned_char_::GetData(v4) & 0x40 )
result = 3;
else
result = (((unsigned __int8)TSecType_unsigned_char_::GetData(v4) ^ 0x80u) >> 7) | 4;
}
*/
mplew.writeInt(c.getAccID()); //user id
mplew.write(c.getGender());
mplew.write(0);
mplew.write(0);
mplew.write(0);
//mplew.writeBool(c.gmLevel() > 0); //admin byte
//final byte toWrite = (byte) (c.gmLevel() * 32);
//mplew.writeShort(toWrite > 0x80 ? 0x80 : 0);//0x40 = MWLB
mplew.write(0);
mplew.writeMapleAsciiString(c.getAccountName());
mplew.write(0x03);
mplew.write(0); //isquietbanned
mplew.writeLong(0);
mplew.write(1);//v107, probably special creation thing? :O
mplew.writeLong(getTime(c.getCreationTime()));//creation time
mplew.writeInt(10); // special creation thing lol
mplew.writeShort(0x101);//pin poop
mplew.writeLong(System.currentTimeMillis());
return mplew.getPacket();
}