Esempio n. 1
0
        /**
         * 是否是卓越物品
         * */
        public Boolean IsExatt(Variant data)
        {
            if (data == null)
            {
                return(false);
            }
            if (data.ContainsKey("make_att") && data["make_att"] > 0)
            {
                Variant make_att = (_lgClient.g_gameConfM as muCLientConfig).svrItemConf.get_make_att(data["make_att"]);
                if (null != make_att)
                {
                    if (IsExatt(make_att))
                    {
                        return(true);
                    }
                }
            }
            int exatt      = 0;
            int ex_att_grp = 0;
            int veriex_cnt = 0;

            if (data.ContainsKey("exatt") && data["exatt"] != null)
            {
                int.TryParse(data["exatt"], out exatt);
            }
            if (data.ContainsKey("ex_att_grp"))
            {
                int.TryParse(data["ex_att_grp"], out ex_att_grp);
            }
            if (data.ContainsKey("veriex_cnt"))
            {
                int.TryParse(data["veriex_cnt"], out veriex_cnt);
            }
            return(exatt > 0 || ex_att_grp > 0 || veriex_cnt > 0);
        }
        protected override Variant _formatConfig(Variant conf)
        {
            if (conf != null)
            {
                Variant npcConf = conf["npc"];
                if (npcConf != null)
                {
                    npcConf = GameTools.array2Map(npcConf, "id");
                }
                foreach (string npcid in npcConf.Keys)
                {
                    if (npcConf[npcid] != null && npcConf[npcid].ContainsKey("lentry"))
                    {
                        Variant lentry = GameTools.split(npcConf[npcid]["lentry"]._str, ",", GameConstantDef.SPLIT_TYPE_INT);
                        npcConf[npcid]["lentry"] = lentry;
                    }
                }
                if (conf.ContainsKey("state_grp"))
                {
                    conf["state_grp"] = GameTools.array2Map(conf["state_grp"], "id");
                }
                if (conf.ContainsKey("dialog"))
                {
                    conf["dialog"] = GameTools.array2Map(conf["dialog"], "did");
                }
                conf["npc"] = npcConf;
            }


            return(base._formatConfig(conf));
        }
Esempio n. 3
0
        a3_BagItemData ReadItem(Variant data)
        {
            uint           id   = data["id"];
            uint           tpid = data["tpid"];
            a3_BagItemData item = new a3_BagItemData();

            item.id   = id;
            item.tpid = tpid;
            if (data.ContainsKey("num"))
            {
                item.num = data["num"];
            }
            item.confdata = a3_BagModel.getInstance().getItemDataById(tpid);
            Variant eqpdata = data["itm"];

            a3_EquipModel.getInstance().equipData_read(item, eqpdata);
            item.auctiondata.cid    = data["cid"];
            item.auctiondata.tm     = data["tm"];
            item.auctiondata.pro_tm = data["puttm_type"];
            item.auctiondata.cost   = data["cost"];
            if (data.ContainsKey("get_type"))
            {
                item.auctiondata.get_type = data["get_type"];
            }
            if (data.ContainsKey("get_tm"))
            {
                item.auctiondata.get_tm = data["get_tm"];
            }
            if (data.ContainsKey("seller_name"))
            {
                item.auctiondata.seller = data["seller_name"];
            }
            return(item);
        }
