Ejemplo n.º 1
0
    bool BackCheckMobileLogin(uint _msgType, UMessage _ms)
    {
        //1获取成功
        // 2改账号已经有绑定手机
        // 3该手机号已经绑定账号
        byte nState = _ms.ReadByte();

        if (nState == 1)
        {
            Debug.Log("该手机号没有绑定任何号");
        }
        else if (nState == 2)
        {
            //Debug.Log("该账号已经有绑定手机");
            CCustomDialog.OpenCustomConfirmUI(1009);
        }
        else if (nState == 3)
        {
            Debug.Log("该手机号已经绑定账号");
            CCustomDialog.OpenCustomConfirmUI(1005);
            PlayerInfoUI.Instance.HandleBindMobileResult(false);
        }

        return(true);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 兑换钻石消息
    /// </summary>
    bool BackDiamondCashToDiamond(uint _msgType, UMessage _ms)
    {
        byte state = _ms.ReadByte();

        if (state == 1)
        {
            if (DiamondOkButton)
            {
                DiamondOkButton.interactable = true;
            }
            CCustomDialog.OpenCustomConfirmUI(1508);
            return(false);
        }

        if (RedBagInputField)
        {
            RedBagInputField.text = string.Empty;
        }
        if (DiamondOkButton)
        {
            DiamondOkButton.interactable = false;
        }
        CCustomDialog.OpenCustomConfirmUI(1507);
        return(true);
    }
Ejemplo n.º 3
0
    //创建比赛
    private void OnCreateContest()
    {
        CustomAudio.GetInstance().PlayCustomAudio(1002);

        if (selfcreateNumber_ >= 10)
        {
            CCustomDialog.OpenCustomConfirmUI(1651);
            return;
        }

        byte gameid = SelfContestDataManager.instance().gameid;
        int  power  = SelfContestDataManager.instance().selfcontestcsvs[gameid].datas[0];
        int  level  = SelfContestDataManager.instance().selfcontestcsvs[gameid].datas[playtimesindex_];

        int pay4appointment = power * level;

        if (GameMain.hall_.GetPlayerData().GetDiamond() + GameMain.hall_.GetPlayerData().GetCoin() < pay4appointment)
        {
            CCustomDialog.OpenCustomConfirmUI(1501);
            return;
        }

        UMessage createContestDataMsg = new UMessage((uint)GameCity.EMSG_ENUM.Contestmsg_PlayerCreateContestRequest);

        createContestDataMsg.Add(GameMain.hall_.GetPlayerId());
        createContestDataMsg.Add(SelfContestDataManager.instance().gamedataid);
        createContestDataMsg.Add(scr_.playernumber);
        createContestDataMsg.Add(scr_.cost);
        createContestDataMsg.Add(scr_.precontest);
        createContestDataMsg.Add(scr_.finalcontest);

        Debug.Log(" 比赛游戏:" + SelfContestDataManager.instance().gamedataid + " 比赛人数:" + scr_.playernumber + " 报名费:" + scr_.cost + "预赛场数:" + scr_.precontest + " 决赛场数" + scr_.finalcontest);

        if (rulepanel2_ == null)
        {
            createContestDataMsg.Add((uint)0);
        }
        else
        {
            if (!rulepanel2_.activeSelf)
            {
                createContestDataMsg.Add((uint)0);
            }
            else
            {
                createContestDataMsg.Add(scr_.timeseconds);
            }
        }

        NetWorkClient.GetInstance().SendMsg(createContestDataMsg);

        UnityEngine.Transform groupTransform = rulepanel1_ ? rulepanel1_.transform : rulepanel2_.transform;
        groupTransform.Find("Right/ImageBG/Button_chuangjian").GetComponent <Button>().interactable   = false;
        groupTransform.Find("Right/ImageBG/Button_chuangjian_0").GetComponent <Button>().interactable = false;
    }
Ejemplo n.º 4
0
    //玩家支付订单信息处理
    private bool PlayerTradeAppPayInfo(uint msgType, UMessage umsg)
    {
        uint   playerid     = umsg.ReadUInt();
        byte   payplatform  = umsg.ReadByte();
        string paytradeInfo = umsg.ReadString();

        Debug.Log("玩家:" + playerid + "订单:" + paytradeInfo);

        //订单信息过来后就可以关闭购买等待框了
        BuyEnd();

        if (payplatform == (byte)PayPlatform.AliPay)
        {
#if UNITY_ANDROID
            AlipayWeChatPay.RequestAliPay(paytradeInfo, false);
#elif UNITY_IOS
            WechatPlatfrom_IOS.MayunJieZhang_IOS(paytradeInfo);
#endif
        }
        else if (payplatform == (byte)PayPlatform.Wechat)
        {
            string noncestr = umsg.ReadString();
#if UNITY_ANDROID
            if (AlipayWeChatPay.IsWxAppInstalled())
            {
                AlipayWeChatPay.ReqWxPay(paytradeInfo, noncestr);
            }
            else
            {
                //还末安装微信失败处理
                // BuyEnd();
                CCustomDialog.OpenCustomConfirmUI(1010);
            }
#elif UNITY_IOS
            if (WechatPlatfrom_IOS.WeChat_IsWXAppInstalled())
            {
                WechatPlatfrom_IOS.WXLgoinJieZhang_IOS(paytradeInfo, noncestr);
            }
            else
            {
                //还末安装微信失败处理
                //BuyEnd();
                CCustomDialog.OpenCustomConfirmUI(1010);
            }
#endif
        }
        else if (payplatform == (byte)PayPlatform.vvPay_Wechat || payplatform == (byte)PayPlatform.vvPay_Alipay)
        {
            Application.OpenURL(paytradeInfo);
        }

        return(true);
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 获取验证码
    /// </summary>
    void OnBtn_GetCode(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            if (CanvasObj == null)
            {
                CanvasObj = GameObject.Find("Canvas/Root");
            }

            InputField PhonePanel = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin")
                                    .Find("InputField_PhoneNum").gameObject.GetComponent <InputField>();

            long phonenum = 0;
            if (!long.TryParse(PhonePanel.text, out phonenum))
            {
                CCustomDialog.OpenCustomConfirmUI(1003);
                return;
            }

            if (!GameCommon.CheckPhoneIsAble(PhonePanel.text))
            {
                CCustomDialog.OpenCustomConfirmUI(1003);
                return;
            }

            if (phonenum > 0)
            {
                if (!NetWorkClient.GetInstance().IsSocketConnected)
                {
                    HallMain.ConnectLoginServer();
                }
                SendApplyGetCode(phonenum, 1);

                //if(MobileCodeTimer == null)
                MobileCodeTimer = new CTimerPersecondCall(60f, UpdataGetCodeBtnText);
                xTimeManger.Instance.RegisterTimer(MobileCodeTimer);

                GameObject PhoneLogin = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin").gameObject;
                if (null != PhoneLogin)
                {
                    Button btn    = PhoneLogin.transform.Find("Button_GetCode").gameObject.GetComponent <Button>();
                    Image  btnimg = PhoneLogin.transform.Find("Button_GetCode").gameObject.GetComponent <Image>();
                    btn.interactable     = false;
                    btnimg.raycastTarget = false;

                    Text strCode = PhoneLogin.transform.Find("Button_GetCode").Find("Text_GetCode").gameObject.GetComponent <Text>();
                    strCode.text = "60S可重新获取";
                }
            }
        }
    }
Ejemplo n.º 6
0
 /// <summary>
 /// 顶号处理
 /// </summary>
 /// <param name="_msgType"></param>
 /// <param name="_ms"></param>
 /// <returns></returns>
 bool ServerCutConnect(uint _msgType, UMessage _ms)
 {
     //清除本地保存的绑定账号
     BindMobileAccountId = 0;
     WriteAccountConfig(false);
     HallMain.bDisconnectReconnection = true;//切断重连机制
     CCustomDialog.OpenCustomConfirmUI(1015, (p) =>
     {
         GameMain.hall_.AnyWhereBackToLoginUI();
     });
     return(false);
 }
Ejemplo n.º 7
0
    private bool LoginFailed2(uint _msgType, UMessage _ms)
    {
        byte errState = _ms.ReadByte();

        switch (errState)
        {
        //被封号
        case 1:
        {
            CCustomDialog.OpenCustomConfirmUI(1023);
        }
        break;
        }
        return(true);
    }
Ejemplo n.º 8
0
    /// <summary>
    /// 登陆失败返回消息处理
    /// </summary>
    /// <param name="_msgType"></param>
    /// <param name="_ms"></param>
    /// <returns></returns>
    private bool LoginFailed(uint _msgType, UMessage _ms)
    {
        CCustomDialog.CloseCustomWaitUI();
        byte errState = _ms.ReadByte();

        switch (errState)
        {
        //app版本不符
        case 1:
        {
            CCustomDialog.OpenCustomConfirmUI(1019);
        }
        break;
        }
        return(true);
    }
Ejemplo n.º 9
0
    void OnClickCDKey()
    {
        Transform  tfm   = OldPlayerTfm.Find("ImageBG/cdkey/InputField");
        InputField field = tfm.GetComponent <InputField>();

        if (field.text.Length != 6)
        {
            CCustomDialog.OpenCustomConfirmUI(1402);
            return;
        }
        UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_CM_PLAYERAPPLYBINDINVITE);

        msg.Add(GameMain.hall_.GetPlayerId());
        msg.Add(field.text);
        NetWorkClient.GetInstance().SendMsg(msg);
    }
