Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Encodes this instance.
        /// </summary>
        internal void Encode(ByteWriter Packet)
        {
            for (int i = 0; i < this.MapRegions.Count; i++)
            {
                this.MapRegions[i].Encode(Packet);
            }

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


            Packet.AddInt(this.ExplorationRegionId);
            Packet.AddBoolean(this.ExplorationInProgress);
            Packet.AddInt(this.ExplorationCounter);

            Packet.AddInt(this.Frags);
            Packet.AddInt(this.Outposts);

            Packet.AddInt(this.MissionTile);
            Packet.AddInt(this.MissionIndex);

            Packet.AddInt(this.MissionCompletedAt);
            Packet.AddInt(this.MissionTotalLength);
            Packet.AddInt(this.MissionLeft);

            Packet.AddBoolean(this.DeepseaUpgrading);
        }
Ejemplo n.º 3
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.º 4
0
        internal void Encode(ByteWriter Packet)
        {
            this.Header.Encode(Packet);

            Packet.AddString(this.Description);
            Packet.AddInt(0);
            Packet.AddBoolean(false);
            Packet.AddInt(0);
            Packet.AddBoolean(false);

            this.Members.Encode(Packet);

            Packet.AddInt(0);
            Packet.AddInt(52);
        }
Ejemplo n.º 5
0
        internal void Encode(ByteWriter Packet)
        {
            Packet.AddInt(0);
            Packet.AddInt(this.Score);

            Packet.AddInt(this.Type);

            Packet.AddString(this.Name);

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

            Packet.AddInt(0);

            Packet.AddBoolean(false);

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

            Packet.AddString(this.Note);

            Packet.AddInt(0);
        }
Ejemplo n.º 6
0
        internal void Encode(ByteWriter Packet)
        {
            if (this.Explored)
            {
                Packet.AddBoolean(true);

                for (int i = 0; i < this.Nodes.Count; i++)
                {
                    this.Nodes[i].Encode(Packet);
                }
            }
            else
            {
                Packet.AddBoolean(false);
            }
        }
Ejemplo n.º 7
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.º 8
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);
        }
        /// <summary>
        /// Encodes this command.
        /// </summary>
        /// <param name="writer">The byte stream.</param>
        internal override void Encode(ByteWriter writer)
        {
            writer.AddInt(this.X);
            writer.AddInt(this.Y);
            writer.AddData(this.Data);
            writer.AddBoolean(this.Instant);

            writer.AddInt(0);

            base.Encode(writer);
        }
        /// <summary>
        /// Encodes this instance.
        /// </summary>
        internal override void Encode(ByteWriter Packet)
        {
            Packet.AddBoolean(this.AlliangeGift);

            Packet.AddInt(this.Count);
            Packet.AddData(this.BillingPackageData);
            Packet.AddData(this.GemBundleData);
            Packet.AddInt(this.AlliangeGift ? 1 : 0);

            Packet.AddString(null); // TransactionID

            base.Encode(Packet);
        }
Ejemplo n.º 11
0
        internal static void AddCompressableString(this ByteWriter Writer, string Value)
        {
            if (Value != null)
            {
                int length = Value.Length;

                if (length > 50)
                {
                    Writer.AddBoolean(true);
                    Writer.AddCompressedString(Value);
                }
                else
                {
                    Writer.AddBoolean(false);
                    Writer.AddString(Value);
                }
            }
            else
            {
                Writer.AddBoolean(false);
                Writer.AddInt(-1);
            }
        }
Ejemplo n.º 12
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.º 13
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.º 14
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);
        }