Esempio n. 4
0
        private void on_player_respawn(Variant msgData)
        {
            debug.Log("PPPPP" + msgData.dump());
            //RoleMgr._instance.onRespawn(msgData);
            if (msgData.ContainsKey("back_town_tm"))
            {
                uint ms  = msgData["back_town_tm"];
                long sec = ms - NetClient.instance.CurServerTimeStamp;
                if (sec < 0)
                {
                    sec = 0;
                }
                //int sec = (int)Math.Ceiling((float)ms / 1000);
                a3_relive.backtown_end_tm = (int)sec;
            }

            if (!msgData.ContainsKey("iid"))
            {
                return;
            }
            int  max_hp = msgData["battleAttrs"]["max_hp"];
            uint iid    = msgData["iid"]._uint;

            if (iid == SelfRole._inst.m_unIID)
            {
                SelfRole._inst.can_buff_move  = true;
                SelfRole._inst.can_buff_skill = true;
                SelfRole._inst.can_buff_ani   = true;
                SelfRole._inst.onRelive(max_hp);
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_RELIVE);
            }
            else
            {
                ProfessionRole pr = OtherPlayerMgr._inst.GetOtherPlayer(iid);
                if (pr != null)
                {
                    //播放伤害
                    pr.onRelive(max_hp);
                }
            }

            if (msgData.ContainsKey("x") && msgData.ContainsKey("y"))
            {
                float   x   = msgData["x"]._float / GameConstant.PIXEL_TRANS_UNITYPOS;
                float   y   = msgData["y"]._float / GameConstant.PIXEL_TRANS_UNITYPOS;
                Vector3 pos = new Vector3(x, 0f, y);
                if (iid == SelfRole._inst.m_unIID)
                {
                    SelfRole._inst.setPos(pos);
                }
                else
                {
                    ProfessionRole pr = OtherPlayerMgr._inst.GetOtherPlayer(iid);
                    if (pr != null)
                    {
                        pr.setPos(pos);
                    }
                }
            }
        }
Esempio n. 5
0
        private void enter_lvl_res(Variant msgData)
        {
            Debug.Log("Level Enter ===============================");
            Debug.Log(msgData.dump());
            uint    ltpid   = msgData["ltpid"];
            Variant variant = SvrLevelConfig.instacne.get_level_data(ltpid);
            bool    flag    = variant.ContainsKey("public") && variant["public"] == 1;

            if (flag)
            {
                this.is_open = true;
            }
            else
            {
                this.is_open = false;
            }
            bool flag2 = variant.ContainsKey("shengwu");

            if (flag2)
            {
                this.open_pic = true;
                string text = variant["icon"];
                this.codes = text.Split(new char[]
                {
                    ','
                });
                this.icon1  = variant["des"];
                this.codess = this.icon1.Split(new char[]
                {
                    ','
                });
            }
            a3_counterpart.lvl = msgData["diff_lvl"];
            NetClient.instance.dispatchEvent(GameEvent.Create(242u, this, GameTools.CreateSwitchData("on_enter_lvl_res", msgData), false));
        }
Esempio n. 6
0
 public void AddMyItem(Variant data)
 {
     myitems_up.Clear();
     myitems_down.Clear();
     if (data.ContainsKey("auc_data"))
     {
         Variant vd = data["auc_data"];
         foreach (Variant v in vd._arr)
         {
             var item = ReadItem(v);
             RemoveItem(item.id);
             if (myitems_up.ContainsKey(item.id))
             {
                 myitems_up[item.id] = item;
             }
             else
             {
                 myitems_up.Add(item.id, item);
             }
         }
     }
     if (data.ContainsKey("get_list"))
     {
         Variant gl = data["get_list"];
         foreach (Variant v in gl._arr)
         {
             var item = ReadItem(v);
             RemoveItem(item.id);
             myitems_down[item.id] = item;
         }
     }
 }
Esempio n. 7
0
        public void add_auc_itm(Variant data)
        {
            bool flag = data == null;

            if (!flag)
            {
                bool flag2 = data["gld"] <= 0 && data["yb"] <= 0;
                if (!flag2)
                {
                    bool flag3 = !data.ContainsKey("auctp");
                    if (flag3)
                    {
                        data["auctp"] = 0;
                    }
                    bool flag4 = data.ContainsKey("yb_bid");
                    if (flag4)
                    {
                        data.RemoveKey("gld_bid");
                    }
                    bool flag5 = data.ContainsKey("yb");
                    if (flag5)
                    {
                        data.RemoveKey("gld");
                    }
                    base.sendRPC(200u, data);
                }
            }
        }
Esempio n. 8
0
        public void SyncAchievementDataByServer(Variant v)
        {
            bool flag = v.ContainsKey("achives");

            if (flag)
            {
                List <Variant> arr = v["achives"]._arr;
                foreach (Variant current in arr)
                {
                    uint key    = current["id"];
                    uint degree = current["reach_num"];
                    uint state  = current["state"];
                    bool flag2  = this.dicAchievementData.ContainsKey(key);
                    if (flag2)
                    {
                        this.dicAchievementData[key].degree = degree;
                        this.dicAchievementData[key].state  = (AchievementState)state;
                    }
                }
            }
            bool flag3 = v.ContainsKey("ach_point");

            if (flag3)
            {
                this.AchievementPoint = v["ach_point"];
                ModelBase <PlayerModel> .getInstance().ach_point = v["ach_point"];

                a3_RankModel.nowexp = v["ach_point"];
            }
        }