Ejemplo n.º 10
0
    /// <summary>
    /// 开始手机登陆
    /// </summary>
    void OnBtn_StartPhoneLogin(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype != EventTriggerType.PointerClick)
        {
            return;
        }

        if (CanvasObj == null)
        {
            CanvasObj = GameObject.Find("Canvas/Root");
        }

        //检测是否同意协议
        Toggle agreementToggle = CanvasObj.transform.Find("Login").Find("Toggle_agreement")
                                 .gameObject.GetComponent <Toggle>();

        if (!agreementToggle.isOn)
        {
            CCustomDialog.OpenCustomConfirmUI(1007);
            return;
        }

        InputField CodePanel = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin").Find("InputField_Code").gameObject.GetComponent <InputField>();

        uint nCode = 0;

        if (!uint.TryParse(CodePanel.text, out nCode))
        {
            CCustomDialog.OpenCustomConfirmUI(1002);
            return;
        }

        if (nCode > 0)
        {
            SendCodeApplyLogin(nCode, 1);

            GameObject rtnBtn = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin").Find("Button_Return").gameObject;
            rtnBtn.GetComponent <Image>().raycastTarget = false;
            rtnBtn.GetComponent <Button>().interactable = false;

            GameObject loginBtn = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin").Find("Button_FinishLogin").gameObject;
            loginBtn.GetComponent <Image>().raycastTarget = false;
            loginBtn.GetComponent <Button>().interactable = false;
        }
        CanvasObj.transform.Find("Login").gameObject.SetActive(false);
    }
