Beispiel #1
0
            protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
            {
                bool ret = true;

                try
                {
                    if (m_valInfos != null)
                    {
                        encoder.Encode1(m_version);
                        encoder.Encode1((byte)m_valInfos.Count);

                        foreach (KeyValuePair<byte, ServerInfo> kvp in m_valInfos)
                        {
                            encoder.Encode1(kvp.Value.m_id);
                            encoder.EncodeString(kvp.Value.m_ip);
                            encoder.Encode2(kvp.Value.m_port);
                        }
                    }

                    encoder.Encode1(0);
                    encoder.Encode1(0);
                }
                catch (Exception)
                {
                    ret = false;
                }

                return ret;
            }
Beispiel #2
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                encoder.Encode4(ItemCode);
                encoder.EncodeString(Name);
                encoder.EncodeString(Descriptions);
                encoder.EncodeString(Icon);
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #3
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                ItemCode        = decoder.Decode4();
                Name            = decoder.DecodeString();
                Descriptions    = decoder.DecodeString();
                Icon            = decoder.DecodeString();
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #4
0
        public override bool DoDecoding(ISmartStream issStream)
        {
            bool ret = true;

            ResultCode          = issStream.Decode4();
            m_isAlreadyLogined  = issStream.Decode1();

            if (ResultCode == 0 && m_isAlreadyLogined == 0)
            {
                m_user = new User();

                SimpleStream stream = new SimpleStream();
                stream.SetBuffer(issStream.DecodeBuffer(), true);
                ret = m_user.DeSerialize(stream);
            }

            if (ret)    ret = issStream.CheckSignature();
            return ret;
        }    
Beispiel #5
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                encoder.Encode4(VfxID);
                encoder.EncodeString(Resource);
                encoder.EncodeString(Pivot);
                encoder.Encode4(OffsetX);
                encoder.Encode4(OffsetY);
                encoder.Encode4(OffsetZ);
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #6
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                m_userSN            = decoder.Decode4();
                m_sessionId         = decoder.Decode8();
                m_typeCode          = (UserType)decoder.Decode1();
                m_userID            = decoder.DecodeString();
                m_nickname          = decoder.DecodeString();
                //m_isSync            = decoder.Decode1() > 0 ? true : false;
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #7
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                VfxID       = decoder.Decode4();
                Resource    = decoder.DecodeString();
                Pivot       = decoder.DecodeString();
                OffsetX     = decoder.Decode4AsSingle();
                OffsetY     = decoder.Decode4AsSingle();
                OffsetZ     = decoder.Decode4AsSingle();
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #8
0
        public override bool DoDecoding(ISmartStream issStream)
        {
            bool ret = true;

            m_resultCode = issStream.Decode4();

            if (m_resultCode == 0)
            {
                m_configVer = issStream.Decode1();

                if (m_configVer == 0)
                {
                    SimpleStream stream = new SimpleStream();
                    m_config = new ValConfig();

                    stream.SetBuffer(issStream.DecodeBuffer(), true);
                    ret = m_config.DeSerialize(stream);
                }
            }

            if (ret)    ret = issStream.CheckSignature();
            return ret;
        }
Beispiel #9
0
            protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
            {
                bool ret = true;

                try
                {
                    m_valInfos = new Dictionary<byte, ServerInfo>();

                    m_version = decoder.Decode1();
                    byte size = decoder.Decode1();

                    for (byte i = 0; i < size; ++i)
                    {
                        ServerInfo si = new ServerInfo();

                        si.m_id     = decoder.Decode1();
                        si.m_ip     = decoder.DecodeString();
                        si.m_port   = decoder.Decode2();

                        m_valInfos.Add(si.m_id, si);
                    }

                    if (decoder.Decode1() > 0)
                    {
                    }

                    if (decoder.Decode1() > 0)
                    {
                    }
                }
                catch (Exception)
                {
                    ret = false;
                }

                return ret;
            }
