Exemple #1
0
        /// <summary>
        /// Constructor by values
        /// </summary>
        /// <param name="GuildName"></param>
        /// <param name="PasswordSetFlag"></param>
        /// <param name="ChestPassword"></param>
        /// <param name="Flags"></param>
        /// <param name="GuildID"></param>
        /// <param name="Rank1Male"></param>
        /// <param name="Rank1Female"></param>
        /// <param name="Rank2Male"></param>
        /// <param name="Rank2Female"></param>
        /// <param name="Rank3Male"></param>
        /// <param name="Rank3Female"></param>
        /// <param name="Rank4Male"></param>
        /// <param name="Rank4Female"></param>
        /// <param name="Rank5Male"></param>
        /// <param name="Rank5Female"></param>
        /// <param name="SupportedMember"></param>
        /// <param name="GuildMembers"></param>
        public GuildInfo(string GuildName, byte PasswordSetFlag, string ChestPassword, GuildFlags Flags, ObjectID GuildID,
                         string Rank1Male, string Rank1Female, string Rank2Male, string Rank2Female, string Rank3Male, string Rank3Female,
                         string Rank4Male, string Rank4Female, string Rank5Male, string Rank5Female,
                         ObjectID SupportedMember, IEnumerable <GuildMemberEntry> GuildMembers)
        {
            guildName       = GuildName;
            passwordSetFlag = PasswordSetFlag;
            chestPassword   = ChestPassword;
            flags           = Flags;
            guildID         = GuildID;
            rank1Male       = Rank1Male;
            rank1Female     = Rank1Female;
            rank2Male       = Rank2Male;
            rank2Female     = Rank2Female;
            rank3Male       = Rank3Male;
            rank3Female     = Rank3Female;
            rank4Male       = Rank4Male;
            rank4Female     = Rank4Female;
            rank5Male       = Rank5Male;
            rank5Female     = Rank5Female;
            supportedMember = SupportedMember;

            guildMembers.AddRange(GuildMembers);
        }
Exemple #2
0
        public int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            ushort len = BitConverter.ToUInt16(Buffer, cursor);                 // NameLEN  (2 bytes)

            cursor += TypeSizes.SHORT;

            guildName = Encoding.Default.GetString(Buffer, cursor, len);        // Name     (n bytes)
            cursor   += len;

            passwordSetFlag = Buffer[cursor];                                   // PasswordSetFlag (1 byte)
            cursor++;

            if (passwordSetFlag == 0x01)
            {
                len     = BitConverter.ToUInt16(Buffer, cursor);                 // PasswordLEN  (2 bytes)
                cursor += TypeSizes.SHORT;

                chestPassword = Encoding.Default.GetString(Buffer, cursor, len); // Password     (n bytes)
                cursor       += len;
            }

            flags   = new GuildFlags(BitConverter.ToUInt32(Buffer, cursor));     // Flags (4 bytes)
            cursor += TypeSizes.INT;

            guildID = new ObjectID(Buffer, cursor);                             // ID       (4/8 bytes)
            cursor += guildID.ByteLength;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank1MaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank1Male = Encoding.Default.GetString(Buffer, cursor, len);        // Rank1Male    (n bytes)
            cursor   += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank1FemaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank1Female = Encoding.Default.GetString(Buffer, cursor, len);      // Rank1Female    (n bytes)
            cursor     += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank2MaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank2Male = Encoding.Default.GetString(Buffer, cursor, len);        // Rank2Male    (n bytes)
            cursor   += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank2FemaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank2Female = Encoding.Default.GetString(Buffer, cursor, len);      // Rank2Female    (n bytes)
            cursor     += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank3MaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank3Male = Encoding.Default.GetString(Buffer, cursor, len);        // Rank3Male    (n bytes)
            cursor   += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank3FemaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank3Female = Encoding.Default.GetString(Buffer, cursor, len);      // Rank3Female    (n bytes)
            cursor     += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank4MaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank4Male = Encoding.Default.GetString(Buffer, cursor, len);        // Rank4Male    (n bytes)
            cursor   += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank4FemaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank4Female = Encoding.Default.GetString(Buffer, cursor, len);      // Rank4Female    (n bytes)
            cursor     += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank5MaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank5Male = Encoding.Default.GetString(Buffer, cursor, len);        // Rank5Male    (n bytes)
            cursor   += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank5FemaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank5Female = Encoding.Default.GetString(Buffer, cursor, len);      // Rank5Female    (n bytes)
            cursor     += len;

            supportedMember = new ObjectID(Buffer, cursor);                     // SupportedMember(4/8 bytes)
            cursor         += supportedMember.ByteLength;

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

            guildMembers.Clear();
            guildMembers.Capacity = len;
            for (ushort i = 0; i < len; i++)
            {
                GuildMemberEntry obj = new GuildMemberEntry(Buffer, cursor);    // GuildMemberEntry (n bytes)
                guildMembers.Add(obj);
                cursor += obj.ByteLength;
            }

            return(ByteLength);
        }