Esempio n. 9
0
        public static double next_end_tm(double tm_now, Variant tmchk, double firstracttmt = 0.0, double combracttm = 0.0)
        {
            bool   flag = !ConfigUtil.check_tm(tm_now, tmchk, firstracttmt, combracttm);
            double result;

            if (flag)
            {
                result = 0.0;
            }
            else
            {
                double num   = 0.0;
                bool   flag2 = tmchk.ContainsKey("tb") && tmchk.ContainsKey("te");
                if (flag2)
                {
                    Variant variant = tmchk["te"];
                    TZDate  tZDate  = TZDate.createByYMDHMS(variant["y"], variant["mon"] - 1, variant["d"], variant["h"], variant["min"], variant["s"], 0);
                    num = tZDate.time;
                }
                else
                {
                    bool flag3 = tmchk.ContainsKey("dtb") && tmchk.ContainsKey("dte");
                    if (flag3)
                    {
                        Variant variant2 = tmchk["dte"];
                        TZDate  tZDate2  = TZDate.createByYMDHMS((int)tm_now, 0, 0, 0, 0, 0, 0);
                        tZDate2.setHours(variant2["h"], variant2["min"], variant2["s"], 0);
                        num = tZDate2.time;
                    }
                }
                result = num;
            }
            return(result);
        }
Esempio n. 10
0
        public static bool check_crttm_impl(float tm_now, Variant crttmchk, Variant self)
        {
            bool flag = crttmchk.ContainsKey("optm");
            bool result;

            if (flag)
            {
                bool flag2 = tm_now / 1000f - (float)self["crttm"]._int < (float)(crttmchk["optm"]._int * 86400);
                if (flag2)
                {
                    result = false;
                    return(result);
                }
            }
            bool flag3 = crttmchk.ContainsKey("cltm");

            if (flag3)
            {
                bool flag4 = tm_now / 1000f - (float)self["crttm"]._int > (float)((crttmchk["cltm"]._int + 1) * 86400);
                if (flag4)
                {
                    result = false;
                    return(result);
                }
            }
            result = true;
            return(result);
        }
Esempio n. 11
0
        public int CountExatt(Variant data)
        {
            int  num  = 0;
            bool flag = data.ContainsKey("veriex_cnt");

            if (flag)
            {
                num += data["veriex_cnt"];
            }
            bool flag2 = data.ContainsKey("exatt");

            if (flag2)
            {
                for (int i = 0; i < 32; i++)
                {
                    bool flag3 = (1 << i & data["exatt"]) != 0;
                    if (flag3)
                    {
                        num++;
                    }
                }
            }
            else
            {
                bool flag4 = data.ContainsKey("exatt_show") && data["exatt_show"] != null;
                if (flag4)
                {
                    num++;
                }
                else
                {
                    bool flag5 = data.ContainsKey("make_att");
                    if (flag5)
                    {
                        Variant variant = (this._lgClient.g_gameConfM as muCLientConfig).svrItemConf.get_make_att(data["make_att"]);
                        bool    flag6   = variant;
                        if (flag6)
                        {
                            num += this.CountExatt(variant);
                        }
                    }
                }
            }
            bool flag7 = data.ContainsKey("ex_att_grp");

            if (flag7)
            {
                Variant variant2 = (this._lgClient.g_gameConfM as muCLientConfig).svrItemConf.Get_ex_att_grp(data["ex_att_grp"]);
                bool    flag8    = variant2 != null;
                if (flag8)
                {
                    num += variant2["mincnt"];
                }
                else
                {
                    num++;
                }
            }
            return(num);
        }