Beispiel #10
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                ret = base.OnSerialize(encoder, stream);
                if (ret)
                {
                    encoder.Encode1((byte)EquipmentType);
                    encoder.Encode1((byte)EquipmentRarityId);
                    encoder.Encode4(HeroItemCode);
                    encoder.Encode4(BattlePower);
                    encoder.Encode4(PriceSelling);
                    encoder.Encode4(ItemChanceAmplifier);
                    encoder.EncodeString(AtlasResource);
                    encoder.EncodeString(TextureName);

                    encoder.Encode1((byte)m_stats.Count);
                    foreach (var pr in m_stats)
                    {
                        encoder.Encode4(pr.Key);
                        encoder.Encode4(pr.Value);
                    }
                }
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #11
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                ushort size = 0;

                m_missions.Clear();
                m_boosters.Clear();
                m_equipments.Clear();
                m_heroes.Clear();
                m_treasureBoxes.Clear();
                m_items.Clear();
                m_goods.Clear();

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Mission m = new Mission();
                    if (!m.DeSerialize(stream)) throw new Exception();
                    m_missions.Add(m.MissionCode, m);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Item o = null;
                    ItemType itemType = (ItemType)decoder.Decode1();

                    switch (itemType)
                    {
                        case ItemType.Booster:          o = new Booster();          break;
                        case ItemType.Equipment:        o = new Equipment();        break;
                        case ItemType.Hero:             o = new Hero();             break;
                        case ItemType.TreasureBox:      o = new TreasureBox();      break;
                        default:                        o = new Item(itemType);     break;
                    }

                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_items.Add(o.ItemCode, o);

                    switch (itemType)
                    {
                        case ItemType.Booster:          m_boosters.Add(o.ItemCode, (Booster)o);             break;
                        case ItemType.Equipment:        m_equipments.Add(o.ItemCode, (Equipment)o);         break;
                        case ItemType.Hero:             m_heroes.Add(o.ItemCode, (Hero)o);                  break;
                        case ItemType.TreasureBox:      m_treasureBoxes.Add(o.ItemCode, (TreasureBox)o);    break;
                    }
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Goods t = new Goods();
                    if (!t.DeSerialize(stream)) throw new Exception();
                    m_goods.Add(t.GoodsCode, t);
                }
            }
            catch (Exception)
            {
                m_missions.Clear();
                m_boosters.Clear();
                m_equipments.Clear();
                m_heroes.Clear();
                m_treasureBoxes.Clear();
                m_items.Clear();
                m_goods.Clear();
                m_hash = 0;

                ret = false;
            }

            return ret;
        }
Beispiel #12
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                encoder.Encode2((ushort)m_missions.Count);
                foreach (var kvp in m_missions)
                {
                    if (!kvp.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_items.Count);
                foreach (var kvp in m_items)
                {
                    encoder.Encode1((byte)kvp.Value.Type);
                    if (!kvp.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_goods.Count);
                foreach (var kvp in m_goods)
                {
                    if (!kvp.Value.Serialize(stream)) throw new Exception();
                }
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #13
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;
            m_itemGoods.Clear();
            m_goodsLimitMission.Clear();

            try
            {
                GoodsCode     = decoder.Decode4();
                GoodsTypeCode = decoder.Decode1();
                GoodsName     = decoder.DecodeString();
                Descriptions  = decoder.DecodeString();
                CurrencyType  = (CurrencyType)decoder.Decode1();
                Price         = decoder.Decode4AsSingle();
                ContentsID1   = decoder.DecodeString();
                ContentsID2   = decoder.DecodeString();
                ContentsID3   = decoder.DecodeString();
                ContentsID4   = decoder.DecodeString();
                ContentsID5   = decoder.DecodeString();
                SortNum       = decoder.Decode2();

                ushort size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    ItemGoods itemGoods = new ItemGoods();
                    if (!itemGoods.DeSerialize(stream))
                        throw new Exception();

                    m_itemGoods.Add(itemGoods.ItemCode, itemGoods);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    GoodsLimitMission mission = new GoodsLimitMission();
                    if (mission.DeSerialize(stream))
                        throw new Exception();

                    m_goodsLimitMission.Add(mission.MissionCode, mission);
                }
            }
            catch (Exception)
            {
                m_itemGoods.Clear();
                m_goodsLimitMission.Clear();

                ret = false;
            }

            return ret;
        }