Ejemplo n.º 11
0
    void OnBuyNewComer(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerUp)
        {
            uint ui2csvindex = (uint)button;
            if (ui2csvindex == 4)
            {
                ui2csvindex = 0;
            }
            currentNewComerItem = ui2csvindex + 40000;
            int  newcomerInfo = GameMain.hall_.GetPlayerData().newcomerGift;
            bool isbuy        = GameKind.HasFlag((int)currentNewComerItem - 40000, newcomerInfo);
            if (isbuy)
            {
                CCustomDialog.OpenCustomConfirmUI(1109);
                return;
            }
            else
            {
                if ((int)currentNewComerItem - 40000 == 0)
                {
                    bool buyother1 = GameKind.HasFlag(1, newcomerInfo);
                    bool buyother2 = GameKind.HasFlag(2, newcomerInfo);
                    bool buyother3 = GameKind.HasFlag(3, newcomerInfo);
                    if (buyother1 || buyother2 || buyother3)
                    {
                        CCustomDialog.OpenCustomConfirmUI(1109);
                        return;
                    }
                }
                else
                {
                    bool buyother4 = GameKind.HasFlag(0, newcomerInfo);
                    if (buyother4)
                    {
                        CCustomDialog.OpenCustomConfirmUI(1109);
                        return;
                    }
                }

                DoBuyByItemID(currentNewComerItem);
            }
        }
    }
Ejemplo n.º 12
0
    bool BackCheckIndentfying(uint _msgType, UMessage _ms)
    {
        byte nState = _ms.ReadByte();

        if ((nState % 10) == 0)
        {
            //检测失败
            if ((nState / 10) == 0)
            {
                CanvasObj.transform.Find("Login").gameObject.SetActive(true);

                GameObject rtnBtn = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin").Find("Button_Return").gameObject;
                rtnBtn.GetComponent <Image>().raycastTarget = true;
                rtnBtn.GetComponent <Button>().interactable = true;

                GameObject loginBtn = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin").Find("Button_FinishLogin").gameObject;
                loginBtn.GetComponent <Image>().raycastTarget = true;
                loginBtn.GetComponent <Button>().interactable = true;
            }

            CCustomDialog.OpenCustomConfirmUI(1002);
        }
        else
        {
            long nMobile = _ms.ReadLong();
            GameMain.hall_.GetPlayerData().SetBindPhoneNumber(nMobile);
            BindMobileAccountId = GameMain.hall_.GetPlayerId();
            WriteAccountConfig(false);
            //直接手机号登陆不提示绑定成功
            if (nState == 11)
            {
                CCustomDialog.OpenCustomConfirmUI(1012);
                PlayerInfoUI.Instance.HandleBindMobileResult(true);
            }
            else
            {
                MobileCodeTimer.SetDeleteFlag(true);
            }

            Debug.Log("验证码验证成功!登陆游戏!" + nMobile.ToString());
        }

        return(true);
    }
