Пример #1
0
        private void onActivedegree_info(Variant data)
        {
            bool flag = !data.ContainsKey("huoyue_point");

            if (!flag)
            {
                debug.Log("活跃度::" + data.dump());
                bool flag2 = SelfRole._inst != null;
                if (flag2)
                {
                    SelfRole._inst.m_LockRole = null;
                }
                bool flag3 = data.ContainsKey("res");
                if (flag3)
                {
                    int num  = data["res"];
                    int num2 = num;
                    if (num2 != 0)
                    {
                        if (num2 == 1)
                        {
                            this.point.Clear();
                            this.itd.Clear();
                            this.huoyue_point = data["huoyue_point"];
                            foreach (Variant current in data["huoyues"]._arr)
                            {
                                uint             num3             = current["active_id"];
                                uint             count            = current["count"];
                                ActiveDegreeData activeDegreeData = new ActiveDegreeData();
                                activeDegreeData.id    = num3;
                                activeDegreeData.count = count;
                                this.itd.Add(num3, activeDegreeData);
                            }
                            using (List <Variant> .Enumerator enumerator2 = data["huoyue_reward"]._arr.GetEnumerator())
                            {
                                while (enumerator2.MoveNext())
                                {
                                    int item = enumerator2.Current;
                                    this.point.Add(item);
                                }
                            }
                            bool flag4 = a3_activeDegree.instance != null;
                            if (flag4)
                            {
                                a3_activeDegree.instance.do_Active();
                                a3_activeDegree.instance.onLoad_Change();
                                a3_activeDegree.instance.onActive_Load();
                            }
                            this.point.Sort();
                            bool flag5 = this.huoyue_point < 20;
                            bool flag6;
                            if (flag5)
                            {
                                flag6 = false;
                            }
                            else
                            {
                                bool flag7 = this.point.Count > 0;
                                if (flag7)
                                {
                                    int  num4  = this.point[this.point.Count - 1];
                                    bool flag8 = num4 == 100;
                                    flag6 = (!flag8 && this.huoyue_point >= num4 + 20);
                                }
                                else
                                {
                                    flag6 = true;
                                }
                            }
                            IconAddLightMgr.getInstance().showOrHideFire(flag6 ? "open_light_huoyue" : "close_light_huoyue", null);
                        }
                    }
                }
            }
        }
Пример #2
0
        private void onActivedegree_info(Variant data)
        {
            if (!data.ContainsKey("huoyue_point"))
            {
                return;
            }
            debug.Log("活跃度::" + data.dump());
            if (SelfRole._inst != null)
            {
                SelfRole._inst.m_LockRole = null;
            }
            if (data.ContainsKey("res"))
            {
                int res = data["res"];
                switch (res)
                {
                case 0:    //获取总点数
                    // dispatchEvent(GameEvent.Create(EVENT_GET_ALLPOINT, this, data));
                    break;

                case 1:    //获取各个活跃活动信息;
                    point.Clear();
                    itd.Clear();
                    huoyue_point = data["huoyue_point"];

                    foreach (Variant v in data["huoyues"]._arr)
                    {
                        uint             id    = v["active_id"];
                        uint             count = v["count"];
                        ActiveDegreeData i     = new ActiveDegreeData();
                        i.id    = id;
                        i.count = count;
                        itd.Add(id, i);
                    }
                    foreach (int id in data["huoyue_reward"]._arr)
                    {
                        point.Add(id);
                    }

                    if (a3_activeDegree.instance != null)
                    {
                        a3_activeDegree.instance.do_Active();
                        a3_activeDegree.instance.onLoad_Change();
                        a3_activeDegree.instance.onActive_Load();
                    }
                    // dispatchEvent(GameEvent.Create(EVENT_GET_ALLPOINT, this, data));

                    //for (int i = 0; i < xmlreward.Count; i++)
                    //{
                    //    int index = i;
                    //    if (a3_activeDegreeProxy.getInstance().huoyue_point >= xmlreward[index].getInt("ac"))
                    //    {
                    //        if (!a3_activeDegreeProxy.getInstance().point.Contains(xmlreward[index].getInt("ac")))
                    //        {
                    //            InterfaceMgr.doCommandByLua("a1_low_fightgame.resh_huoyue", "ui/interfaces/low/a1_low_fightgame", data);
                    //        }
                    //        else
                    //        {
                    //            InterfaceMgr.doCommandByLua("a1_low_fightgame.resh_huoyue", "ui/interfaces/low/a1_low_fightgame", null);
                    //        }
                    //    }

                    //}

                    point.Sort();
                    //List<SXML> xmlreward = XMLMgr.instance.GetSXMLList("huoyue.reward");
                    //if ((point.Count > 0 && huoyue_point >= point[point.Count - 1]+20)||(point.Count==0&&huoyue_point>= xmlreward[0].getInt("ac")))
                    //{
                    //    IconAddLightMgr.getInstance().showOrHideFire("resh_huoyue",data);
                    //    //InterfaceMgr.doCommandByLua("a1_low_fightgame.resh_huoyue", "ui/interfaces/low/a1_low_fightgame", data);
                    //}
                    //else if (point.Count > 0 && huoyue_point / 20 >= point.Count+1)
                    //{
                    //    IconAddLightMgr.getInstance().showOrHideFire("resh_huoyue", data);
                    //    //InterfaceMgr.doCommandByLua("a1_low_fightgame.resh_huoyue", "ui/interfaces/low/a1_low_fightgame", data);
                    //}
                    //else
                    //{
                    //    IconAddLightMgr.getInstance().showOrHideFire("resh_huoyue", data);
                    //    //InterfaceMgr.doCommandByLua("a1_low_fightgame.resh_huoyue", "ui/interfaces/low/a1_low_fightgame", null);
                    //}
                    bool isopenlight = false;
                    int  max_ac      = 0;
                    if (huoyue_point < 20)
                    {
                        isopenlight = false;
                    }
                    else
                    {
                        if (point.Count > 0)
                        {
                            max_ac = point[point.Count - 1];
                            if (max_ac == 100)
                            {
                                isopenlight = false;
                            }
                            else
                            {
                                isopenlight = huoyue_point >= max_ac + 20 ? true : false;
                            }
                        }
                        else
                        {
                            isopenlight = true;
                        }
                    }

                    IconAddLightMgr.getInstance().showOrHideFire(isopenlight? "open_light_huoyue": "close_light_huoyue", null);



                    break;
                }
            }


            //服务器发的表里读取所有活跃数据,存到A3_activeDegreeModel.getinstance().activedeg_info里
            //id为键
        }