Beispiel #14
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                encoder.Encode4(GoodsCode);
                encoder.Encode1(GoodsTypeCode);
                encoder.EncodeString(GoodsName);
                encoder.EncodeString(Descriptions);
                encoder.Encode1((byte)CurrencyType);
                encoder.Encode4(Price);
                encoder.EncodeString(ContentsID1);
                encoder.EncodeString(ContentsID2);
                encoder.EncodeString(ContentsID3);
                encoder.EncodeString(ContentsID4);
                encoder.EncodeString(ContentsID5);
                encoder.Encode2(SortNum);

                encoder.Encode2((ushort)m_itemGoods.Count);
                foreach (var kvp in m_itemGoods)
                {
                    if (!kvp.Value.Serialize(stream))   throw new Exception();
                }

                encoder.Encode2((ushort)m_goodsLimitMission.Count);
                foreach (var kvp in m_goodsLimitMission)
                {
                    if (!kvp.Value.Serialize(stream))   throw new Exception();
                }
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #15
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                encoder.Encode1(BlockID);
                encoder.Encode1((byte)(IsApplyLifeRate ? 1 : 0));
                encoder.Encode4(ChanceSpawnTutorial);
                encoder.Encode4(ChanceSpawnAdventure);
                encoder.Encode4(ChanceSpawnRaid);
                encoder.Encode4(ChanceSpawnArena);
                encoder.EncodeString(Resource);
                encoder.Encode4(ChargeStartVfxID);
                encoder.Encode4(ChargeStartSfxID);
                encoder.Encode4(TransformVfxID);
                encoder.Encode4(DestroyVfxID);
                encoder.Encode4(Destroy1SfxID);
                encoder.Encode4(Destroy2SfxID);
                encoder.Encode4(Destroy3SfxID);
                encoder.Encode4(ChargedDestroyVfxID);
                encoder.Encode4(ChargedDestroySfxID);
                
                encoder.Encode1((byte)BlockCommands.Count);
                foreach (var pr in BlockCommands)
                {
                    encoder.Encode1(pr.Key);
                    encoder.Encode1(pr.Value.Priority);
                    encoder.EncodeString(pr.Value.ActionPattern);
                    encoder.Encode4(pr.Value.ExtraEffectValue);
                    encoder.Encode4(pr.Value.CriticalStatusEffectCode);
                    encoder.EncodeString(pr.Value.Motion);
                }
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #16
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                ret = base.OnDeSerialize(decoder, stream);
                if (ret)
                {
                    HeroItemCode = decoder.Decode4();
                }
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #17
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;
            m_heroLevelDetails.Clear();
            m_heroSkills.Clear();

            try
            {
                ret = base.OnDeSerialize(decoder, stream);
                if (ret)
                {
                    Grade                   = (HeroGrade)decoder.Decode1();
                    DefaultArmorItemCode    = decoder.Decode4();
                    DefaultWeaponItemCode   = decoder.Decode4();
                    GoodsCodeForGold        = decoder.Decode4();
                    GoodsCodeForGem         = decoder.Decode4();
                    HeroFieldObjectCode     = decoder.Decode4();

                    byte cnt = decoder.Decode1();
                    for (byte i = 0; i < cnt; ++i)
                    {
                        byte heroLevel  = decoder.Decode1();
                        HeroLevelDetail hld = new HeroLevelDetail();

                        hld.BattlePower     = decoder.Decode4();
                        hld.ExpNeeded       = decoder.Decode4();
                        hld.RewardItemCode  = decoder.Decode4();

                        Dictionary<uint, float> dic = new Dictionary<uint,float>();
                        byte cnt2 = decoder.Decode1();
                        for (byte j = 0; j < cnt2; ++j)
                        {
                            uint statCode   = decoder.Decode4();
                            float statValue = decoder.Decode4AsSingle();

                            dic.Add(statCode, statValue);
                        }

                        hld.Stats = dic;
                        m_heroLevelDetails.Add(heroLevel, hld);
                    }

                    cnt = decoder.Decode1();
                    for (byte i = 0; i < cnt; ++i)
                    {
                        uint skillCode = decoder.Decode4();
                        HeroSkill hs = new HeroSkill();

                        hs.ActivatingLevel  = decoder.Decode1();
                        hs.IsPuzzleActive   = decoder.Decode1() > 0;
                        hs.IsChallengerUse  = decoder.Decode1() > 0;
                        hs.IsVisible        = decoder.Decode1() > 0;

                        m_heroSkills.Add(skillCode, hs);
                    }
                }
            }
            catch (Exception)
            {
                m_heroLevelDetails.Clear();
                m_heroSkills.Clear();

                ret = false;
            }

            return ret;
        }
