public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag != 8)
                {
                    if (tag == 18)
                    {
                        Data.Uuid value = new Data.Uuid();
                        int       size  = (int)reader.ReadRawVarint32();
                        value.Decode(reader.ReadMessage(size));
                        LastSelectedDeck = value;
                        continue;
                    }
                }
                else
                {
                    God = (int)reader.ReadRawVarint32();
                }
            }
        }
Exemple #2
0
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag == 8)
                {
                    Turn = (int)reader.ReadRawVarint32();
                    continue;
                }
                else if (tag == 16)
                {
                    PlayerIndex = (int)reader.ReadRawVarint32();
                    continue;
                }
                else if (tag == 24)
                {
                    RealActionPoints = (int)reader.ReadRawVarint32();
                    continue;
                }
                else if (tag == 32)
                {
                    MaxActionPoints = (int)reader.ReadRawVarint32();
                }
            }
        }
Exemple #3
0
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 8)
                {
                    if (tag == 8)
                    {
                        ValueBefore = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
                else
                {
                    if (tag == 16)
                    {
                        Modification = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag == 24)
                    {
                        ValueAfter = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
            }
        }
Exemple #4
0
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 26)
                {
                    if (tag == 10)
                    {
                        Data.Uuid value = new Data.Uuid();
                        int       size  = (int)reader.ReadRawVarint32();
                        value.Decode(reader.ReadMessage(size));
                        LastSelectedDeckId = value;
                        continue;
                    }
                    if (tag == 26)
                    {
                        Data.Uuid value = new Data.Uuid();
                        int       size  = (int)reader.ReadRawVarint32();
                        value.Decode(reader.ReadMessage(size));
                        LastDungeonDeckId = value;
                        continue;
                    }
                }
                else if (tag != 32)
                {
                    if (tag == 42)
                    {
                        Data.CustomByGod value = new Data.CustomByGod();
                        int size = (int)reader.ReadRawVarint32();
                        value.Decode(reader.ReadMessage(size));
                        CustomByGodList.Add(value);
                        continue;
                    }
                    if (tag == 50)
                    {
                        Data.SelectedDeckByGod value = new Data.SelectedDeckByGod();
                        int size = (int)reader.ReadRawVarint32();
                        value.Decode(reader.ReadMessage(size));
                        SelectedDecksByGodId.Add(value);
                        continue;
                    }
                }
                else
                {
                    LastGameType1 = (Enums.GameType)Enum.Parse(typeof(Enums.GameType), reader.ReadRawVarint32().ToString());
                    continue;
                }
            }
        }
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 16)
                {
                    if (tag != 8)
                    {
                        if (tag == 16)
                        {
                            WinnerPlayer = (int)reader.ReadRawVarint32();
                            continue;
                        }
                    }
                    else
                    {
                        Result = (Enums.Result)Enum.Parse(typeof(Enums.Result), reader.ReadRawVarint32().ToString());
                        continue;
                    }
                }
                else
                {
                    if (tag == 24)
                    {
                        LoserPlayer = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag != 32)
                    {
                        switch (tag)
                        {
                        case 40:
                        case 42:
                            ResultHandlerType.Add((Enums.ResultHandlerType)Enum.Parse(typeof(Enums.ResultHandlerType), reader.ReadRawVarint32().ToString()));
                            continue;
                        }
                    }
                    else
                    {
                        Reason = (Enums.Reason)Enum.Parse(typeof(Enums.Reason), reader.ReadRawVarint32().ToString());
                        continue;
                    }
                }
            }
        }
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 16)
                {
                    if (tag == 8)
                    {
                        Xp = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag == 16)
                    {
                        Level = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
                else if (tag <= 32)
                {
                    if (tag == 24)
                    {
                        FloorXpForLevel = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag == 32)
                    {
                        CeilXpForLevel = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
                else
                {
                    if (tag == 40)
                    {
                        Rank = (long)reader.ReadRawVarint64();
                        continue;
                    }
                    if (tag == 48)
                    {
                        BestLevel = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
            }
        }
Exemple #7
0
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag == 10)
                {
                    Data.GameEvent gameEvent = new Data.GameEvent();
                    int            size      = (int)reader.ReadRawVarint32();
                    gameEvent.Decode(reader.ReadMessage(size));
                    EventsList.Add(gameEvent);
                    continue;
                }
            }
        }
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag != 9)
                {
                    if (tag == 17)
                    {
                        LowBits1 = reader.ReadRawLittleEndian64();
                    }
                }
                else
                {
                    HighBits = reader.ReadRawLittleEndian64();
                }
            }
        }
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 8)
                {
                    if (tag == 8)
                    {
                        LocType = (Enums.LocationType)Enum.Parse(typeof(Enums.LocationType), reader.ReadRawVarint32().ToString());
                        continue;
                    }
                }
                else
                {
                    if (tag == 18)
                    {
                        Data.CellCoord cellCoord = new Data.CellCoord();
                        int            size      = (int)reader.ReadRawVarint32();
                        cellCoord.Decode(reader.ReadMessage(size));
                        Cell = cellCoord;
                        continue;
                    }
                    if (tag == 24)
                    {
                        RowIndex = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag == 32)
                    {
                        ColumnIndex = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
            }
        }
