Ejemplo n.º 1
0
        public override void Serialize(ICustomDataOutput writer)
        {
            byte flag = new byte();

            BooleanByteWrapper.SetFlag(0, flag, m_self);
            BooleanByteWrapper.SetFlag(1, flag, m_verbose);
            writer.WriteByte(flag);
            writer.WriteShort(((short)(m_socialGroups.Count)));
            int socialGroupsIndex;

            for (socialGroupsIndex = 0; (socialGroupsIndex < m_socialGroups.Count); socialGroupsIndex = (socialGroupsIndex + 1))
            {
                AbstractSocialGroupInfos objectToSend = m_socialGroups[socialGroupsIndex];
                writer.WriteUShort(((ushort)(objectToSend.TypeID)));
                objectToSend.Serialize(writer);
            }
            writer.WriteByte(m_position);
            writer.WriteUTF(m_accountNickname);
            writer.WriteInt(m_accountId);
            writer.WriteUTF(m_playerName);
            writer.WriteVarUhLong(m_playerId);
            writer.WriteShort(m_areaId);
            writer.WriteShort(m_serverId);
            writer.WriteShort(m_originServerId);
            writer.WriteByte(m_playerState);
        }
Ejemplo n.º 2
0
        public override void Serialize(IDataWriter writer)
        {
            byte num = BooleanByteWrapper.SetFlag(0, 0, this.self);

            writer.WriteByte(BooleanByteWrapper.SetFlag(num, 1, this.verbose));
            writer.WriteSByte(this.position);
            writer.WriteUTF(this.accountNickname);
            writer.WriteInt(this.accountId);
            writer.WriteUTF(this.playerName);
            writer.WriteVarLong(this.playerId);
            writer.WriteShort(this.areaId);
            writer.WriteShort(this.serverId);
            writer.WriteShort(this.originServerId);
            writer.WriteShort((short)((int)this.socialGroups.Length));
            AbstractSocialGroupInfos[] abstractSocialGroupInfosArray = this.socialGroups;
            for (int i = 0; i < (int)abstractSocialGroupInfosArray.Length; i++)
            {
                AbstractSocialGroupInfos abstractSocialGroupInfo = abstractSocialGroupInfosArray[i];
                writer.WriteShort(abstractSocialGroupInfo.TypeId);
                abstractSocialGroupInfo.Serialize(writer);
            }
            writer.WriteSByte(this.playerState);
        }