Ejemplo n.º 13
0
    public void OnAnswer(byte result, byte state, byte pos)
    {
        if (result == 0)
        {
            switch (state)
            {
            case 1:    //停叫
            case 5:    //投降
                OnQuitTurn(state);
                break;

            case 2:    //加倍
                OnDouble(pos);
                break;

            case 3:    //要牌
                break;

            case 4:    //分牌
                OnSplitBegin();
                return;

            default:    //fail
                OnTurn(-1.0f);
                break;
            }

            UpdateInfoUI();
        }
        else
        {
            if (state == 4)
            {
                CCustomDialog.OpenCustomConfirmUI(2220);
                m_bCanSplit = false;
            }

            m_BjGameBase.UpdatePlayerUI(this);
            ShowTimeImg(true, 0f);
        }

        StopAsk();
    }
Ejemplo n.º 14
0
    /// 处理绑定邀请码的回复
    private bool HandlePlayerSetInviteCode(uint _msgType, UMessage _ms)
    {
        byte isSuccess = _ms.ReadByte();

        if (isSuccess == 0)
        {
            PlayerData playerdata = GameMain.hall_.GetPlayerData();
            playerdata.nIsBindInvite = 100;
            uint userid = _ms.ReadUInt();
            playerdata.nTodayAward    = _ms.ReadUInt();
            playerdata.nTomorrowAward = _ms.ReadUInt();
            SetupOldPlayer();
        }
        else//1:already 2:used 3:none
        {
            CCustomDialog.OpenCustomConfirmUI((uint)1399 + isSuccess);
        }
        return(true);
    }
Ejemplo n.º 15
0
    bool BackMailGetReward(uint _msgType, UMessage msg)
    {
        byte state = msg.ReadByte();

        if (state == 0) //没找到邮件
        {
            CCustomDialog.OpenCustomConfirmUI(1703);
            return(false);
        }
        else if (state == 1)
        {
            CCustomDialog.OpenCustomConfirmUI(1702);
        }

        uint mailid = msg.ReadUInt();

        if (emailobjects_.ContainsKey(mailid))
        {
            GameMain.safeDeleteObj(emailobjects_[mailid]);
            emailobjects_.Remove(mailid);
        }

        if (EmailDataManager.GetNewsInstance().emilsdata_.ContainsKey(mailid))
        {
            EmailDataManager.GetNewsInstance().emilsdata_.Remove(mailid);
            SetNoMailUI();
        }

        if (m_MailinfoTransform)
        {
            m_MailinfoTransform.Find("ImageBG/Button_lingqu").GetComponent <Button>().interactable  = true;
            m_MailinfoTransform.Find("ImageBG/Button_queding").GetComponent <Button>().interactable = true;
            m_MailinfoTransform.gameObject.SetActive(false);
        }

        //if(GameMain.hall_.contestui_ != null)
        //    GameMain.hall_.contestui_.transform.FindChild("Panelbottom/Bottom/Button_News/ImageSpot").gameObject.SetActive(EmailDataManager.GetNewsInstance().emilsdata_.Count > 0);
        GameMain.hall_.GetPlayerData().mailNumber -= 1;
        GameMain.hall_.m_Bulletin.OnEmailChange(EmailDataManager.GetNewsInstance().emilsdata_.Count <= 0);

        return(true);
    }
Ejemplo n.º 16
0
    //请求购买物品(奖券兑换京东卡,手机充值卡)
    public bool RequestBuyItem(uint itemId, string consigneePhone, string consigneeName = null, string consigneeAddr = null)
    {
        ShopItemdata itemdata = CCsvDataManager.Instance.ShopItemDataMgr.GetShopItemData(itemId);

        if (itemdata == null)
        {
            return(false);
        }
        if (bBuyingProcess)
        {
            Debug.LogWarning("当前正处于购买过程中。。。。");
            return(false);
        }
        iBuyingItemId  = itemId;
        bBuyingProcess = true;

        CCustomDialog.OpenCustomWaitUI(1107);
        switch (itemdata.ItemType)
        {
        case Shop.ITEMTYPE.ITEMTYPE_JINGDONG:
        case Shop.ITEMTYPE.ITEMTYPE_MOBILE:
        {
            //判断奖券是否足够
            if (playerData.GetLottery() < itemdata.ItemPrice)
            {
                BuyEnd();
                CCustomDialog.OpenCustomConfirmUI(1103);
            }
            else
            {
                SendBuyReq(itemdata.ItemID, consigneePhone, consigneeName, consigneeAddr);
            }
        }
        break;

        case Shop.ITEMTYPE.ITEMTYPE_GOODS:
            SendBuyReq(itemdata.ItemID, consigneePhone, consigneeName, consigneeAddr);
            break;
        }
        return(true);
    }