Beispiel #18
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;
            m_heroLevelSkillValues.Clear();

            try
            {
                SkillCode         = decoder.Decode4();
                SkillName         = decoder.DecodeString();
                IsActive          = decoder.Decode1() > 0;
                ManaConsume       = decoder.Decode4();
                CastTime          = decoder.Decode4();
                CoolTime          = decoder.Decode4();
                GlobalCoolTime    = decoder.Decode4();
                Priority          = decoder.Decode1();
                Motion            = decoder.DecodeString();
                Icon              = decoder.DecodeString();

                byte cnt = decoder.Decode1();
                for (byte i = 0; i < cnt; ++i)
                {
                    SkillValue s = new SkillValue();

                    byte heroLevel      = decoder.Decode1();
                    s.Descriptions      = decoder.DecodeString();
                    s.ActionPattern     = decoder.DecodeString();
                    s.EffectValue       = decoder.Decode4AsSingle();

                    m_heroLevelSkillValues.Add(heroLevel, s);
                }
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #19
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                encoder.Encode4(SkillCode);
                encoder.EncodeString(SkillName);
                encoder.Encode1((byte)(IsActive ? 1 : 0));
                encoder.Encode4(ManaConsume);
                encoder.Encode4(CastTime);
                encoder.Encode4(CoolTime);
                encoder.Encode4(GlobalCoolTime);
                encoder.Encode1(m_priority);
                encoder.EncodeString(m_motion);
                encoder.EncodeString(m_icon);
                
                encoder.Encode1((byte)m_heroLevelSkillValues.Count);
                foreach (var pr in m_heroLevelSkillValues)
                {
                    encoder.Encode1(pr.Key);
                    encoder.EncodeString(pr.Value.Descriptions);
                    encoder.EncodeString(pr.Value.ActionPattern);
                    encoder.Encode4(pr.Value.EffectValue);
                }
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #20
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;
            m_blockCmds.Clear();

            try
            {
                BlockID                 = decoder.Decode1();
                IsApplyLifeRate         = decoder.Decode1() > 0;
                ChanceSpawnTutorial     = decoder.Decode4AsSingle();
                ChanceSpawnAdventure    = decoder.Decode4AsSingle();
                ChanceSpawnRaid         = decoder.Decode4AsSingle();
                ChanceSpawnArena        = decoder.Decode4AsSingle();
                Resource                = decoder.DecodeString();
                ChargeStartVfxID        = decoder.Decode4();
                ChargeStartSfxID        = decoder.Decode4();
                TransformVfxID          = decoder.Decode4();
                DestroyVfxID            = decoder.Decode4();
                Destroy1SfxID           = decoder.Decode4();
                Destroy2SfxID           = decoder.Decode4();
                Destroy3SfxID           = decoder.Decode4();
                ChargedDestroyVfxID     = decoder.Decode4();
                ChargedDestroySfxID     = decoder.Decode4();

                byte cnt = decoder.Decode1();
                for (byte i = 0; i < cnt; ++i)
                {
                    BlockCommand b = new BlockCommand();

                    byte blockCnt               = decoder.Decode1();
                    b.Priority                  = decoder.Decode1();
                    b.ActionPattern             = decoder.DecodeString();
                    b.ExtraEffectValue          = decoder.Decode4AsSingle();
                    b.CriticalStatusEffectCode  = decoder.Decode4();
                    b.Motion                    = decoder.DecodeString();

                    m_blockCmds.Add(blockCnt, b);
                }
            }
            catch (Exception)
            {
                m_blockCmds.Clear();
                ret = false;
            }

            return ret;
        }
Beispiel #21
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;
            m_stats.Clear();

            try
            {
                ret = base.OnDeSerialize(decoder, stream);
                if (ret)
                {
                    EquipmentType           = (EquipmentType)decoder.Decode1();
                    EquipmentRarityId       = (EquipmentRarityId)decoder.Decode1();
                    HeroItemCode            = decoder.Decode4();
                    BattlePower             = decoder.Decode4();
                    PriceSelling            = decoder.Decode4();
                    ItemChanceAmplifier     = decoder.Decode4AsSingle();
                    AtlasResource           = decoder.DecodeString();
                    TextureName             = decoder.DecodeString();

                    byte cnt = decoder.Decode1();
                    for (byte i = 0; i < cnt; ++i)
                    {
                        uint statCode   = decoder.Decode4();
                        float statValue = decoder.Decode4AsSingle();

                        m_stats.Add(statCode, statValue);
                    }
                }
            }
            catch (Exception)
            {
                m_stats.Clear();
                ret = false;
            }

            return ret;
        }