Esempio n. 12
0
        //同步服务器信息//0表示未完成,1表示已完成未领奖,2表示已领奖-->
        public void SyncAchievementDataByServer(Variant v)
        {
            //TODO 从服务器同步成就进度
            if (v.ContainsKey("achives"))
            {
                List <Variant> list = v["achives"]._arr;
                foreach (Variant data in list)
                {
                    uint id    = data["id"];
                    uint drgee = data["reach_num"];
                    uint state = data["state"];

                    if (dicAchievementData.ContainsKey(id))
                    {
                        dicAchievementData[id].degree = drgee;

                        dicAchievementData[id].state = (AchievementState)state;
                    }
                }
            }

            if (v.ContainsKey("ach_point"))
            {
                AchievementPoint = v["ach_point"];
                PlayerModel.getInstance().ach_point = v["ach_point"];
                a3_RankModel.nowexp = v["ach_point"];
            }
        }
Esempio n. 13
0
        public Variant get_skill_conf(uint skill_id)
        {
            Variant variant = this.m_conf["skill"][skill_id.ToString()];
            bool    flag    = variant != null;

            if (flag)
            {
                bool flag2 = !variant.ContainsKey("act_c");
                if (flag2)
                {
                    variant["lv"]["1"]["act_c"] = 0;
                }
                bool flag3 = !variant.ContainsKey("agry_c");
                if (flag3)
                {
                    variant["lv"]["1"]["agry_c"] = 0;
                }
                bool flag4 = !variant.ContainsKey("hp_c");
                if (flag4)
                {
                    variant["lv"]["1"]["hp_c"] = 0;
                }
            }
            return(variant);
        }
Esempio n. 14
0
        private void _getSeverListBack(Variant data)
        {
            debug.Log("收到服务器列表信息: " + data.dump());
            bool flag = data["r"]._int == 0;

            if (flag)
            {
                bool flag2 = data.ContainsKey("errmsg");
                if (flag2)
                {
                    debug.Log("SeverListError::" + StringUtils.unicodeToStr(data["errmsg"]._str));
                }
                this.retryLoadServerList();
            }
            else
            {
                bool flag3 = data["r"]._int == 1;
                if (flag3)
                {
                    bool flag4 = data.ContainsKey("data");
                    if (flag4)
                    {
                        this._srv_lists = data["data"]["srv_lists"];
                        Variant variant = new Variant();
                        variant["svrList"] = this._srv_lists;
                        this.notify(variant);
                        Globle.initServer(this._srv_lists._arr);
                        login.instance.refresh();
                    }
                }
            }
        }
Esempio n. 15
0
        private void on_single_skill_res(Variant msgData)
        {
            debug.Log("UUUUUUU" + msgData.dump());
            uint     @uint = msgData["to_iid"]._uint;
            uint     uint2 = msgData["frm_iid"]._uint;
            BaseRole role  = RoleMgr._instance.getRole(@uint);
            BaseRole role2 = RoleMgr._instance.getRole(uint2);
            bool     flag  = !msgData.ContainsKey("states");

            if (!flag)
            {
                bool flag2 = role != null && role.m_isMain;
                if (flag2)
                {
                    Variant variant = msgData["states"];
                    bool    flag3   = msgData["sid"];
                    if (flag3)
                    {
                        int type = msgData["sid"];
                        FightText.play(FightText.BUFF_TEXT, role.getHeadPos(), 0, false, type);
                    }
                    ModelBase <A3_BuffModel> .getInstance().addBuffList(variant);

                    bool flag4 = variant["id"] == 10000;
                    if (flag4)
                    {
                        BaseProxy <A3_ActiveProxy> .getInstance().dispatchEvent(GameEvent.Create(A3_ActiveProxy.EVENT_ONBLESS, this, variant, false));
                    }
                }
                else
                {
                    ModelBase <A3_BuffModel> .getInstance().addOtherBuff(role, msgData["states"]["id"]);
                }
                bool flag5 = msgData.ContainsKey("states");
                if (flag5)
                {
                    SXML   sXML    = XMLMgr.instance.GetSXML("skill.state", "id==" + msgData["states"]["id"]);
                    string @string = sXML.getString("effect");
                    bool   flag6   = role2 is MonsterRole && (role2 as MonsterRole).issummon && @uint == uint2;
                    if (flag6)
                    {
                        role2.PlaySkill(msgData["sid"]);
                    }
                    bool flag7 = @string != "null";
                    if (flag7)
                    {
                        float      @float     = sXML.getFloat("last");
                        GameObject original   = Resources.Load <GameObject>(@string);
                        GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);
                        gameObject.transform.SetParent(role.m_curModel, false);
                        UnityEngine.Object.Destroy(gameObject, @float);
                        bool flag8 = sXML.getFloat("head") > 0f;
                        if (flag8)
                        {
                            gameObject.transform.localPosition = new Vector3(0f, role.headOffset_half.y / 2f + sXML.getFloat("head"), 0f);
                        }
                    }
                }
            }
        }
