示例#1
0
    private void OnSureClickHandler()
    {
        switch (_type)
        {
        case 0:
            NetHttp.inst.Send(NetBase.HTTP_UNLOCK_EXPLORE, "index=" + index, UnlockBox);
            break;

        case 1:
            DateTime overTime = (DateTime)userExplore ["time"];
            long     timetext = (overTime.Ticks - Tools.GetSystemTicks());
            timetext = timetext / 10000 / 1000;
            if (ModelUser.GetCanBuy(Config.ASSET_COIN, Tools.GetCoinByTime(timetext)))
            {
                NetHttp.inst.Send(NetBase.HTTP_OPEN_EXPLORE, "index=" + index, OpenBox);
            }
            break;

        case 2:
            NetHttp.inst.Send(NetBase.HTTP_OPEN_EXPLORE, "index=" + index, OpenBox);
            break;

        case 3:
            timetext = (int)data ["time"];
            if (ModelUser.GetCanBuy(Config.ASSET_COIN, Tools.GetCoinByTime(timetext)))
            {
                NetHttp.inst.Send(NetBase.HTTP_OPEN_EXPLORE, "index=" + index, OpenBox);
            }
            break;
        }
    }
示例#2
0
    private void OnUnLockShip()
    {
//		EffectManager.inst.AddPrefab (Config.EFFECT_UNLOCKSKIN, this.GetChild ("n25").asGraph);
//		return;
        if (userData.ContainsKey(_changeID))
        {
            NetHttp.inst.Send(NetBase.HTTP_USE_BODY, "body_id=" + _changeID, SetBodyNow);
        }
        else
        {
            Dictionary <string, object> shipData = (Dictionary <string, object>)(DataManager.inst.body [_changeID]);
            if (shipData.ContainsKey(Config.ASSET_GOLD))
            {
                if (!ModelUser.GetCanBuy(Config.ASSET_GOLD, (int)shipData [Config.ASSET_GOLD]))
                {
                    return;
                }
            }
            if (shipData.ContainsKey(Config.ASSET_COIN))
            {
                if (!ModelUser.GetCanBuy(Config.ASSET_COIN, (int)shipData [Config.ASSET_COIN]))
                {
                    return;
                }
            }
            NetHttp.inst.Send(NetBase.HTTP_BUY_BODY, "body_id=" + _changeID, OnUnlockBodyHandler);
        }
    }
示例#3
0
 private void OnSureHandler()
 {
     if (ModelUser.GetCanBuy(Config.ASSET_COIN, (int)da [0], "17026"))
     {
         NetHttp.inst.Send(NetBase.HTTP_COIN_BUY_GOLD, "config_id=" + _index, OnBuyGoldHandler);
     }
 }
示例#4
0
 private void OnBuyHandler()
 {
     if (ModelUser.GetCanBuy(Config.ASSET_COIN, ((int)boxCfg ["price"]), "17025"))
     {
         NetHttp.inst.Send(NetBase.HTTP_GET_RANDOM_BOX, "box_id=Lv" + MediatorItemCardGet._index, OnGetCard);
     }
 }
示例#5
0
 private void OnBuyHandler()
 {
     if (ModelUser.GetCanBuy(Config.ASSET_GOLD, pri, "17024"))
     {
         NetHttp.inst.Send(NetBase.HTTP_GET_DAILY_BOX, "", OnGetCard);
     }
 }
 private void OnClickChangeName()
 {
     if (ModelUser.GetCanBuy(Config.ASSET_GOLD, (int)(((Dictionary <string, object>)(DataManager.inst.guild ["society"]))["name_change"]), "20181"))
     {
         ViewManager.inst.ShowView <MediatorChangeGuildName> ();
     }
 }
示例#7
0
    private void OnUpCardHandler()
    {
        CardVo card = DataManager.inst.GetCardVo(CID);

        if (GuideManager.inst.Check("1:2"))
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();
            dic["card_id"]   = CID;
            dic["guide_num"] = 2;
//			GuideManager.inst.Next ();
//			GuideManager.inst.Show (this);
            ModelManager.inst.userModel.SetGuide(2, OnCardLvupHandler, dic);
            return;
        }
        if (ModelUser.GetCanBuy(Config.ASSET_GOLD, card.getUpLevelNeed(), "24129"))
        {
            NetHttp.inst.Send(NetBase.HTTP_CARD_LVUP, "cid=" + CID, OnCardLvupHandler);
        }
    }
 private void GuildCreate()
 {
     if (!ModelUser.GetCanBuy(Config.ASSET_GOLD, (int)(cfg ["society_cost"]), "20182"))
     {
         return;
     }
     if (input.text != "")
     {
         if (FilterManager.inst.Exec(input.text).IndexOf('*') != -1 /*||input.text.IndexOf(" ") != -1*/)
         {
             ViewManager.inst.ShowText(Tools.GetMessageById("20180"));
             return;
         }
         NetHttp.inst.Send(NetBase.HTTP_GUILD_CREATE, "name=" + input.text + "|icon=" + MediatorChangeIcon.iconID + "|location=" + bo_suozaidi.values [bo_suozaidi.selectedIndex].ToString(), GuildCreateHandler);
     }
     else
     {
         ViewManager.inst.ShowText(Tools.GetMessageById("20152"));
     }
 }
示例#9
0
 private void OnBtnClickHandler()
 {
     if (!ModelUser.GetCanBuy(Config.ASSET_GOLD, (int)(((Dictionary <string, object>)(DataManager.inst.guild ["society"])) ["name_change"]), "20181"))
     {
         return;
     }
     if (ModelManager.inst.guildModel.my_guild_info ["name"].ToString() == L_Input.text)
     {
         ViewManager.inst.ShowText(Tools.GetMessageById("20173"));
         return;
     }
     if (L_Input.text != "")
     {
         if (FilterManager.inst.Exec(L_Input.text).IndexOf('*') != -1)
         {
             ViewManager.inst.ShowText(Tools.GetMessageById("20180"));
             return;
         }
         NetHttp.inst.Send(NetBase.HTTP_GUILD_SETUP_CHANGE, "name=" + L_Input.text, OnChangeNameFunction);
     }
 }