コード例 #1
0
        public override int writeToBuff(ref NetOutputBuffer buff)
        {
            buff.WriteUint(ObjID);
            buff.WriteInt(HandleID);
            PosWorld.writeToBuff(ref buff);
            buff.WriteByte(m_yNumTargetPos);
            if (m_yNumTargetPos > 0 && m_yNumTargetPos <= GAMEDEFINE.MAX_CHAR_PATH_NODE_NUMBER)
            {
                for (int i = 0; i < m_yNumTargetPos; i++)
                {
                    m_aTargetPos[i].writeToBuff(ref buff);
                }
            }

            return(NET_DEFINE.PACKET_HEADER_SIZE + getSize());
        }
コード例 #2
0
        public override bool readFromBuff(ref NetInputBuffer buff)
        {
            buff.ReadUint(ref m_ObjID);
            buff.ReadInt(ref m_nHandleID);
            PosWorld.readFromBuff(ref buff);
            buff.ReadByte(ref m_yNumTargetPos);

            if (m_yNumTargetPos > 0 && m_yNumTargetPos <= GAMEDEFINE.MAX_CHAR_PATH_NODE_NUMBER)
            {
                for (int i = 0; i < m_yNumTargetPos; i++)
                {
                    m_aTargetPos[i].readFromBuff(ref buff);
                }
            }

            return(true);
        }