Beispiel #1
0
    public void updateMagicWeapon(string uid, ErlArray ea)
    {
        magicWeaponVersion++;
        MagicWeapon mw = magicWeaponStorage.getPropByUid(uid) as MagicWeapon;

        if (mw != null)
        {
            mw.bytesRead(0, ea);
        }
    }
Beispiel #2
0
 private void addStorageProp(string type, ErlArray data)
 {
     if (type == StorageFPort.GOODS)
     {
         PropStorageVersion++;
         Prop prop = PropManagerment.Instance.createProp();
         prop.bytesRead(0, data);
         addGoodsProp(prop);
     }
     else if (type == StorageFPort.CARD)
     {
         RoleStorageVersion++;
         Card card = CardManagerment.Instance.createCard();
         card.bytesRead(0, data);
         addCardProp(card);
         IncreaseManagerment.Instance.clearData(IncreaseManagerment.TYPE_CARD);
     }
     else if (type == StorageFPort.BEAST)
     {
         beastStorageVersion++;
         Card card = CardManagerment.Instance.createCard();
         card.bytesRead(0, data);
         addBeastProp(card);
         IncreaseManagerment.Instance.clearData(IncreaseManagerment.TYPE_BEAST);
     }
     else if (type == StorageFPort.EQUIPMENT || type == StorageFPort.EQUIPMENT1)
     {
         EquipStorageVersion++;
         Equip equip = EquipManagerment.Instance.createEquip();
         equip.bytesRead(0, data);
         equip.isNew = true;
         addEquipProp(equip);
     }
     else if (type == StorageFPort.STAR_SOUL_STORAGE)
     {
         starSoulStorageVersion++;
         StarSoul starSoul = StarSoulManager.Instance.createStarSoul(data);
         addStarSoulStorage(starSoul, true);
     }
     else if (type == StorageFPort.MOUNTS)
     {
         mountsStorageVersion++;
         Mounts mounts = MountsManagerment.Instance.createMounts(data);
         addMounts(mounts);
     }
     else if (type == StorageFPort.MAGIC_WEAPON)
     {
         magicWeaponVersion++;
         MagicWeapon magic = new MagicWeapon();
         magic.bytesRead(0, data);
         addMagicWeaponProp(magic);
     }
 }
