Exemple #1
0
        public bool encodeMessage(NetWriteBuffer DataOut)
        {
            int nInitPos = DataOut.getPostion();

            DataOut.PutUShort(0);
            DataOut.PutUShort((ushort)m_nMsgType);
            //DataOut.PutString(m_strError) ; //error string
            doEncode(DataOut);
            int nPos = DataOut.getPostion();

            DataOut.setPostion(nInitPos);
            DataOut.PutUShort((ushort)(nPos - nInitPos));
            DataOut.setPostion(nPos);

            if (DataOut.IsOverFlow())
            {
                DataOut.setPostion(nInitPos);
                return(false);
            }
            return(true);
        }