Exemple #10
0
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 8)
                {
                    if (tag == 8)
                    {
                        Index = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
                else
                {
                    if (tag == 18)
                    {
                        Data.PlayerProfile playerProfile = new Data.PlayerProfile();
                        int size = (int)reader.ReadRawVarint32();
                        playerProfile.Decode(reader.ReadMessage(size));
                        Profile = playerProfile;
                        continue;
                    }
                    if (tag == 24)
                    {
                        GodId = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag == 34)
                    {
                        BoardName = reader.ReadString();
                        continue;
                    }
                }
            }
        }
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag != 8)
                {
                    if (tag == 16)
                    {
                        Y = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
                else
                {
                    X = (int)reader.ReadRawVarint32();
                }
            }
        }
Exemple #12
0
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 88)
                {
                    if (tag <= 40)
                    {
                        if (tag <= 18)
                        {
                            if (tag != 8)
                            {
                                if (tag == 18)
                                {
                                    Data.GameEvent gameEvent = new Data.GameEvent();
                                    int            size      = (int)reader.ReadRawVarint32();
                                    gameEvent.Decode(reader.ReadMessage(size));
                                    TriggeredEvents.Add(gameEvent);
                                    continue;
                                }
                            }
                            else
                            {
                                EventType = (Enums.EventType)Enum.Parse(typeof(Enums.EventType), reader.ReadRawVarint32().ToString());
                                continue;
                            }
                        }
                        else
                        {
                            if (tag == 24)
                            {
                                RelatedCardInstance = (int)reader.ReadRawVarint32();
                                continue;
                            }
                            if (tag == 32)
                            {
                                RelatedTradingCardId = (int)reader.ReadRawVarint32();
                                continue;
                            }
                            if (tag == 40)
                            {
                                Triggerer = (int)reader.ReadRawVarint32();
                                continue;
                            }
                        }
                    }
                    else if (tag <= 64)
                    {
                        if (tag == 48)
                        {
                            Int1 = (int)reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 56)
                        {
                            Int2 = (int)reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 64)
                        {
                            Int3 = (int)reader.ReadRawVarint32();
                            continue;
                        }
                    }
                    else
                    {
                        if (tag == 72)
                        {
                            Int4 = (int)reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 80)
                        {
                            Int5 = (int)reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 88)
                        {
                            Bool1 = reader.ReadBool();
                            continue;
                        }
                    }
                }
                else if (tag <= 138)
                {
                    if (tag <= 114)
                    {
                        if (tag == 96)
                        {
                            Bool2 = reader.ReadBool();
                            continue;
                        }
                        if (tag == 104)
                        {
                            UInt1 = reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 114)
                        {
                            Data.Location location = new Data.Location();
                            int           size     = (int)reader.ReadRawVarint32();
                            location.Decode(reader.ReadMessage(size));
                            Location1 = location;
                            continue;
                        }
                    }
                    else
                    {
                        if (tag == 122)
                        {
                            Data.Location location = new Data.Location();
                            int           size     = (int)reader.ReadRawVarint32();
                            location.Decode(reader.ReadMessage(size));
                            Location2 = location;
                            continue;
                        }
                        if (tag == 130)
                        {
                            Data.ValueModification valueModification = new Data.ValueModification();
                            int size = (int)reader.ReadRawVarint32();
                            valueModification.Decode(reader.ReadMessage(size));
                            ValueModification1 = valueModification;
                            continue;
                        }
                        if (tag == 138)
                        {
                            Data.ValueModification valueModification = new Data.ValueModification();
                            int size = (int)reader.ReadRawVarint32();
                            valueModification.Decode(reader.ReadMessage(size));
                            ValueModification2 = valueModification;
                            continue;
                        }
                    }
                }
                else if (tag <= 160)
                {
                    if (tag == 146)
                    {
                        Data.CellCoord cellCoord = new Data.CellCoord();
                        int            size      = (int)reader.ReadRawVarint32();
                        cellCoord.Decode(reader.ReadMessage(size));
                        CellCoord1 = cellCoord;
                        continue;
                    }
                    if (tag == 154)
                    {
                        Data.CellCoord cellCoord = new Data.CellCoord();
                        int            size      = (int)reader.ReadRawVarint32();
                        cellCoord.Decode(reader.ReadMessage(size));
                        CellCoord2 = cellCoord;
                        continue;
                    }
                    if (tag == 160)
                    {
                        MovementType = (Enums.MovementType)Enum.Parse(typeof(Enums.MovementType), reader.ReadRawVarint32().ToString());
                        continue;
                    }
                }
                else
                {
                    if (tag == 168)
                    {
                        SInt1 = reader.DecodeZigZag32(reader.ReadRawVarint32());
                        continue;
                    }
                    if (tag == 178)
                    {
                        String1 = reader.ReadString();
                        continue;
                    }
                    if (tag == 184)
                    {
                        TriggerableCapacityType1 = (Enums.TriggerableCapacityType)Enum.Parse(typeof(Enums.TriggerableCapacityType), reader.ReadRawVarint32().ToString());
                        continue;
                    }
                }
            }
        }
