public override void addListener() { ConfigUtil.SetTimeout(NbDelay.sec, new Action(this.doHandle)); }
private Variant transTmchks(Variant tmchks) { Variant variant = new Variant(); bool flag = tmchks != null; if (flag) { foreach (Variant current in tmchks._arr) { Variant variant2 = new Variant(); bool flag2 = current.ContainsKey("dtb"); if (flag2) { string str = current["dtb"]._str; Variant variant3 = new Variant(); Variant variant4 = GameTools.split(str, ":", 1u); variant3["h"] = variant4[0]; variant3["min"] = variant4[1]; variant3["s"] = variant4[2]; variant2["dtb"] = variant3; } bool flag3 = current.ContainsKey("dte"); if (flag3) { string str2 = current["dte"]._str; Variant variant5 = GameTools.split(str2, ":", 1u); Variant variant6 = new Variant(); variant6["h"] = variant5[0]; variant6["min"] = variant5[1]; variant6["s"] = variant5[2]; variant2["dte"] = variant6; } bool flag4 = current.ContainsKey("optm"); if (flag4) { variant2["optm"] = current["optm"]; } bool flag5 = current.ContainsKey("cltm"); if (flag5) { variant2["cltm"] = current["cltm"]; } bool flag6 = current.ContainsKey("cb_optm"); if (flag6) { variant2["cb_optm"] = current["cb_optm"]; } bool flag7 = current.ContainsKey("cb_cltm"); if (flag7) { variant2["cb_cltm"] = current["cb_cltm"]; } bool flag8 = current.ContainsKey("tb"); if (flag8) { variant2["tb"] = ConfigUtil.GetTmchkAbs(current["tb"]); } bool flag9 = current.ContainsKey("te"); if (flag9) { variant2["te"] = ConfigUtil.GetTmchkAbs(current["te"]); } bool flag10 = current.ContainsKey("type"); if (flag10) { variant2["type"] = current["type"]; } bool flag11 = variant == null; if (flag11) { variant = new Variant(); } variant._arr.Add(variant2); } } return(variant); }
private void onItemCardInfo(Variant d) { bool flag = d.ContainsKey("tp"); if (flag) { HttpAppMgr.instance.onGetRewardItems(d["tp"]); } else { bool flag2 = d.ContainsKey("tpchange"); if (flag2) { int random = ConfigUtil.getRandom(0, 20); DelayDoManager.singleton.AddDelayDo(delegate { this.sendLoadItemCardInfo(null); }, random, 0u); debug.Log("兑换码后台发生变!!!间隔发送请求礼品卡:" + random); } else { bool flag3 = d.ContainsKey("card_fetch"); if (flag3) { Variant variant = d["card_fetch"]; int num = variant["tp"]; string text = variant["cardid"]; Variant variant2 = variant["reward"]; bool flag4 = variant2.ContainsKey("money"); if (flag4) { flytxt.instance.fly("金币+ " + variant2["money"], 0, default(Color), null); } bool flag5 = variant2.ContainsKey("yb"); if (flag5) { flytxt.instance.fly("钻石+ " + variant2["yb"], 0, default(Color), null); } bool flag6 = variant2.ContainsKey("bndyb"); if (flag6) { flytxt.instance.fly("绑定钻石+ " + variant2["bndyb"], 0, default(Color), null); } bool flag7 = variant2.ContainsKey("itm"); if (flag7) { List <Variant> arr = variant2["itm"]._arr; for (int i = 0; i < arr.Count; i++) { a3_ItemData itemDataById = ModelBase <a3_BagModel> .getInstance().getItemDataById(arr[i]["tpid"]); string colorStrByQuality = Globle.getColorStrByQuality(itemDataById.item_name, itemDataById.quality); flytxt.instance.fly("获得" + colorStrByQuality + "+" + arr[i]["cnt"], 0, default(Color), null); } } } bool flag8 = d.ContainsKey("cards"); if (flag8) { List <Variant> arr2 = d["cards"]._arr; for (int j = 0; j < arr2.Count; j++) { int num2 = arr2[j]["tp"]; string text2 = arr2[j]["cardid"]; bool flag9 = num2 == 4; if (flag9) { } } } bool flag10 = d.ContainsKey("tpawds"); if (flag10) { List <Variant> arr3 = d["tpawds"]._arr; for (int k = 0; k < arr3.Count; k++) { GiftCardType giftCardType = new GiftCardType(); giftCardType.init(arr3[k]); HttpAppMgr.instance.giftCard.addGiftType(giftCardType); } } HttpAppMgr.instance.giftCard.getAllCode(); } } }
private void onItemCardInfo(Variant d) { if (d.ContainsKey("tp"))//兑换完奖励 { HttpAppMgr.instance.onGetRewardItems(d["tp"]); return; } if (d.ContainsKey("tpchange"))//兑换码变化 { int sec = ConfigUtil.getRandom(0, 20); DelayDoManager.singleton.AddDelayDo(() => { sendLoadItemCardInfo(); }, sec); debug.Log("兑换码后台发生变!!!间隔发送请求礼品卡:" + sec); return; } if (d.ContainsKey("card_fetch")) { Variant card_fetch = d["card_fetch"]; int tp = card_fetch["tp"]; string cardid = card_fetch["cardid"]; Variant reward = card_fetch["reward"]; if (reward.ContainsKey("money")) { flytxt.instance.fly(ContMgr.getCont("comm_moneyadd") + reward["money"]); } if (reward.ContainsKey("yb")) { flytxt.instance.fly(ContMgr.getCont("comm_zuanshiadd") + reward["yb"]); } if (reward.ContainsKey("bndyb")) { flytxt.instance.fly(ContMgr.getCont("comm_bangzuanadd") + reward["bndyb"]); } if (reward.ContainsKey("itm")) { List <Variant> tpawds = reward["itm"]._arr; for (int i = 0; i < tpawds.Count; i++) { a3_ItemData one = a3_BagModel.getInstance().getItemDataById(tpawds[i]["tpid"]); string name = Globle.getColorStrByQuality(one.item_name, one.quality); flytxt.instance.fly(ContMgr.getCont("comm_get") + name + "+" + tpawds[i]["cnt"]); } } } //if (d.ContainsKey("fetched_cards")) //{ // Variant fetched_cards = d["fetched_cards"]; // int tp = fetched_cards["tp"]; // int tm = fetched_cards["tm"];//时间戳 //} if (d.ContainsKey("cards")) { List <Variant> cardsa = d["cards"]._arr; for (int i = 0; i < cardsa.Count; i++) { int tpa = cardsa[i]["tp"]; string cardida = cardsa[i]["cardid"]; if (tpa == 4) {//补偿卡礼包通过邮件领取 } } } if (d.ContainsKey("tpawds")) { List <Variant> tpawds = d["tpawds"]._arr; for (int i = 0; i < tpawds.Count; i++) { GiftCardType giftType = new GiftCardType(); giftType.init(tpawds[i]); HttpAppMgr.instance.giftCard.addGiftType(giftType); } } HttpAppMgr.instance.giftCard.getAllCode(); //if (d.ContainsKey("tpawds")) //{ // List<Variant> l = d["tpawds"]; // for (int i = 0; i < l.Count; i++) // { // } //} }
public static void play1(string id, Vector3 pos, int num, bool criatk = false, int type = -1) { bool flag = FightText.offsetPos == null; if (flag) { FightText.offsetPos = new List <Vector3>(); for (int i = 0; i < 20; i++) { Vector3 item = new Vector3((float)ConfigUtil.getRandom(-30, 30), (float)ConfigUtil.getRandom(-30, 10), 0f); FightText.offsetPos.Add(item); } } bool flag2 = FightText.instacne == null; if (flag2) { FightText.instacne = GameObject.Find("fightText").transform; FightText.process = new TickItem(new Action <float>(FightText.onUpdate)); TickMgr.instance.addTick(FightText.process); FightText.mousePointCon = GameObject.Find("mouseTouchAni").transform; InterfaceMgr.setUntouchable(FightText.mousePointCon.gameObject); } GameObject original = Resources.Load(id) as GameObject; GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original); bool flag3 = type != -1; if (flag3) { Sprite sprite = Resources.Load("icon/rune_fight/" + type, typeof(Sprite)) as Sprite; bool flag4 = sprite != null; if (flag4) { gameObject.transform.FindChild("Text/Image").GetComponent <Image>().sprite = sprite; } } FightTextTempSC fightTextTempSC = gameObject.GetComponent <FightTextTempSC>(); bool flag5 = fightTextTempSC == null; if (flag5) { fightTextTempSC = gameObject.AddComponent <FightTextTempSC>(); } bool flag6 = id == FightText.MOUSE_POINT || id == FightText.MISS_TEXT; if (flag6) { gameObject.transform.SetParent(FightText.instacne, false); fightTextTempSC.init(FightTextTempSC.TYPE_ANI); } else { gameObject.transform.SetParent(FightText.instacne, false); fightTextTempSC.init(FightTextTempSC.TYPE_TEXT); } fightTextTempSC.play(pos + ((id == FightText.MOUSE_POINT) ? Vector3.zero : FightText.offsetPos[FightText.posIdx]), num, criatk); FightText.posIdx++; bool flag7 = FightText.posIdx >= 20; if (flag7) { FightText.posIdx = 0; } }
private Variant transTmchks(Variant tmchks) { Variant transArr = new Variant(); if (tmchks != null) { foreach (Variant tmchk in tmchks._arr) { Variant temp = new Variant(); if (tmchk.ContainsKey("dtb")) { string dtb = tmchk["dtb"]._str; //for (int j = 0; j < dtb.Length; j++) //{ // int index = dtb.IndexOf(":", 0); // if (-1 == index) // break; // List<string> dtba = new List<string>(); // dtba.Add(dtb.Substring(0, index)); // //Variant dtba = dtb.split(":"); // Variant data = new Variant(); // data["h"] = Convert.ToInt32(dtba[0]); // data["min"] = Convert.ToInt32(dtba[1]); // data["s"] = Convert.ToInt32(dtba[2]); // temp["dtb"] = data; //} //Variant dtba = dtb.split(":"); Variant data = new Variant(); Variant dtba = GameTools.split(dtb, ":", GameConstantDef.SPLIT_TYPE_STRING); data["h"] = dtba[0]; // Convert.ToInt32(dtba[0]); data["min"] = dtba[1]; //Convert.ToInt32(dtba[1]); data["s"] = dtba[2]; //Convert.ToInt32(dtba[2]); temp["dtb"] = data; //temp["dtb"] = {h:int(dtba[0]),min:int(dtba[1]),s:int(dtba[2])}; } if (tmchk.ContainsKey("dte")) { string dte = tmchk["dte"]._str; Variant dtea = GameTools.split(dte, ":", GameConstantDef.SPLIT_TYPE_STRING); //Variant dtea = dte.split(":"); //待测试 Variant data = new Variant(); data["h"] = dtea[0]; //Convert.ToInt32(dtea[0]); data["min"] = dtea[1]; //Convert.ToInt32(dtea[1]); data["s"] = dtea[2]; // Convert.ToInt32(dtea[2]); temp["dte"] = data; //temp.dte = {h:int(dtea[0]),min:int(dtea[1]),s:int(dtea[2])}; } if (tmchk.ContainsKey("optm")) { temp["optm"] = tmchk["optm"]; } if (tmchk.ContainsKey("cltm")) { temp["cltm"] = tmchk["cltm"]; } if (tmchk.ContainsKey("cb_optm")) { temp["cb_optm"] = tmchk["cb_optm"]; } if (tmchk.ContainsKey("cb_cltm")) { temp["cb_cltm"] = tmchk["cb_cltm"]; } if (tmchk.ContainsKey("tb")) { temp["tb"] = ConfigUtil.GetTmchkAbs(tmchk["tb"]); } if (tmchk.ContainsKey("te")) { temp["te"] = ConfigUtil.GetTmchkAbs(tmchk["te"]); } if (tmchk.ContainsKey("type")) { temp["type"] = tmchk["type"]; } if (null == transArr) { transArr = new Variant(); } transArr._arr.Add(temp); } } return(transArr); }