Esempio n. 16
0
        public void TestDictionaryAdd()
        {
            Variant v = new Variant(Variant.EnumType.Dictionary);

            Assert.Throws <VariantException>(delegate { v.Add(new Variant()); });
            Assert.Throws <VariantException>(delegate { v.Add(new DateTime(0), new Variant()); });

            v.Add("key1", new Variant("value1"));
            v.Add("key2", new Variant(1.0));

            Assert.AreEqual(v.Count, 2);
            Assert.IsFalse(v.Empty);

            Assert.IsTrue(v.ContainsKey("key1"));
            Assert.IsTrue(v.ContainsKey("key2"));

            Assert.AreEqual(v["key1"].Type, Variant.EnumType.String);
            Assert.AreEqual(v["key1"].As <string>(), "value1");
            Assert.AreEqual(v["key2"].Type, Variant.EnumType.Double);
            Assert.AreEqual(v["key2"].As <double>(), 1.0);

            v["key1"] = new Variant("other");
            Assert.AreEqual(v["key1"].As <string>(), "other");

            v.Remove("key1");
            Assert.AreEqual(v.Count, 1);

            v.Remove("key2");
            Assert.AreEqual(v.Count, 0);
            Assert.IsTrue(v.Empty);
        }
Esempio n. 17
0
        public void onItemCd(Variant data)
        {
            bool flag = data.ContainsKey("itemcds");

            if (flag)
            {
                foreach (Variant current in data["itemcd"]._arr)
                {
                    int   num  = current["cdtp"];
                    float num2 = current["cdtm"];
                }
            }
            bool flag2 = data.ContainsKey("cd_type");

            if (flag2)
            {
                int   num3  = data["cd_type"];
                float time  = data["cd"];
                bool  flag3 = num3 == 4;
                if (flag3)
                {
                    MediaClient.instance.PlaySoundUrl("audio/common/use_hp", false, null);
                }
                ModelBase <a3_BagModel> .getInstance().addItemCd(num3, time);
            }
        }
Esempio n. 18
0
 void setTotalData(Variant data)
 {
     //累积消费
     if (data.ContainsKey("total_xiaofei"))
     {
         uint total_xiaofei = data["total_xiaofei"];
         b_leijixiaofei = WelfareModel.getInstance().for_leixjixiaofei(leijixiaofei);
         // showIconLight();
     }
     //累积充值
     if (data.ContainsKey("total_recharge"))
     {
         totalRecharge   = data["total_recharge"];
         b_leijizhongzhi = WelfareModel.getInstance().for_leijichongzhi(leijichongzhi);
         // showIconLight();
     }
     //累积日充值
     if (data.ContainsKey("richong"))
     {
         uint richong = data["richong"];
         todayTotal_recharge = richong;
         if (a3_awardCenter._instance)
         {
             a3_awardCenter._instance.RefreshInfo();
         }
         // b_leijichongzhi_today = WelfareModel.getInstance().for_jinrichongzhi(dailyGift);
         // showIconLight();
     }
 }
Esempio n. 19
0
        public override void initShowInfo(Variant data, Action <_graphChaSprite> cb)
        {
            bool flag = data.ContainsKey("width");

            if (flag)
            {
                this.progressBar.width = data["width"]._float;
            }
            bool flag2 = data.ContainsKey("height");

            if (flag2)
            {
                this.progressBar.height = data["height"]._float;
            }
            bool flag3 = data.ContainsKey("res");

            if (flag3)
            {
                this.progressBar.file = data["res"];
                this.progressBar.createUIObject(null);
            }
            bool flag4 = cb != null;

            if (flag4)
            {
                cb(this);
            }
        }
