Exemple #1
0
        public static void AddDonation(LogicArrayList <DonationContainer> arrayList, LogicLong avatarId, LogicCombatItemData data, int upgLevel)
        {
            Debugger.DoAssert(arrayList != null, "pDonations cannot be null");
            int index = -1;

            for (int i = 0; i < arrayList.Size(); i++)
            {
                if (LogicLong.Equals(arrayList[i].GetAvatarId(), avatarId))
                {
                    index = i;
                    break;
                }
            }

            if (index != -1)
            {
                arrayList[index].AddUnit(data, upgLevel);
            }
            else
            {
                DonationContainer donationContainer = new DonationContainer(avatarId.Clone());
                donationContainer.AddUnit(data, upgLevel);
                arrayList.Add(donationContainer);
            }
        }
Exemple #2
0
        public void Decode(ByteStream stream)
        {
            this.m_accountId = stream.ReadLong();
            this.m_avatarId  = stream.ReadLong();
            this.m_homeId    = stream.ReadLong();
            this.m_name      = stream.ReadString(900000);
            this.m_expLevel  = stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            this.m_index = stream.ReadInt();

            if (stream.ReadBoolean())
            {
                stream.ReadString(900000);
                stream.ReadInt();
                stream.ReadInt();
                stream.ReadInt();
                stream.ReadInt();
            }

            if (stream.ReadBoolean())
            {
                stream.ReadLong();
            }

            if (stream.ReadBoolean())
            {
                stream.ReadLong();
            }

            if (stream.ReadBoolean())
            {
                stream.ReadLong();
            }

            stream.ReadInt();
            stream.ReadInt();
            stream.ReadInt();
            stream.ReadString(900000);
            stream.ReadInt();

            int count = stream.ReadInt();

            if (count >= 0)
            {
                Debugger.DoAssert(count < 10000, "Too large amount of donations in AllianceWarMemberEntry");

                this.m_donations = new LogicArrayList <DonationContainer>();
                this.m_donations.EnsureCapacity(count);

                for (int i = stream.ReadInt(); i > 0; i--)
                {
                    DonationContainer donationContainer = new DonationContainer();
                    donationContainer.Decode(stream);
                    this.m_donations.Add(donationContainer);
                }
            }
        }