Ejemplo n.º 1
0
        internal virtual void Encode(ByteWriter Packet)
        {
            Packet.AddLong(this.HighId, this.LowId);

            Packet.AddBoolean(this.SenderLowId > 0);
            Packet.AddBoolean(this.SenderLowId > 0); // Home
            Packet.AddBoolean(false);                // ?

            if (this.SenderLowId > 0)
            {
                Packet.AddLong(this.SenderHighId, this.SenderLowId);
            }

            if (this.SenderLowId > 0)
            {
                Packet.AddLong(this.SenderHighId, this.SenderLowId); // Home
            }

            Packet.AddString(this.SenderName);

            Packet.AddInt(this.SenderLevel);
            Packet.AddInt(this.SenderLeague);
            Packet.AddInt((int)this.SenderRole);

            Packet.AddInt(this.Age);
        }
Ejemplo n.º 2
0
        internal void Encode(ByteWriter Packet)
        {
            Packet.AddLong(this.HighID, this.LowID);

            Packet.AddString(this.Name);

            Packet.AddInt((int)this.Role);
            Packet.AddInt(this.ExpLevel);
            Packet.AddInt(this.League);
            Packet.AddInt(this.Score);
            Packet.AddInt(this.DuelScore);
            Packet.AddInt(this.TroopSended);
            Packet.AddInt(this.TroopReceived);
            Packet.AddInt(6);
            Packet.AddInt(0);
            Packet.AddInt(42);
            Packet.AddInt(0);
            Packet.AddInt(957071);
            Packet.AddInt(0);
            Packet.AddInt(1);

            Packet.AddBoolean(true);
            {
                Packet.AddLong(this.HighID, this.LowID);
            }
        }
Ejemplo n.º 3
0
        internal void Encode(ByteWriter Packet)
        {
            Packet.AddLong(this.Alliance.HighID, this.Alliance.LowID);

            Packet.AddString(this.Name);

            Packet.AddInt(this.Badge);
            Packet.AddInt((int)this.Type);
            Packet.AddInt(this.NumberOfMembers);
            Packet.AddInt(this.Score);
            Packet.AddInt(this.DuelScore);
            Packet.AddInt(this.RequiredScore);

            Packet.AddInt(this.WonWarCount);
            Packet.AddInt(this.LostWarCount);
            Packet.AddInt(this.EqualWarCount);

            Packet.AddInt(this.Locale);
            Packet.AddInt(this.ConsecutiveWarWinsCount);
            Packet.AddInt(this.Origin);

            Packet.AddInt(this.ExpPoints);
            Packet.AddInt(this.ExpLevel);
            Packet.AddInt(this.ConsecutiveWarWinsCount);
            Packet.AddBoolean(this.PublicWarLog);
            Packet.AddInt(0);
            Packet.AddBoolean(this.AmicalWar);
        }
        /// <summary>
        /// Encodes this instance.
        /// </summary>
        internal override void Encode(ByteWriter Packet)
        {
            Packet.AddLong(this.AllianceID);
            Packet.AddInt(this.AllianceBadge);

            base.Encode(Packet);
        }