Beispiel #3
0
    public void parse(ErlArray array, Award award)
    {
        ErlArray arr;

        for (int i = 0; i < array.Value.Length; i++)
        {
            arr = array.Value [i] as ErlArray;
            string type = (arr.Value [0]).getValueString();
            if (type == TYPE_RMB)
            {
                int rmb = StringKit.toInt(arr.Value [1].getValueString());
                award.awardRmb = rmb;
            }
            else if (type == TYPE_CARD)
            {
                Card c = CardManagerment.Instance.createCard();
                c.bytesRead(0, arr.Value [1] as ErlArray);
                StorageManagerment.Instance.addCardProp(c);
                CardAward card = new CardAward();
                card.id  = c.uid;
                card.sid = c.sid;
                award.cards.Add(card);
            }
            else if (type == TYPE_BEAST)
            {
                Card c = CardManagerment.Instance.createCard();
                c.bytesRead(0, arr.Value [1] as ErlArray);
                StorageManagerment.Instance.addBeastProp(c);
                CardAward card = new CardAward();
                card.id  = c.uid;
                card.sid = c.sid;
                award.cards.Add(card);
            }
            else if (type == TYPE_PROP)
            {
                Prop p = PropManagerment.Instance.createProp();
                p.bytesRead(1, arr);
                StorageManagerment.Instance.addGoodsProp(p);
                PropAward prop = new PropAward();
                prop.sid = p.sid;
                prop.num = p.getNum();
                award.props.Add(prop);
            }
            else if (type == TYPE_EQUIP)
            {
                Equip eq = EquipManagerment.Instance.createEquip();
                eq.bytesRead(0, arr.Value [1] as ErlArray);
//				if(!ChooseTypeSampleManager.Instance.isToEat (eq, ChooseTypeSampleManager.TYPE_EQUIP_EXP))
                eq.isNew = true;
                StorageManagerment.Instance.addEquipProp(eq);
                EquipAward equip = new  EquipAward();
                equip.id  = eq.uid;
                equip.sid = eq.sid;
                award.equips.Add(equip);
            }
            else if (type == KEY_MAGICWEAPON)
            {
                MagicWeapon mc = MagicWeaponManagerment.Instance.createMagicWeapon();
                mc.bytesRead(0, arr.Value[1] as ErlArray);
                StorageManagerment.Instance.addMagicWeaponProp(mc);
                MagicwWeaponAward mcAward = new MagicwWeaponAward();
                mcAward.id  = mc.uid;
                mcAward.sid = mc.sid;
                award.magicWeapons.Add(mcAward);
            }
            else if (type == TempPropType.STARSOUL)
            {
                StarSoul starSoul = StarSoulManager.Instance.createStarSoul();
                starSoul.bytesRead(0, arr.Value [1] as ErlArray);
                StorageManagerment.Instance.addStarSoulStorage(starSoul, true);
                StarSoulAward starSoulAward = new  StarSoulAward();
                starSoulAward.uid = starSoul.uid;
                starSoulAward.sid = starSoul.sid;
                award.starsouls.Add(starSoulAward);
            }
            else if (type == TYPE_EXP)
            {
                long exp = StringKit.toLong(arr.Value [1].getValueString());
                award.awardExp = exp;
            }
            else if (type == TYPE_MONEY)
            {
                int money = StringKit.toInt(arr.Value [1].getValueString());
                award.awardMoney = money;
            }
            else if (type == TYPE_CARD_EXP)
            {
                EXPAward exp = new EXPAward();
                exp.id       = arr.Value [1].getValueString();
                exp.awardExp = StringKit.toLong(arr.Value [2].getValueString());
                award.exps.Add(exp);
            }
            else if (type == TYPE_HONOR)
            {
                int honor = StringKit.toInt(arr.Value [1].getValueString());
                award.awardHonor = honor;
            }
            else if (type == TYPE_INTEGRAL)
            {
                int integral = StringKit.toInt(arr.Value [1].getValueString());
                award.awardIntegral = integral;
            }
            else if (type == TYPE_MERIT)
            {
                int merit = StringKit.toInt(arr.Value [1].getValueString());
                award.awardMerit = merit;
            }
            else if (type == TYPE_STAR)
            {
                int starNum = StringKit.toInt(arr.Value [1].getValueString());
                award.awardStar = starNum;
            }
            else if (type == TYPE_CONTRIBUTION)
            {
                int contribution = StringKit.toInt(arr.Value [1].getValueString());
                award.awardCon = contribution;
            }
            else if (type == TYPE_PK)
            {
                int pkNum = StringKit.toInt(arr.Value [1].getValueString());
                SweepManagement.Instance.initPvpNum(pkNum);
            }
            else if (type == TYPE_LUCKSTAR)
            {
                int luckStarNum = StringKit.toInt(arr.Value [1].getValueString());
                award.awardLuckyStar = luckStarNum;
            }
            else if (type == TYPE_PRESTIGE)
            {
                int prestige = StringKit.toInt(arr.Value[1].getValueString());
                award.awardPrestige = prestige;
            }
            else if (type == TempPropType.STARSOUL_DEBRIS)
            {
                int debris = StringKit.toInt(arr.Value[1].getValueString());
                award.awardStarsoulDebris = debris;
            }
            else if (type == TYPE_GODSWAR_INTEGRAL)
            {
                int debris = StringKit.toInt(arr.Value[1].getValueString());
                award.godsWar_awardIntegral = debris;
            }
            else if (type == TYPE_LASTBATTLE_SCORE)
            {
                LastBattleManagement.Instance.battleScore = StringKit.toInt(arr.Value[1].getValueString());
            }
        }
    }