Esempio n. 20
0
        protected override Variant _formatConfig(Variant conf)
        {
            if (conf.ContainsKey("vip"))
            {
                foreach (Variant vip in conf["vip"]._arr)
                {
                    if (vip.ContainsKey("item_grp"))
                    {
                        foreach (Variant item_grp in vip["item_grp"]._arr)
                        {
                            if (item_grp.ContainsKey("ids"))
                            {
                                item_grp["ids"] = GameTools.split(item_grp["ids"]._str, ",", GameConstantDef.SPLIT_TYPE_INT);
                            }
                        }
                    }
                }
            }
            if (conf.ContainsKey("awdact"))
            {
                foreach (Variant obj in conf["awdact"]._arr)
                {
                    foreach (Variant awd in obj["target"]._arr)
                    {
                        awd["awd"] = awd["awd"].convertToDct("awdid");
                    }
                }
            }
            if (conf.ContainsKey("carr"))
            {
                conf["carr"] = GameTools.array2Map(conf["carr"], "id");
            }

            return(base._formatConfig(conf));
        }
Esempio n. 21
0
        private void setTotalData(Variant data)
        {
            bool flag = data.ContainsKey("total_xiaofei");

            if (flag)
            {
                uint num = data["total_xiaofei"];
                this.b_leijixiaofei = ModelBase <WelfareModel> .getInstance().for_leixjixiaofei(this.leijixiaofei);

                this.showIconLight();
            }
            bool flag2 = data.ContainsKey("total_recharge");

            if (flag2)
            {
                welfareProxy.totalRecharge = data["total_recharge"];
                this.b_leijizhongzhi       = ModelBase <WelfareModel> .getInstance().for_leijichongzhi(this.leijichongzhi);

                this.showIconLight();
            }
            bool flag3 = data.ContainsKey("richong");

            if (flag3)
            {
                uint num2 = data["richong"];
                this.b_leijichongzhi_today = ModelBase <WelfareModel> .getInstance().for_jinrichongzhi(this.dailyGift);

                this.showIconLight();
            }
        }
Esempio n. 22
0
        void addRoomObjForUI(Variant v)
        {
            if (roomItemCon == null)
            {
                roomItemCon      = new GameObject();
                roomItemCon.name = "roomObjs";
            }


            GameObject go = GameObject.CreatePrimitive(PrimitiveType.Cube);

            go.transform.SetParent(roomItemCon.transform);
            go.transform.position   = new Vector3(v["ux"], v["uy"], v["uz"]);
            go.transform.localScale = new Vector3(v["uw"], 1, v["uh"]);

            CoFBMapPoint fbRoom = go.AddComponent <CoFBMapPoint>();

            if (v.ContainsKey("id"))
            {
                fbRoom.id = v["id"];
            }
            if (v.ContainsKey("fb_id"))
            {
                fbRoom.levelId = v["fb_id"]._uint;
            }
            //if (v.ContainsKey("faceto"))
            //    fbRoom.faceto = v["faceto"];
            fbRoom.init();
        }
Esempio n. 23
0
        public void AddMyItem(Variant data)
        {
            this.myitems_up.Clear();
            this.myitems_down.Clear();
            bool flag = data.ContainsKey("auc_data");

            if (flag)
            {
                Variant variant = data["auc_data"];
                foreach (Variant current in variant._arr)
                {
                    a3_BagItemData a3_BagItemData = this.ReadItem(current);
                    this.RemoveItem(a3_BagItemData.id);
                    this.myitems_up[a3_BagItemData.id] = a3_BagItemData;
                }
            }
            bool flag2 = data.ContainsKey("get_list");

            if (flag2)
            {
                Variant variant2 = data["get_list"];
                foreach (Variant current2 in variant2._arr)
                {
                    a3_BagItemData a3_BagItemData2 = this.ReadItem(current2);
                    this.RemoveItem(a3_BagItemData2.id);
                    this.myitems_down[a3_BagItemData2.id] = a3_BagItemData2;
                }
            }
        }
Esempio n. 24
0
        public void get_rank_info(Variant data)
        {
            Variant variant = new Variant();

            variant["rnk_tp"]    = data["tp"];
            variant["begin_idx"] = data["begin_idx"];
            bool flag = data.ContainsKey("end_idx");

            if (flag)
            {
                variant["end_idx"] = data["end_idx"];
            }
            bool flag2 = data.ContainsKey("rnk_cnt");

            if (flag2)
            {
                variant["rnk_cnt"] = data["rnk_cnt"];
            }
            bool flag3 = data.ContainsKey("arenaid");

            if (flag3)
            {
                variant["arenaid"] = data["arenaid"];
            }
            bool flag4 = data.ContainsKey("sub_tp") && data["sub_tp"];

            if (flag4)
            {
                variant["sub_tp"] = data["sub_tp"];
            }
            base.sendRPC(254u, variant);
        }
