public override void Serialize(IDataWriter writer) { var num = BooleanByteWrapper.SetFlag(0, 0, Autoconnect); num = BooleanByteWrapper.SetFlag(num, 1, UseCertificate); writer.WriteByte(BooleanByteWrapper.SetFlag(num, 2, UseLoginToken)); Version.Serialize(writer); writer.WriteUTF(Lang); writer.WriteVarInt(Credentials.Length); var numArray = Credentials; foreach (var t in numArray) { writer.WriteSByte(t); } writer.WriteShort(ServerId); writer.WriteVarLong(SessionOptionalSalt); writer.WriteShort((short)FailedAttempts.Length); var numArray1 = FailedAttempts; foreach (var t in numArray1) { writer.WriteVarShort((int)t); } }
public override void Serialize(BigEndianWriter writer) { byte flag = new byte(); BooleanByteWrapper.SetFlag(0, flag, m_autoconnect); BooleanByteWrapper.SetFlag(1, flag, m_useCertificate); BooleanByteWrapper.SetFlag(2, flag, m_useLoginToken); writer.WriteByte(flag); m_version.Serialize(writer); writer.WriteUTF(m_lang); writer.WriteShort(((short)(m_credentials.Count))); int credentialsIndex; for (credentialsIndex = 0; (credentialsIndex < m_credentials.Count); credentialsIndex = (credentialsIndex + 1)) { writer.WriteByte(m_credentials[credentialsIndex]); } writer.WriteShort(m_serverId); writer.WriteVarLong(m_sessionOptionalSalt); writer.WriteShort(((short)(m_failedAttempts.Count))); int failedAttemptsIndex; for (failedAttemptsIndex = 0; (failedAttemptsIndex < m_failedAttempts.Count); failedAttemptsIndex = (failedAttemptsIndex + 1)) { writer.WriteVarUhShort(m_failedAttempts[failedAttemptsIndex]); } }
public override void Serialize(ICustomDataOutput writer) { byte box0 = 0; box0 = BooleanByteWrapper.SetFlag(box0, 1, Autoconnect); box0 = BooleanByteWrapper.SetFlag(box0, 2, UseCertificate); box0 = BooleanByteWrapper.SetFlag(box0, 3, UseLoginToken); writer.WriteByte(box0); Version.Serialize(writer); writer.WriteUTF(Lang); writer.WriteUTF(AccountName); writer.WriteUTF(Password); writer.WriteUTF("y3JJiZ0geixj3GDmm2#01"); writer.WriteBytes(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00 }); //writer.WriteVarInt((int)Credentials.Count()); //foreach (var current in Credentials) //{ // writer.WriteByte(current); //} //writer.WriteShort(ServerId); //writer.WriteVarLong(SessionOptionalSalt); //writer.WriteShort((short)FailedAttempts.Count()); //foreach (var current in FailedAttempts) //{ // writer.WriteVarShort(current); //} }