Exemple #1
0
        public override int WriteTo(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            Buffer[cursor] = (byte)CommandType;                 // Type (1 byte)
            cursor++;

            cursor += GuildInfo.WriteTo(Buffer, cursor);        // GuildInfo (n bytes)

            return(cursor - StartIndex);
        }
Exemple #2
0
        public override int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            if ((UserCommandType)Buffer[cursor] != CommandType)
            {
                throw new Exception(ERRORWRONGTYPEBYTE);
            }
            else
            {
                cursor++;                                       // Type     (1 byte)

                GuildInfo = new GuildInfo(Buffer, cursor);      // GuildInfo (n bytes)
                cursor   += GuildInfo.ByteLength;
            }

            return(cursor - StartIndex);
        }
Exemple #3
0
 public UserCommandGuildInfo(GuildInfo GuildInfo)
 {
     this.GuildInfo = GuildInfo;
 }