Esempio n. 25
0
        public void getRechargeDate(Variant data)
        {
            this.Rechargetm[1] = 0;
            this.Rechargetm[2] = 0;
            this.Rechargetm[3] = 0;
            bool flag = data.ContainsKey("monthly");

            if (flag)
            {
                this.Rechargetm[1] = data["monthly"]._int32;
            }
            bool flag2 = data.ContainsKey("quarterly");

            if (flag2)
            {
                this.Rechargetm[2] = data["quarterly"]._int32;
            }
            bool flag3 = data.ContainsKey("yearly");

            if (flag3)
            {
                this.Rechargetm[3] = data["yearly"]._int32;
            }
            base.dispatchEvent(GameEvent.Create(RechargeProxy.LIS_RECHARGE_TYPE_RES, this, null, false));
        }
Esempio n. 26
0
        protected override Variant _formatConfig(Variant conf)
        {
            bool flag = conf != null;

            if (flag)
            {
                Variant variant = conf["npc"];
                bool    flag2   = variant != null;
                if (flag2)
                {
                    variant = GameTools.array2Map(variant, "id", 1u);
                }
                foreach (string current in variant.Keys)
                {
                    bool flag3 = variant[current] != null && variant[current].ContainsKey("lentry");
                    if (flag3)
                    {
                        Variant value = GameTools.split(variant[current]["lentry"]._str, ",", 0u);
                        variant[current]["lentry"] = value;
                    }
                }
                bool flag4 = conf.ContainsKey("state_grp");
                if (flag4)
                {
                    conf["state_grp"] = GameTools.array2Map(conf["state_grp"], "id", 1u);
                }
                bool flag5 = conf.ContainsKey("dialog");
                if (flag5)
                {
                    conf["dialog"] = GameTools.array2Map(conf["dialog"], "did", 1u);
                }
                conf["npc"] = variant;
            }
            return(base._formatConfig(conf));
        }
Esempio n. 27
0
        /**
         * 时效结束的时间,如果不再时效内,返回0
         * @param current_tm
         * @param tmchk
         * @return
         *
         */
        static public double next_end_tm(double tm_now, Variant tmchk, double firstracttmt = 0, double combracttm = 0)
        {
            if (!check_tm(tm_now, tmchk, firstracttmt, combracttm))
            {
                return(0);
            }

            double _end_tm = 0;

            if (tmchk.ContainsKey("tb") && tmchk.ContainsKey("te"))
            {
                Variant te = tmchk["te"];

                TZDate tedate = TZDate.createByYMDHMS(te["y"], te["mon"] - 1, te["d"], te["h"], te["min"], te["s"]);
                _end_tm = tedate.time;
            }
            else if (tmchk.ContainsKey("dtb") && tmchk.ContainsKey("dte"))
            {
                Variant dte  = tmchk["dte"];
                TZDate  dted = TZDate.createByYMDHMS((int)tm_now);
                dted.setHours(dte["h"], dte["min"], dte["s"], 0);
                _end_tm = dted.time;
            }
            return(_end_tm);
        }
Esempio n. 28
0
        public void OnGetAchiveRes(Variant data)
        {
            bool flag = data.ContainsKey("achives");

            if (flag)
            {
                this._achives = data["achives"];
                bool flag2 = Convert.ToBoolean(this.uiAchive);
                if (flag2)
                {
                    this.uiAchive.AddAchives(this._achives);
                }
            }
            else
            {
                bool flag3 = data.ContainsKey("rmv_achive");
                if (flag3)
                {
                    this.removeAchive(data["rmv_achive"]);
                    bool flag4 = Convert.ToBoolean(this.uiAchive);
                    if (flag4)
                    {
                        this.uiAchive.RmvAchive(data["rmv_achive"]);
                    }
                }
            }
        }