Ejemplo n.º 5
0
        internal override void Encode(ByteWriter Packet)
        {
            base.Encode(Packet);

            Packet.AddInt((int)this.Event);
            Packet.AddLong(this.ExecuterHighId, this.ExecuterLowId);
            Packet.AddString(this.ExecuterName);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Encodes this instance.
        /// </summary>
        /// <param name="Packet">The byte stream.</param>
        internal void Encode(ByteWriter Packet)
        {
            Packet.AddLong(this.HighID, this.LowID);

            Packet.AddString(this.HomeBaseLevel);
            Packet.AddString(this.LevelAuthorName);

            Packet.AddCompressableString(this.Save().ToString(Formatting.None));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Encodes this instance.
        /// </summary>
        internal override void Encode(ByteWriter Packet)
        {
            Packet.AddLong(this.AllianceID);
            Packet.AddString(this.AllianceName);
            Packet.AddInt(this.AllianceBadge);
            Packet.AddBoolean(this.CreateAlliance);
            Packet.AddInt(this.AllianceLevel);

            base.Encode(Packet);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Encodes this instance.
        /// </summary>
        internal void Encode(ByteWriter Packet)
        {
            Packet.AddLong(this.HighID, this.LowID);

            Packet.AddString(this.Name);
            Packet.AddString(this.Facebook.Identifier);

            Packet.AddInt(0); // lastPlayedLevel
            Packet.AddInt(this.Diamonds);
            Packet.AddInt(this.FreeDiamonds);
            Packet.AddBoolean(this.NameSetByUser);
            Packet.AddInt(this.Score);

            this.Resources.Encode(Packet);

            Packet.AddInt(this.AchievementsClaimed.Count);
            this.AchievementsClaimed.ForEach(Packet.AddData);

            this.AchievementProgresses.Encode(Packet);

            Packet.AddInt(0); // LevelScores (List<DataSlots>)
            Packet.AddInt(0); // LevelAreas (List<DataSlots>)
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Encodes this instance.
        /// </summary>
        internal void Encode(ByteWriter Packet)
        {
            Packet.AddLong(this.HighID, this.LowID);
            Packet.AddLong(this.HighID, this.LowID);

            if (this.InAlliance)
            {
                Packet.AddBoolean(true);

                Packet.AddLong(this.AllianceHighID, this.AllianceLowID);

                Packet.AddString(this.Alliance.Header.Name);

                Packet.AddInt(this.Alliance.Header.Badge);
                Packet.AddInt((int)this.AllianceMember.Role);
                Packet.AddInt(this.Alliance.Header.ExpLevel);
            }
            else
            {
                Packet.AddBoolean(false);
            }

            if (this.LeagueID > 0)
            {
                Packet.AddBoolean(true);
                Packet.AddLong(this.LeagueHighID, this.LeagueLowID);
            }
            else
            {
                Packet.AddBoolean(false);
            }

            Packet.AddInt(0);
            Packet.AddInt(0);

            {
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
            }
            {
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
                Packet.AddInt(0);
            }

            Packet.AddInt(0);
            Packet.AddInt(0);
            Packet.AddInt(0);

            Packet.AddInt(this.League);

            Packet.AddInt(this.CastleLevel);
            Packet.AddInt(this.CastleTotalCapacity);
            Packet.AddInt(this.CastleUsedCapacity);
            Packet.AddInt(this.CastleTotalSpellCapacity);
            Packet.AddInt(this.CastleUsedSpellCapacity);
            Packet.AddInt(this.TownHallLevel);
            Packet.AddInt(this.TownHallLevel2);

            Packet.AddString(this.Name);
            Packet.AddString(this.Facebook.Identifier);

            Packet.AddInt(this.ExpLevel);
            Packet.AddInt(this.ExpPoints);

            Packet.AddInt(this.Diamonds);
            Packet.AddInt(this.FreeDiamonds);

            Packet.AddInt(60);
            Packet.AddInt(1200);

            Packet.AddInt(this.Score);
            Packet.AddInt(0);
            Packet.AddInt(0);
            Packet.AddInt(0);
            Packet.AddInt(0);
            Packet.AddInt(0);
            Packet.AddInt(0);
            Packet.AddInt(0);
            Packet.AddInt(0);
            Packet.AddInt(0);

            if (true)
            {
                Packet.AddBoolean(true);

                Packet.AddInt(220);
                Packet.AddInt(1828055880);
            }
            else
            {
                Packet.AddBoolean(false);
            }

            Packet.AddBoolean(this.NameSetByUser);
            Packet.AddBoolean(false);

            Packet.AddInt(this.ChangeNameCount);
            Packet.AddInt(6900);
            Packet.AddInt(0);
            Packet.AddInt(this.ClanWarPreference);
            Packet.AddInt(0);
            Packet.AddInt(0);

            if (false)
            {
                Packet.AddBoolean(true);

                Packet.AddInt(0);
                Packet.AddLong(0);
            }
            else
            {
                Packet.AddBoolean(false);
            }

            this.ResourceCaps.Encode(Packet);
            this.Resources.Encode(Packet);
            this.Units.Encode(Packet);
            this.Spells.Encode(Packet);

            this.UnitUpgrades.Encode(Packet);
            this.SpellUpgrades.Encode(Packet);

            Packet.AddInt(0); // Hero Upgrades
            Packet.AddInt(0); // Hero Health
            Packet.AddInt(0); // Hero State

            this.AllianceUnits.Encode(Packet);

            Packet.AddInt(this.Missions.Count);
            this.Missions.ForEach(Packet.AddData);

            Packet.AddInt(this.Achievements.Count);
            this.Achievements.ForEach(Packet.AddData);

            this.AchievementProgress.Encode(Packet);

            this.NpcMapProgress.Encode(Packet);
            this.NpcLootedGold.Encode(Packet);
            this.NpcLootedElixir.Encode(Packet);

            this.Variables.Encode(Packet);

            Packet.AddInt(0); // Hero Modes
            Packet.AddInt(0); // UnitPreset1
            Packet.AddInt(0); // UnitPreset2
            Packet.AddInt(0); // UnitPreset3
            Packet.AddInt(0); // PreviousArmySize
            Packet.AddInt(0); // UnitCounterForEvent
            Packet.AddInt(0); // Units Village2
            Packet.AddInt(0); // Units Village2 new
            Packet.AddInt(0); // DataSlots
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Encodes this instance.
 /// </summary>
 internal void Encode(ByteWriter Packet)
 {
     Packet.AddLong(this.HighID, this.LowID);
     Packet.AddString(this.HomeJSON.ToString(Formatting.None));
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Encodes this instance.
        /// </summary>
        /// <param name="Packet">The byte stream.</param>
        internal void Encode(ByteWriter Packet)
        {
            Packet.AddLong(this.HighID, this.LowID); // AccountID
            Packet.AddLong(this.HighID, this.LowID); // ID

            if (this.AllianceID > 0)
            {
                Packet.AddBoolean(true);

                Packet.AddLong(this.AllianceHighID, this.AllianceLowID);

                Packet.AddString("TID_ALLIANCE_NAME");
                Packet.AddInt(0); // Badge
                Packet.AddInt(0); // Role
            }
            else
            {
                Packet.AddBoolean(false);
            }

            Packet.AddInt(this.TownHallLevel);

            Packet.AddString(this.Name);
            Packet.AddString(this.Facebook.Identifier);

            Packet.AddInt(this.ExpLevel);
            Packet.AddInt(this.ExpPoints);
            Packet.AddInt(this.Diamonds);
            Packet.AddInt(this.Diamonds);
            Packet.AddInt(this.GainIntel);
            Packet.AddInt(this.AttackKFactor);
            Packet.AddInt(this.Score);
            Packet.AddBoolean(this.NameSetByUser);
            Packet.AddInt(this.CumulativePurchasedDiamonds);
            Packet.AddInt(this.NumberOnePosCounter);

            this.ResourceCaps.Encode(Packet);
            this.Resources.Encode(Packet);
            this.ResourcesConvertedToSupplies.Encode(Packet);
            this.Units.Encode(Packet);
            this.UnitUpgrades.Encode(Packet);
            this.SpellUpgrades.Encode(Packet);
            this.HeroUpgrades.Encode(Packet);
            this.NpcSeens.Encode(Packet);
            this.TrapUpgrades.Encode(Packet);
            this.BuildingLevels.Encode(Packet);
            this.ArtifactBonuses.Encode(Packet);
            this.LandingBoatLevels.Encode(Packet);

            Packet.AddInt(0); // Unknown DataSlots

            Packet.AddInt(this.MissionCompleted.Count);

            for (int i = 0; i < this.MissionCompleted.Count; i++)
            {
                Packet.AddInt(this.MissionCompleted[i]);
            }

            Packet.AddInt(this.AchievementClaimed.Count);

            for (int i = 0; i < this.AchievementClaimed.Count; i++)
            {
                Packet.AddInt(this.AchievementClaimed[i]);
            }

            this.AchievementProgresses.Encode(Packet);
            this.BottleChainProgresses.Encode(Packet);
            this.SubscriptionExpirationTimes.Encode(Packet);
            this.HeroStatus.Encode(Packet);
            this.HeroSelectedAbilities.Encode(Packet);
            this.HeroSeens.Encode(Packet);
            this.HeroAbilitySeens.Encode(Packet);
            this.SectorLevels.Encode(Packet);
            this.SectorBoostLevels.Encode(Packet);
            this.SectorBonuses.Encode(Packet);
            this.SectorBonusFilter.Encode(Packet);

            Packet.AddInt(0); // Unknown DataSlots

            this.PlayerMap.Encode(Packet);
        }