Ejemplo n.º 1
0
    /// <summary>
    /// 创建星魂对象
    /// </summary>
    /// <param name="array">元组数据结构</param>
    public StarSoul createStarSoul(ErlArray array)
    {
        StarSoul starSoul = new StarSoul();

        starSoul.bytesRead(0, array);
        return(starSoul);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 添加星魂到猎魂仓库
    /// </summary>
    /// <param name="data">数据</param>
    public void addHuntStarSoulStorage(ErlArray data)
    {
        StarSoul starSoul = StarSoulManager.Instance.createStarSoul();

        starSoul.bytesRead(0, data);
        addHuntStarSoulStorage(starSoul, true);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 更新星魂仓库中的星魂数据
    /// </summary>
    /// <param name="uid">uid</param>
    /// <param name="ea">数据</param>
    public void updateStarSoulStorage(string uid, ErlArray ea)
    {
        StarSoul starSoul = starSoulStorage.getPropByUid(uid) as StarSoul;

        if (starSoul != null)
        {
            starSoul.bytesRead(0, ea);
        }
    }
Ejemplo n.º 4
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());
            }
        }
    }