Ejemplo n.º 17
0
    void OnBuyDiscounts(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerUp)
        {
            GameObject buttonBuy = discountobj.transform.Find("ImageBG").Find("goodsinfo").Find("Button_buy").gameObject;
            Text       buyTX     = buttonBuy.transform.Find("Text").gameObject.GetComponent <Text>();
            buyTX.text = "购买";

            int  discountInfo = GameMain.hall_.GetPlayerData().discountsGift;
            bool isbuy        = GameKind.HasFlag((int)currentDiscountItem - 50000, discountInfo);
            if (isbuy)
            {
                CCustomDialog.OpenCustomConfirmUI(1110);
                return;
            }
            else
            {
                DoBuyByItemID(currentDiscountItem);
            }
        }
    }
Ejemplo n.º 18
0
    /// <summary>
    /// 检测是否可以发送加入比赛消息
    /// </summary>
    /// <param name="contestid"></param>
    /// <param name="tipShowState"></param>
    /// <returns></returns>
    public bool CheckSendJoinMsg(uint contestid, bool tipShowState = true)
    {
        if (currentPassWord_ != 0)
        {
            if (contestid != currentPassWord_)
            {
                if (tipShowState)
                {
                    CCustomDialog.OpenCustomConfirmUI(1302);
                }
                return(false);
            }
        }

        if (GameMain.hall_.contest != null)
        {
            if (GameMain.hall_.contest.CheckContestInfoListRefreshState() &&
                ContestDataManager.Instance().selfcontestdatas_.Count == 0)
            {
                if (!tipShowState)
                {
                    return(true);
                }
                CCustomDialog.OpenCustomConfirmUI(1610);
                return(false);
            }
        }

        if (!ContestDataManager.Instance().selfcontestdatas_.ContainsKey(contestid))
        {
            if (!tipShowState)
            {
                return(true);
            }
            CCustomDialog.OpenCustomConfirmUI(1610);
            return(false);
        }
        return(true);
    }
Ejemplo n.º 19
0
    /// <summary>
    /// 玩家购买结果消息处理
    /// </summary>
    /// <param name="msgType"></param>
    /// <param name="umsg"></param>
    /// <returns></returns>
    private bool PlayerBuyResultHandle(uint msgType, UMessage umsg)
    {
        uint playerid = umsg.ReadUInt();

        if (playerid == GetPlayerId())
        {
            bBuyingProcess = false;
            uint itemid   = umsg.ReadUInt();
            byte buystate = umsg.ReadByte();

            ShopItemdata itemdata = CCsvDataManager.Instance.ShopItemDataMgr.GetShopItemData(itemid);
            if (itemdata == null)
            {
                return(false);
            }

            //购买钻石时由支付平台返回值处理关闭等待框
            //if(itemdata.ItemType != Shop.ITEMTYPE.ITEMTYPE_DIAMOND)
            CCustomDialog.CloseCustomWaitUI();
#if UKGAME_SDK
            CCustomDialog.CloseCustomWaitUI();
#endif

#if UNITY_EDITOR || WINDOWS_GUEST
            //编辑器模式下购买钻石没有支付平台返回结果
            if (itemdata.ItemType == Shop.ITEMTYPE.ITEMTYPE_DIAMOND)
            {
                CCustomDialog.CloseCustomWaitUI();
            }
#endif
            if (buystate == 0)
            {
                //京东卡和手机充值
                if (itemdata.ItemType == Shop.ITEMTYPE.ITEMTYPE_JINGDONG ||
                    itemdata.ItemType == Shop.ITEMTYPE.ITEMTYPE_MOBILE ||
                    itemdata.ItemType == Shop.ITEMTYPE.ITEMTYPE_GOODS)
                {
                    string tradeNoId = umsg.ReadString();
                    Bag.GetBagInstance().AddExchangeRecordData(tradeNoId, itemid, 0);
                    Bag.GetBagInstance().SetItemInfoPanelActive(false);
                    CCustomDialog.OpenCustomConfirmUIWithFormatParam(1113, itemdata.ItemName);
                }
                else
                {
                    //GameMain.hall_.shop.OpenBuyResultDialogUI(itemdata.ItemIcon, itemdata.ItemType, itemdata.ItemNum + itemdata.PresentItemNum, 1101);
                    //GameMain.hall_.gift.ShowBuyItemIcon((int)itemdata.ItemID);
                }
            }
            else
            {
                uint tipsID = 0;
                //0表示成功 ,1验证不通过,2购买所需的货币不足,3商品库存不足
                switch (buystate)
                {
                case 1:
                    tipsID = 1104;
                    break;

                case 2:
                {
                    if (itemdata.CurrencyType == Shop.CURRENCYTYPE.CURRENCYTYPE_DIAMOND)
                    {
                        tipsID = 1102;
                    }
                    else if (itemdata.CurrencyType == Shop.CURRENCYTYPE.CURRENCYTYPE_LOTTERY)
                    {
                        tipsID = 1103;
                    }
                    else if (itemdata.CurrencyType == Shop.CURRENCYTYPE.CURRENCYTYPE_GOODS)
                    {
                        tipsID = 1114;
                    }
                }
                break;

                case 3:
                    tipsID = 1105;
                    break;
                }
                CCustomDialog.OpenCustomConfirmUI(tipsID);
            }
        }
        return(true);
    }