Beispiel #22
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                encoder.Encode2((ushort)m_vfxs.Count);
                foreach (var pr in m_vfxs)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_sfxs.Count);
                foreach (var pr in m_sfxs)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_statusEffects.Count);
                foreach (var pr in m_statusEffects)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_blocks.Count);
                foreach (var pr in m_blocks)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_skills.Count);
                foreach (var pr in m_skills)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_gameModes.Count);
                foreach (var pr in m_gameModes)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_projectiles.Count);
                foreach (var pr in m_projectiles)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_heroObjects.Count);
                foreach (var pr in m_heroObjects)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_monsters.Count);
                foreach (var pr in m_monsters)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_noticeObjects.Count);
                foreach (var pr in m_noticeObjects)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_warpGates.Count);
                foreach (var pr in m_warpGates)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_buffers.Count);
                foreach (var pr in m_buffers)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_debuffers.Count);
                foreach (var pr in m_debuffers)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_lockObstacles.Count);
                foreach (var pr in m_lockObstacles)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_slotMachines.Count);
                foreach (var pr in m_slotMachines)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_challengers.Count);
                foreach (var pr in m_challengers)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_stages.Count);
                foreach (var pr in m_stages)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_consumableTypes.Count);
                foreach (var pr in m_consumableTypes)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_consumables.Count);
                foreach (var pr in m_consumables)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_screenPositions.Count);
                foreach (var pr in m_screenPositions)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_bufferActions.Count);
                foreach (var pr in m_bufferActions)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }

                encoder.Encode2((ushort)m_slotMachineReels.Count);
                foreach (var pr in m_slotMachineReels)
                {
                    if (!pr.Value.Serialize(stream)) throw new Exception();
                }
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #23
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                m_reelID        = decoder.Decode1();
                m_betAmplify    = decoder.Decode4AsSingle();
                m_chanceSpin    = decoder.Decode4AsSingle();
                m_resource      = decoder.DecodeString();
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #24
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                MissionCode   = decoder.Decode1();
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #25
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                ret = base.OnSerialize(encoder, stream);
                if (ret)
                {
                    encoder.Encode1((byte)Grade);
                    encoder.Encode4(DefaultArmorItemCode);
                    encoder.Encode4(DefaultWeaponItemCode);
                    encoder.Encode4(GoodsCodeForGold);
                    encoder.Encode4(GoodsCodeForGem);
                    encoder.Encode4(HeroFieldObjectCode);

                    encoder.Encode1((byte)m_heroLevelDetails.Count);
                    foreach (var pr in m_heroLevelDetails)
                    {
                        encoder.Encode1(pr.Key);
                        encoder.Encode4(pr.Value.BattlePower);
                        encoder.Encode4(pr.Value.ExpNeeded);
                        encoder.Encode4(pr.Value.RewardItemCode);

                        encoder.Encode1((byte)pr.Value.Stats.Count);
                        foreach (var pr2 in pr.Value.Stats)
                        {
                            encoder.Encode4(pr2.Key);
                            encoder.Encode4(pr2.Value);
                        }
                    }

                    encoder.Encode1((byte)m_heroSkills.Count);
                    foreach (var pr in m_heroSkills)
                    {
                        encoder.Encode4(pr.Key);
                        encoder.Encode1(pr.Value.ActivatingLevel);
                        encoder.Encode1((byte)(pr.Value.IsPuzzleActive ? 1 : 0));
                        encoder.Encode1((byte)(pr.Value.IsChallengerUse ? 1 : 0));
                        encoder.Encode1((byte)(pr.Value.IsVisible ? 1 : 0));
                    }
                }
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #26
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                ushort size = 0;

                m_vfxs.Clear();
                m_sfxs.Clear();
                m_statusEffects.Clear();
                m_blocks.Clear();
                m_skills.Clear();
                m_gameModes.Clear();
                m_projectiles.Clear();
                m_heroObjects.Clear();
                m_monsters.Clear();
                m_noticeObjects.Clear();
                m_warpGates.Clear();
                m_buffers.Clear();
                m_debuffers.Clear();
                m_lockObstacles.Clear();
                m_slotMachines.Clear(); 
                m_challengers.Clear();
                m_stageObjects.Clear();
                m_stages.Clear();
                m_consumableTypes.Clear();
                m_consumables.Clear();
                m_screenPositions.Clear();
                m_bufferActions.Clear();
                m_slotMachineReels.Clear();

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    VFX o = new VFX();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_vfxs.Add(o.VfxID, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    SFX o = new SFX();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_sfxs.Add(o.SfxID, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    StatusEffect o = new StatusEffect();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_statusEffects.Add(o.StatusEffectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Block o = new Block();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_blocks.Add(o.BlockID, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Skill o = new Skill();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_skills.Add(o.SkillCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    GameMode o = new GameMode();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_gameModes.Add(o.Mode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Projectile o = new Projectile();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_projectiles.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    HeroObject o = new HeroObject();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_heroObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Monster o = new Monster();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_monsters.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.Monster;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    NoticeObject o = new NoticeObject();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_noticeObjects.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.Notice;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    WarpGate o = new WarpGate();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_warpGates.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.WarpGate;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Buffer o = new Buffer();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_buffers.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.Buffer;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    DeBuffer o = new DeBuffer();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_debuffers.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.DeBuffer;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    LockObstacle o = new LockObstacle();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_lockObstacles.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.Chest;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    SlotMachine o = new SlotMachine();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_slotMachines.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.SlotMachine;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Challenger o = new Challenger();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_challengers.Add(o.FieldObjectCode, o);

                    o.SoType = StageObjectType.Challenger;
                    m_stageObjects.Add(o.FieldObjectCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Stage o = new Stage();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_stages.Add(o.StageCode, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    ConsumableTypeInfo o = new ConsumableTypeInfo();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_consumableTypes.Add(o.ConsumableType, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    Consumable o = new Consumable();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_consumables.Add(o.ConsumableID, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    ScreenPosition o = new ScreenPosition();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_screenPositions.Add(o.LifeRate, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    BufferAction o = new BufferAction();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_bufferActions.Add(o.BufferActionID, o);
                }

                size = decoder.Decode2();
                for (ushort i = 0; i < size; ++i)
                {
                    SlotMachineReel o = new SlotMachineReel();
                    if (!o.DeSerialize(stream)) throw new Exception();
                    m_slotMachineReels.Add(o.ReelID, o);
                }
            }
            catch (Exception)
            {
                m_vfxs.Clear();
                m_sfxs.Clear();
                m_statusEffects.Clear();
                m_blocks.Clear();
                m_skills.Clear();
                m_gameModes.Clear();
                m_projectiles.Clear();
                m_heroObjects.Clear();
                m_monsters.Clear();
                m_noticeObjects.Clear();
                m_warpGates.Clear();
                m_buffers.Clear();
                m_debuffers.Clear();
                m_lockObstacles.Clear();
                m_slotMachines.Clear(); 
                m_challengers.Clear();
                m_stageObjects.Clear();
                m_stages.Clear();
                m_consumableTypes.Clear();
                m_consumables.Clear();
                m_screenPositions.Clear();
                m_bufferActions.Clear();
                m_slotMachineReels.Clear();
                m_hash = 0;

                ret = false;
            }

            return ret;
        }
Beispiel #27
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                ret = base.OnSerialize(encoder, stream);
                if (ret)
                {
                    encoder.Encode4(HeroItemCode);
                }
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #28
0
        protected override bool OnDeSerialize(SimpleStream.SerializableDecoder decoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                MissionCode     = decoder.Decode1();
                MissionTypeCode = decoder.Decode1();
                Descriptions    = decoder.DecodeString();
                Condition       = (int)decoder.Decode4();
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #29
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                encoder.Encode4(MissionCode);
                encoder.Encode1(MissionTypeCode);
                encoder.EncodeString(Descriptions);
                encoder.Encode4((uint)Condition);
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }
Beispiel #30
0
        protected override bool OnSerialize(SimpleStream.SerializableEncoder encoder, SimpleStream stream)
        {
            bool ret = true;

            try
            {
                encoder.Encode4(MissionCode);
            }
            catch (Exception)
            {
                ret = false;
            }

            return ret;
        }