Exemplo n.º 1
0
        public override int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            cursor += base.ReadFrom(Buffer, cursor);

            NewsgroupID = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            Part = Buffer[cursor];
            cursor++;

            MaxPart = Buffer[cursor];
            cursor++;

            ushort len = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            Articles = new ArticleHead[len];
            for (int i = 0; i < len; i++)
            {
                Articles[i] = new ArticleHead(Buffer, cursor);
                cursor += Articles[i].ByteLength;
            }

            return cursor - StartIndex;
        }
Exemplo n.º 2
0
 public ArticlesMessage(ArticleHead[] Articles) 
     : base(MessageTypeGameMode.Articles)
 {
     this.Articles = Articles;
 }
Exemplo n.º 3
0
        public override unsafe void ReadFrom(ref byte* Buffer)
        {
            base.ReadFrom(ref Buffer);

            NewsgroupID = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            Part = Buffer[0];
            Buffer++;

            MaxPart = Buffer[0];
            Buffer++;

            ushort len = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            Articles = new ArticleHead[len];
            for (int i = 0; i < len; i++)
                Articles[i] = new ArticleHead(ref Buffer);
            
        }