Ejemplo n.º 20
0
    //请求购买物品
    public bool RequestBuyItem(uint itemId, PayPlatform tradeplatform = PayPlatform.none)
    {
        ShopItemdata itemdata = CCsvDataManager.Instance.ShopItemDataMgr.GetShopItemData(itemId);

        if (itemdata == null)
        {
            return(false);
        }
        if (bBuyingProcess)
        {
            Debug.LogWarning("当前正处于购买过程中。。。。");
            return(false);
        }
        iBuyingItemId  = itemId;
        bBuyingProcess = true;

        CCustomDialog.OpenCustomWaitUI(1107);
        switch (itemdata.ItemType)
        {
        case Shop.ITEMTYPE.ITEMTYPE_DIAMOND:
        {
            //苹果平台
            if (tradeplatform == PayPlatform.Apple)
            {
#if UNITY_IOS
                ApplePay.Instance.BuyItem(itemId.ToString());
#endif
            }
            else if (tradeplatform == PayPlatform.none)
            {
                //SendBuyReq(itemdata.ItemID, PayPlatform.Wechat);
                //发个假的票据
                Player.SendBuyReceiptToServer(tradeplatform, "this is fake receipt!");
            }
            else
            {
                SendBuyReq(itemdata.ItemID, tradeplatform);
            }
        }
        break;

        case Shop.ITEMTYPE.ITEMTYPE_COIN:
        {
            //判断钻石是否足够
            if (itemdata.CurrencyType == Shop.CURRENCYTYPE.CURRENCYTYPE_DIAMOND)
            {
                if (playerData.GetDiamond() < itemdata.ItemPrice)
                {
                    BuyEnd();
                    CCustomDialog.OpenCustomConfirmUI(1102);
                }
                else
                {
                    SendBuyReq(itemdata.ItemID);
                }
            }
            else if (itemdata.CurrencyType == Shop.CURRENCYTYPE.CURRENCYTYPE_LOTTERY)
            {
                //判断奖券是否足够
                if (playerData.GetLottery() < itemdata.ItemPrice)
                {
                    BuyEnd();
                    CCustomDialog.OpenCustomConfirmUI(1103);
                }
                else
                {
                    SendBuyReq(itemdata.ItemID);
                }
            }
        }
        break;

        default:
            //发个假的票据
            Player.SendBuyReceiptToServer(tradeplatform, "this is fake receipt!");
            break;
        }

        return(true);
    }