Esempio n. 29
0
        private void onViewAvatar_Change(Variant v)
        {
            debug.Log("PPP" + v.dump());
            uint num  = v["iid"];
            bool flag = v.ContainsKey("serial_kp");

            if (flag)
            {
                bool flag2 = v["iid"] == ModelBase <PlayerModel> .getInstance().iid;

                if (flag2)
                {
                    bool flag3 = SelfRole._inst != null;
                    if (flag3)
                    {
                        ModelBase <PlayerModel> .getInstance().serial = v["serial_kp"];

                        SelfRole._inst.serial = v["serial_kp"];
                        PlayerNameUIMgr.getInstance().refreserialCount(SelfRole._inst, v["serial_kp"]);
                    }
                }
            }
            bool flag4 = v.ContainsKey("strike_back_tm");

            if (flag4)
            {
                bool flag5 = v["iid"] == ModelBase <PlayerModel> .getInstance().iid;

                if (flag5)
                {
                    bool flag6 = v.ContainsKey("strike_back_tm");
                    if (flag6)
                    {
                        bool flag7 = SelfRole._inst != null;
                        if (flag7)
                        {
                            SelfRole._inst.hidbacktime = v["strike_back_tm"];
                            bool flag8 = v["strike_back_tm"] == 0;
                            if (flag8)
                            {
                                ModelBase <PlayerModel> .getInstance().hitBack = 0u;

                                PlayerNameUIMgr.getInstance().refresHitback(SelfRole._inst, 0, true);
                            }
                            else
                            {
                                ModelBase <PlayerModel> .getInstance().hitBack = SelfRole._inst.hidbacktime - (uint)NetClient.instance.CurServerTimeStamp;

                                PlayerNameUIMgr.getInstance().refresHitback(SelfRole._inst, (int)(SelfRole._inst.hidbacktime - (uint)NetClient.instance.CurServerTimeStamp), true);
                            }
                        }
                    }
                }
            }
            else
            {
                OtherPlayerMgr._inst.refreshPlayerInfo(v);
            }
        }
Esempio n. 30
0
        public bool applyStyleConf(Variant v)
        {
            bool flag = v == null;
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = v.ContainsKey("prop");
                if (flag2)
                {
                    Variant variant = v["prop"];
                    bool    flag3   = variant.ContainsKey("vAlign");
                    if (flag3)
                    {
                        this.m_vAligment = this._vAligment(variant["vAlign"]._str);
                    }
                    bool flag4 = variant.ContainsKey("hAlign");
                    if (flag4)
                    {
                        this.m_hAligment = this._hAligment(variant["hAlign"]._str);
                    }
                    bool flag5 = variant.ContainsKey("leftMargin");
                    if (flag5)
                    {
                        this.m_leftMargin = variant["leftMargin"]._float;
                    }
                    bool flag6 = variant.ContainsKey("rightMargin");
                    if (flag6)
                    {
                        this.m_rightMargin = variant["rightMargin"]._float;
                    }
                    bool flag7 = variant.ContainsKey("topMargin");
                    if (flag7)
                    {
                        this.m_topMargin = variant["topMargin"]._float;
                    }
                    bool flag8 = variant.ContainsKey("bottomMargin");
                    if (flag8)
                    {
                        this.m_bottonMargin = variant["bottomMargin"]._float;
                    }
                    bool flag9 = variant.ContainsKey("margin");
                    if (flag9)
                    {
                        this.m_margin = variant["margin"]._float;
                    }
                }
                bool flag10 = v.ContainsKey("filter");
                if (flag10)
                {
                }
                result = true;
            }
            return(result);
        }
Esempio n. 31
0
                public void TestDictionary()
                {
                    Variant v = new Variant(Variant.EnumType.Dictionary);

                    Assert.AreEqual(v.Count, 0);

                    Assert.IsFalse(v.ContainsKey("key1"));
                    Assert.IsFalse(v.ContainsKey("key2"));

                    v.Add("key1", new Variant("value1"));
                    v.Add("key2", new Variant("value2"));

                    Assert.AreEqual(v.Count, 2);

                    Assert.IsTrue(v.ContainsKey("key1"));
                    Assert.IsTrue(v.ContainsKey("key2"));

                    Assert.AreEqual(v["key1"].AsString(), "value1");
                    Assert.AreEqual(v["key2"].AsString(), "value2");
                }