Example #1
0
        public void sampleFuncPost(SampleStruct ss)
        {
            AutoGenStructFor_sampleFuncPost msgData = new AutoGenStructFor_sampleFuncPost();

            msgData.ss = ss;
            PushSendData((ushort)EMsgType.sampleFuncPost, msgData);
            SendBytes();
        }
Example #2
0
        public void towParamReq(SampleStruct ss, List <byte> name)
        {
            AutoGenStructFor_towParamReq msgData = new AutoGenStructFor_towParamReq();

            msgData.ss = ss;
            msgData.name.AddRange(name);
            PushSendData((ushort)EMsgType.towParamReq, msgData);
            SendBytes();
        }
Example #3
0
 public void CreateInstance()
 {
     ss   = new SampleStruct();
     name = new List <byte>();
 }
Example #4
0
 public void CreateInstance()
 {
     ss = new SampleStruct();
 }
Example #5
0
        public uint Unserialize(byte[] buff, uint offset, uint buffLen)
        {
            CreateInstance();
            uint buffPos = offset;
            uint copyLen = 0;

            copyLen = 2;
            if (copyLen > buffLen - buffPos)
            {
                return(0);
            }
            byte[] tempBytes = new byte[8];
            SerializeUtil.LEMemcpy(tempBytes, 0, buff, buffPos, copyLen);
            uint listLen = (uint)BitConverter.ToUInt16(tempBytes, 0);

            buffPos += copyLen;

            if (listLen > 1000)
            {
                return(0);
            }
            if (listLen > 0)
            {
                for (int i = 0; i < listLen; ++i)
                {
                    SampleStruct item = new SampleStruct();
                    copyLen = item.Unserialize(buff, buffPos, buffLen - (buffPos - offset));
                    list.Add(item);
                    buffPos += copyLen;
                }
            }

            copyLen  = stru.Unserialize(buff, buffPos, buffLen - (buffPos - offset));
            buffPos += copyLen;

            copyLen = 2;
            if (copyLen > buffLen - buffPos)
            {
                return(0);
            }
            SerializeUtil.LEMemcpy(tempBytes, 0, buff, buffPos, copyLen);
            uint numListLen = (uint)BitConverter.ToUInt16(tempBytes, 0);

            buffPos += copyLen;

            if (numListLen > 1000)
            {
                return(0);
            }
            if (numListLen > 0)
            {
                copyLen = sizeof(int);
                if (numListLen * copyLen > buffLen - buffPos)
                {
                    return(0);
                }
                for (int i = 0; i < numListLen; ++i)
                {
                    SerializeUtil.LEMemcpy(tempBytes, 0, buff, buffPos, copyLen);
                    int item = BitConverter.ToInt32(tempBytes, 0);
                    numList.Add(item);
                    buffPos += copyLen;
                }
            }

            return(buffPos);
        }
Example #6
0
 public void CreateInstance()
 {
     list    = new List <SampleStruct>();
     stru    = new SampleStruct();
     numList = new List <int>();
 }
Example #7
0
 public virtual void sampleFuncPost(TcpSession session, SampleStruct ss)
 {
 }
Example #8
0
 public virtual void towParamReq(TcpSession session, SampleStruct ss, List <byte> name)
 {
 }