Ejemplo n.º 21
0
    bool BackSelfCreateContest(uint msgType, UMessage msg)
    {
        stContestData data = new stContestData();

        byte state = msg.ReadByte();

        if (state == 0)
        {
            CCustomDialog.OpenCustomConfirmUI(1106);
            return(false);
        }
        else
        {
            CRollTextUI.Instance.AddVerticalRollText(1202);
        }

        data.createid = msg.ReadUInt();

        data.nContestID        = msg.ReadUInt();
        data.nContestDataID    = msg.ReadUInt();
        data.sContestName      = ContestDataManager.Instance().contestData[data.nContestDataID].sContestName;
        data.byGameID          = ContestDataManager.Instance().contestData[data.nContestDataID].byGameID;
        data.nGamePlayerNum    = msg.ReaduShort();
        data.tStartTimeSeconds = msg.ReadUInt();
        ContestDataManager.Instance().contestData[data.nContestDataID].tStartTimeSeconds = data.tStartTimeSeconds;
        data.contestState = (CONTEST_STATE)(msg.ReadByte());
        ushort temp = 0;

        temp = msg.ReaduShort();
        data.nMaxEnrollPlayerNum = temp;
        data.nEnrollRechargeCoin = msg.ReaduShort();
        data.createName          = GameMain.hall_.GetPlayerData().GetPlayerName();


        data.nRewardDataID = ContestDataManager.Instance().contestData[data.nContestDataID].nRewardDataID;
        data.enContestType = ContestDataManager.Instance().contestData[data.nContestDataID].enContestType;
        if (data.enContestType == ContestType.ContestType_AnyTime)
        {
            data.contestState = CONTEST_STATE.CONTEST_STATE_ENROLL;
        }
        data.enContestKind      = ContestDataManager.Instance().contestData[data.nContestDataID].enContestKind;
        data.enOrganisersType   = ContestDataManager.Instance().contestData[data.nContestDataID].enOrganisersType;
        data.enContestOpenCycle = ContestDataManager.Instance().contestData[data.nContestDataID].enContestOpenCycle;
        data.vecContestDate     = ContestDataManager.Instance().contestData[data.nContestDataID].vecContestDate;
        data.vecAdmissionHour   = ContestDataManager.Instance().contestData[data.nContestDataID].vecAdmissionHour;
        data.vecContestHour     = ContestDataManager.Instance().contestData[data.nContestDataID].vecContestHour;
        data.nExhibitionTime    = ContestDataManager.Instance().contestData[data.nContestDataID].nExhibitionTime;
        data.nEnrollStartTime   = ContestDataManager.Instance().contestData[data.nContestDataID].nEnrollStartTime;
        //data.nMaxEnrollPlayerNum = ContestDataManager.Instance().contestData[data.nContestDataID].nMaxEnrollPlayerNum;
        data.nMinEnrollPlayerNum      = ContestDataManager.Instance().contestData[data.nContestDataID].nMinEnrollPlayerNum;
        data.nEnrollReputationMiniNum = ContestDataManager.Instance().contestData[data.nContestDataID].nEnrollReputationMiniNum;
        data.nEnrollMasterMiniNum     = ContestDataManager.Instance().contestData[data.nContestDataID].nEnrollMasterMiniNum;
        data.nEnrollNamelistID        = ContestDataManager.Instance().contestData[data.nContestDataID].nEnrollNamelistID;
        data.nEnrollItemID            = ContestDataManager.Instance().contestData[data.nContestDataID].nEnrollItemID;
        data.nEnrollItemNum           = ContestDataManager.Instance().contestData[data.nContestDataID].nEnrollItemNum;
        //data.nEnrollRechargeCoin = 0;// ContestDataManager.Instance().contestData[data.nContestDataID].nEnrollRechargeCoin;
        data.nEnrollMoneyNum            = ContestDataManager.Instance().contestData[data.nContestDataID].nEnrollMoneyNum;
        data.shPreliminaryRuleID        = ContestDataManager.Instance().contestData[data.nContestDataID].shPreliminaryRuleID;
        data.shFinalsRuleID             = ContestDataManager.Instance().contestData[data.nContestDataID].shFinalsRuleID;
        data.nContestBeginBroadcastID   = ContestDataManager.Instance().contestData[data.nContestDataID].nContestBeginBroadcastID;
        data.nChampionBroadcastID       = ContestDataManager.Instance().contestData[data.nContestDataID].nChampionBroadcastID;
        data.nRewardDataID              = ContestDataManager.Instance().contestData[data.nContestDataID].nRewardDataID;
        data.nContestQualificationBuyID = ContestDataManager.Instance().contestData[data.nContestDataID].nContestQualificationBuyID;
        data.iconname           = ContestDataManager.Instance().contestData[data.nContestDataID].iconname;
        data.nContestRule       = ContestDataManager.Instance().contestData[data.nContestDataID].nContestRule;
        data.nContestRuleDetail = ContestDataManager.Instance().contestData[data.nContestDataID].nContestRuleDetail;
        data.playmode           = ContestDataManager.Instance().contestData[data.nContestDataID].playmode;
        data.playmodeicon       = ContestDataManager.Instance().contestData[data.nContestDataID].playmodeicon;
        data.ticketIcon         = ContestDataManager.Instance().contestData[data.nContestDataID].ticketIcon;
        data.resetDetail        = ContestDataManager.Instance().contestData[data.nContestDataID].resetDetail;

        ContestDataManager.Instance().selfcontestdatas_.Add(data.nContestID, data);
        GameMain.hall_.contest.onClickContestType();
        GameMain.hall_.contest.ResetRefreshContestTime();
        selfcreateNumber_ += 1;

        if (rulepanel1_ != null)
        {
            rulepanel1_.SetActive(false);
        }
        if (rulepanel2_ != null)
        {
            rulepanel2_.SetActive(false);
        }

        return(true);
    }