Exemple #13
0
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 48)
                {
                    if (tag <= 18)
                    {
                        if (tag == 10)
                        {
                            Data.Player player = new Data.Player();
                            int         size   = (int)reader.ReadRawVarint32();
                            player.Decode(reader.ReadMessage(size));
                            PlayersList.Add(player);
                            continue;
                        }
                        if (tag == 18)
                        {
                            BackgroundName = reader.ReadString();
                            continue;
                        }
                    }
                    else
                    {
                        if (tag == 24)
                        {
                            BoardColumnsCount = (int)reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 32)
                        {
                            BoardRowsCount = (int)reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 48)
                        {
                            MyIndex = (int)reader.ReadRawVarint32();
                            continue;
                        }
                    }
                }
                else if (tag <= 72)
                {
                    if (tag == 56)
                    {
                        MyCardsCount = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag == 64)
                    {
                        OpponentCardsCount = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag == 72)
                    {
                        GameType = (Enums.GameType)Enum.Parse(typeof(Enums.GameType), reader.ReadRawVarint32().ToString());
                        continue;
                    }
                }
                else
                {
                    if (tag == 80)
                    {
                        DofusBaseLife = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag == 88)
                    {
                        DraftAllInOwnAmount = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag == 96)
                    {
                        DraftAllInOpponentAmount = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
            }
        }
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 16)
                {
                    if (tag == 10)
                    {
                        Data.Uuid value = new Data.Uuid();
                        int       size  = (int)reader.ReadRawVarint32();
                        value.Decode(reader.ReadMessage(size));
                        Uuid1 = value;
                        continue;
                    }
                    if (tag == 16)
                    {
                        GodId = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
                else if (tag <= 34)
                {
                    if (tag == 26)
                    {
                        Name = reader.ReadString();
                        continue;
                    }
                    switch (tag)
                    {
                    case 32:
                    case 34:
                        int  size        = (int)reader.ReadRawVarint32();
                        long sizeInBytes = reader.B.BaseStream.Position + size;
                        while (reader.B.BaseStream.Position < sizeInBytes)
                        {
                            CardsWithQty1List.Add(reader.ReadRawVarint32());
                        }
                        continue;
                    }
                }
                else
                {
                    switch (tag)
                    {
                    case 40:
                    case 42:
                        int  size        = (int)reader.ReadRawVarint32();
                        long sizeInBytes = reader.B.BaseStream.Position + size;
                        while (reader.B.BaseStream.Position < sizeInBytes)
                        {
                            CardsWithQty2List.Add(reader.ReadRawVarint32());
                        }
                        continue;

                    case 41:
                        break;

                    default:
                        switch (tag)
                        {
                        case 48:
                        case 50:
                            int  size2        = (int)reader.ReadRawVarint32();
                            long sizeInBytes2 = reader.B.BaseStream.Position + size2;
                            while (reader.B.BaseStream.Position < sizeInBytes2)
                            {
                                CardsWithQty3List.Add(reader.ReadRawVarint32());
                            }
                            continue;
                        }
                        break;
                    }
                }
            }
        }
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 58)
                {
                    if (tag <= 24)
                    {
                        if (tag == 10)
                        {
                            Nickname = reader.ReadString();
                            continue;
                        }
                        if (tag == 18)
                        {
                            Data.PlayerRankInfo playerRankInfo = new Data.PlayerRankInfo();
                            int size = (int)reader.ReadRawVarint32();
                            playerRankInfo.Decode(reader.ReadMessage(size));
                            SeasonRank = playerRankInfo;
                            continue;
                        }
                        if (tag == 24)
                        {
                            TutorialStep = (int)reader.ReadRawVarint32();
                            continue;
                        }
                    }
                    else if (tag <= 40)
                    {
                        if (tag == 32)
                        {
                            Kamas = (int)reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 40)
                        {
                            SelectedCardBack = reader.ReadRawVarint32();
                            continue;
                        }
                    }
                    else
                    {
                        switch (tag)
                        {
                        case 48:
                        case 50:
                            int  size        = (int)reader.ReadRawVarint32();
                            long sizeInBytes = reader.B.BaseStream.Position + size;
                            while (reader.B.BaseStream.Position < sizeInBytes)
                            {
                                GodDecksUnlockedList.Add((int)reader.ReadRawVarint32());
                            }
                            continue;

                        case 49:
                            break;

                        default:
                            if (tag == 58)
                            {
                                Data.ClientPreferences value = new Data.ClientPreferences();
                                int size2 = (int)reader.ReadRawVarint32();
                                value.Decode(reader.ReadMessage(size2));
                                ClientPrefs = value;
                                continue;
                            }
                            break;
                        }
                    }
                }
                else if (tag <= 88)
                {
                    if (tag <= 72)
                    {
                        if (tag == 64)
                        {
                            Fragments = (int)reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 72)
                        {
                            WheelToken = (int)reader.ReadRawVarint32();
                            continue;
                        }
                    }
                    else
                    {
                        switch (tag)
                        {
                        case 80:
                        case 82:
                            int  size        = (int)reader.ReadRawVarint32();
                            long sizeInBytes = reader.B.BaseStream.Position + size;
                            while (reader.B.BaseStream.Position < sizeInBytes)
                            {
                                TutorialBlocksList.Add((int)reader.ReadRawVarint32());
                            }
                            continue;

                        case 81:
                            break;

                        default:
                            if (tag == 88)
                            {
                                Admin = reader.ReadBool();
                                continue;
                            }
                            break;
                        }
                    }
                }
                else if (tag <= 106)
                {
                    if (tag == 98)
                    {
                        Data.DeckInfo value = new Data.DeckInfo();
                        int           size  = (int)reader.ReadRawVarint32();
                        value.Decode(reader.ReadMessage(size));
                        DecksList.Add(value);
                        continue;
                    }
                    if (tag == 106)
                    {
                        AccountType = reader.ReadString();
                        continue;
                    }
                }
                else
                {
                    switch (tag)
                    {
                    case 112:
                    case 114:
                        int  size        = (int)reader.ReadRawVarint32();
                        long sizeInBytes = reader.B.BaseStream.Position + size;
                        while (reader.B.BaseStream.Position < sizeInBytes)
                        {
                            SeasonsToRewardList.Add((int)reader.ReadRawVarint32());
                        }
                        continue;

                    case 113:
                        break;

                    default:
                        if (tag == 120)
                        {
                            Hash = (int)reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 128)
                        {
                            FirstDraft = reader.ReadBool();
                            continue;
                        }
                        break;
                    }
                }
            }
        }
        public void Decode(byte[] array)
        {
            reader = new KrosmagaReader();
            reader.SetData(array);
            int tag;

            while (reader.B.BaseStream.Position < reader.B.BaseStream.Length && (tag = reader.ReadTag()) != 0)
            {
                if (tag <= 24)
                {
                    if (tag <= 10)
                    {
                        if (tag == 10)
                        {
                            Nickname = reader.ReadString();
                            continue;
                        }
                    }
                    else
                    {
                        if (tag == 16)
                        {
                            Level = (int)reader.ReadRawVarint32();
                            continue;
                        }
                        if (tag == 24)
                        {
                            CardBack = (int)reader.ReadRawVarint32();
                            continue;
                        }
                    }
                }
                else if (tag <= 40)
                {
                    if (tag == 32)
                    {
                        VictoryCount = (int)reader.ReadRawVarint32();
                        continue;
                    }
                    if (tag == 40)
                    {
                        DefeatCount = (int)reader.ReadRawVarint32();
                        continue;
                    }
                }
                else
                {
                    if (tag == 48)
                    {
                        Ranking = (long)reader.ReadRawVarint64();
                        continue;
                    }
                    if (tag == 58)
                    {
                        Data.CustomisationSlot customSlot = new Data.CustomisationSlot();
                        int size = (int)reader.ReadRawVarint32();
                        customSlot.Decode(reader.ReadMessage(size));
                        CustomList.Add(customSlot);
                        continue;
                    }
                }
            }
        }