Exemple #3
0
        public unsafe void ReadFrom(ref byte *Buffer)
        {
            ushort len = *((ushort *)Buffer);

            Buffer += TypeSizes.SHORT;

            guildName = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

            passwordSetFlag = Buffer[0];
            Buffer++;

            if (passwordSetFlag == 0x01)
            {
                len     = *((ushort *)Buffer);
                Buffer += TypeSizes.SHORT;

                chestPassword = new string((sbyte *)Buffer, 0, len);
                Buffer       += len;
            }

            flags   = new GuildFlags(*((uint *)Buffer));
            Buffer += TypeSizes.INT;

            guildID = new ObjectID(ref Buffer);

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

            rank1Male = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

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

            rank1Female = new string((sbyte *)Buffer, 0, len);
            Buffer     += len;

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

            rank2Male = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

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

            rank2Female = new string((sbyte *)Buffer, 0, len);
            Buffer     += len;

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

            rank3Male = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

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

            rank3Female = new string((sbyte *)Buffer, 0, len);
            Buffer     += len;

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

            rank4Male = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

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

            rank4Female = new string((sbyte *)Buffer, 0, len);
            Buffer     += len;

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

            rank5Male = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

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

            rank5Female = new string((sbyte *)Buffer, 0, len);
            Buffer     += len;

            supportedMember = new ObjectID(ref Buffer);

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

            guildMembers.Clear();
            guildMembers.Capacity = len;
            for (ushort i = 0; i < len; i++)
            {
                guildMembers.Add(new GuildMemberEntry(ref Buffer));
            }
        }
Exemple #4
0
        public int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            ushort len = BitConverter.ToUInt16(Buffer, cursor);                 // GuildsLEN  (2 bytes)

            cursor += TypeSizes.SHORT;

            guilds = new BaseList <GuildEntry>(len);
            for (ushort i = 0; i < len; i++)
            {
                GuildEntry obj = new GuildEntry(Buffer, cursor);                // GuildEntry (n bytes)
                guilds.Add(obj);
                cursor += obj.ByteLength;
            }

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // YouDeclAllyLEN  (2 bytes)
            cursor += TypeSizes.SHORT;

            youDeclaredAllyList = new ObjectIDList <ObjectID>(len);
            for (ushort i = 0; i < len; i++)
            {
                ObjectID obj = new ObjectID(Buffer, cursor);                    // ObjectID (4/8 bytes)
                youDeclaredAllyList.Add(obj);
                cursor += obj.ByteLength;
            }

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // YouDeclEnemyLEN  (2 bytes)
            cursor += TypeSizes.SHORT;

            youDeclaredEnemyList = new ObjectIDList <ObjectID>(len);
            for (ushort i = 0; i < len; i++)
            {
                ObjectID obj = new ObjectID(Buffer, cursor);                    // ObjectID (4/8 bytes)
                youDeclaredEnemyList.Add(obj);
                cursor += obj.ByteLength;
            }

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // DeclYouAllyLEN  (2 bytes)
            cursor += TypeSizes.SHORT;

            declaredYouAllyList = new ObjectIDList <ObjectID>(len);
            for (ushort i = 0; i < len; i++)
            {
                ObjectID obj = new ObjectID(Buffer, cursor);                    // ObjectID (4/8 bytes)
                declaredYouAllyList.Add(obj);
                cursor += obj.ByteLength;
            }

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // DeclYouEnemyLEN  (2 bytes)
            cursor += TypeSizes.SHORT;

            declaredYouEnemyList = new ObjectIDList <ObjectID>(len);
            for (ushort i = 0; i < len; i++)
            {
                ObjectID obj = new ObjectID(Buffer, cursor);                    // ObjectID (4/8 bytes)
                declaredYouEnemyList.Add(obj);
                cursor += obj.ByteLength;
            }

            return(ByteLength);
        }
 public UserCommandGuildVote(ObjectID ID)
 {
     this.ID = ID;
 }
Exemple #6
0
 public UserCommandGuildEndEnemy(ObjectID GuildID)
 {
     this.GuildID = GuildID;
 }
Exemple #7
0
 public UserCommandGuildAbdicate(ObjectID ID)
 {
     this.ID = ID;
 }
 public UserCommandGuildMakeAlliance(ObjectID GuildID)
 {
     this.GuildID = GuildID;
 }