Ejemplo n.º 22
0
    bool HandleEnterDesk(uint _msgType, UMessage _ms)
    {
        if (m_nDeskNum == 0)
        {
            return(false);
        }

        CCustomDialog.CloseCustomWaitUI();

        byte state = _ms.ReadByte();

        if (state > 0)
        {
            if (state == 7)
            {
                //int coin = _ms.ReadInt();
                CCustomDialog.OpenCustomConfirmUI(1652);
            }
            else if (state == 8)//进入旁观
            {
                m_nBystanderRoom = _ms.ReadUInt();
                GameMain.hall_.GameBaseObj.StartLoad();
            }
            else
            {
                uint code = 2005;
                if (state == 6)
                {
                    code = 1704;
                }
                CCustomDialog.OpenCustomConfirmUI(code);
            }
            return(false);
        }

        Dictionary <byte, AppointmentRecordPlayer> players = new Dictionary <byte, AppointmentRecordPlayer>();
        AppointmentRecordPlayer player;
        byte num = _ms.ReadByte();

        for (int i = 0; i < num; i++)
        {
            player = new AppointmentRecordPlayer();
            byte sit = _ms.ReadByte();
            player.playerid   = _ms.ReadUInt();
            player.faceid     = _ms.ReadInt();
            player.url        = _ms.ReadString();
            player.coin       = _ms.ReadLong();
            player.playerName = _ms.ReadString();
            player.master     = _ms.ReadSingle();
            player.sex        = _ms.ReadByte();
            player.ready      = _ms.ReadByte();
            players[sit]      = player;
        }
        byte roomId = _ms.ReadByte();
        uint deskId = _ms.ReadUInt();

        ShowTable(true, players, roomId, deskId);

        GameMain.hall_.GameBaseObj.StartLoad();

        return(true);
    }
Ejemplo n.º 23
0
    bool HandleGameNetMsg(uint _msgType, UMessage _ms)
    {
        if (m_nDeskNum == 0)
        {
            return(false);
        }

        GameCity.EMSG_ENUM eMsg = (GameCity.EMSG_ENUM)_msgType;
        switch (eMsg)
        {
        case GameCity.EMSG_ENUM.CrazyCityMsg_SM_UPDATEENTERROOMANDSITTOREADYALL:
        {
            byte   sit    = _ms.ReadByte();
            uint   userId = _ms.ReadUInt();
            int    faceId = _ms.ReadInt();
            string url    = _ms.ReadString();
            string name   = _ms.ReadString();
            ushort desk   = _ms.ReaduShort();
            m_dictIndexDesks[desk].ShowPlayer(sit, true, name, url, userId, faceId);
        }
        break;

        case GameCity.EMSG_ENUM.CrazyCityMsg_SM_APPLYLEAVEROOMANDSIT:
        {
            sbyte state = _ms.ReadSByte();
            if (state == 0)
            {
                long diamond = _ms.ReadLong();
                OnEnd(diamond);
            }
            else
            {
                CCustomDialog.CloseCustomWaitUI();
                CCustomDialog.OpenCustomConfirmUI(2206);
            }
        }
        break;

        case GameCity.EMSG_ENUM.CrazyCityMsg_SM_UPDATELEAVEROOMANDSIT:
        {
            byte   sit    = _ms.ReadByte();
            uint   userId = _ms.ReadUInt();
            string name   = _ms.ReadString();
            if (sit < m_ChairList.Count)
            {
                m_ChairList[sit].Show(false);
            }
        }
        break;

        case GameCity.EMSG_ENUM.CrazyCityMsg_SM_UPDATELEAVEROOMANDSITTOREADYALL:
        {
            byte sit    = _ms.ReadByte();
            uint deskId = _ms.ReadByte();
            m_dictIndexDesks[deskId].ShowPlayer(sit, false);
        }
        break;

        case GameCity.EMSG_ENUM.CrazyCityMsg_SM_APPLYREADY:
        {
            byte state = _ms.ReadByte();
            if (state == 0)
            {
                byte sit = _ms.ReadByte();
                if (sit < m_ChairList.Count)
                {
                    m_ChairList[sit].SetReady(true);
                }
                ShowKickTip(false);
            }
            else
            {
                TableTfm.Find("bottom/Button_Ready").GetComponent <Button>().interactable = true;
            }
        }
        break;

        case GameCity.EMSG_ENUM.CrazyCityMsg_SM_UPDATEAPPLYREADY:
        {
            byte sit = _ms.ReadByte();
            if (sit < m_ChairList.Count)
            {
                m_ChairList[sit].SetReady(true);
            }
        }
        break;

        case GameCity.EMSG_ENUM.CrazyCityMsg_SM_KICKOUTROOM:
        {
            byte state  = _ms.ReadByte();       //1 长时间不点准备 2 不够入场钱  3 不够台费
            uint tipsID = 2601;
            switch (state)
            {
            case 1:
                tipsID = 1647;
                break;

            case 2:
                tipsID = 1652;
                break;

            case 3:
                tipsID = 1664;
                break;
            }

            CCustomDialog.CloseCustomWaitUI();
            CCustomDialog.OpenCustomConfirmUI(tipsID, (obj) => { OnEnd(); });
        }
        break;

        case GameCity.EMSG_ENUM.CrazyCityMsg_UPDATERECHARGETOROOMSER:
        {
            uint userId  = _ms.ReadUInt();
            uint diamond = _ms.ReadUInt();
            UpdateDiamond(diamond);
        }
        break;

        default:
            break;
        }

        return(true);
    }