Beispiel #1
0
        /// <summary>
        /// 购买物品
        /// </summary>
        private async void BuyItem()
        {
            GetItemInfo info   = new GetItemInfo();
            int         shopId = CommonUtil.splitStr_Start(shopInfo.Items.ToString(), ':');
            int         count  = CommonUtil.splitStr_End(shopInfo.Items.ToString(), ':');

            UINetLoadingComponent.showNetLoading();
            G2C_BuyItem g2cBuyItem = (G2C_BuyItem)await SessionComponent.Instance.
                                     Session.Call(new C2G_BuyItem { UId = PlayerInfoComponent.Instance.uid, ShopId = shopInfo.Id });

            UINetLoadingComponent.closeNetLoading();

            ToastScript.createToast("购买成功");
            GameUtil.changeData(shopId, (int)g2cBuyItem.Count);
            if (g2cBuyItem.ShopType == 2)
            {
                PlayerInfoComponent.Instance.GetPlayerInfo().GoldNum = g2cBuyItem.Wealth;
            }
            if (g2cBuyItem.ShopType == 1)
            {
                PlayerInfoComponent.Instance.GetPlayerInfo().WingNum = g2cBuyItem.Wealth;
            }
            Log.Debug("==" + g2cBuyItem.Wealth);
            Log.Debug("--" + PlayerInfoComponent.Instance.GetPlayerInfo().WingNum);
            Game.Scene.GetComponent <UIComponent>().Get(UIType.UIMain).GetComponent <UIMainComponent>
                ().refreshUI();
            buyTip.SetActive(false);
        }
Beispiel #2
0
        private async void GetWeekReward()
        {
            UINetLoadingComponent.showNetLoading();
            G2C_GetWeekReward g2cWR = (G2C_GetWeekReward)await Game.Scene.GetComponent <SessionComponent>()
                                      .Session.Call(new C2G_GetWeekReward {
                UId = PlayerInfoComponent.Instance.uid, type = curType
            });

            UINetLoadingComponent.closeNetLoading();

            if (g2cWR.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cWR.Message);
                return;
            }
            RewardBtn.gameObject.SetActive(false);
            g2cWeek.IsGetGameRank = g2cWR.IsGetGameRank;
            g2cWeek.IsGetGoldRank = g2cWR.IsGetGoldRank;
            string str = "";

            if (curType == 1)
            {
                str = "2:" + g2cWR.GoldReward;
                //ToastScript.createToast($"领取成功,获得元宝{g2cWR.GoldReward}");
            }
            else if (curType == 2)
            {
                str = "111:" + g2cWR.GameReward;
                /* ToastScript.createToast($"领取成功,获得话费礼包{g2cWR.GameReward}");*/
            }
            ShowRewardUtil.Show(str);
        }
Beispiel #3
0
    public void OnClickBindPhone()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("BindPhoneScript_hotfix", "OnClickBindPhone"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.BindPhoneScript_hotfix", "OnClickBindPhone", null, null);
            return;
        }

        if (string.IsNullOrEmpty(PhoneField.text) || string.IsNullOrEmpty(VerificationCodeField.text))
        {
            ToastScript.createToast("输入的内容不能为空");

            return;
        }
        if (!_isCorrectPhone)
        {
            ToastScript.createToast("请输入正确的手机号");

            return;
        }

        if (!_isCorrectCode)
        {
            ToastScript.createToast("请输入正确的验证码");

            return;
        }

        LogicEnginerScript.Instance.GetComponent <CheckSmsRequest>().CallBack = bindPhoneCallBack;
        LogicEnginerScript.Instance.GetComponent <CheckSmsRequest>().OnRequest(_phoneNum, _verificationCode);
    }
    public void onClickBuy()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("MedalDuiHuanQueRenPanelScript_hotfix", "onClickBuy"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.MedalDuiHuanQueRenPanelScript_hotfix", "onClickBuy", null, null);
            return;
        }

        // 判断是否设置过徽章密码
        {
            if (!UserData.isSetSecondPsw)
            {
                SetSecondPswPanelScript.create();
                ToastScript.createToast("请先设置徽章密码");

                return;
            }
        }

        // 校验徽章密码
        {
            if (!OtherData.s_hasCheckSecondPSW)
            {
                CheckSecondPSWPanelScript.create();

                return;
            }
        }

        buy();
    }
        private async void RequestUseHuaFei(int huafei, int type)
        {
            UINetLoadingComponent.showNetLoading();
            G2C_UseHuaFei g2cUseHuaFei = (G2C_UseHuaFei)await SessionComponent.Instance.Session.Call(new C2G_UseHuaFei { Uid = PlayerInfoComponent.Instance.uid, HuaFei = huafei, Phone = PlayerInfoComponent.Instance.GetPlayerInfo().Phone, Type = type });

            UINetLoadingComponent.closeNetLoading();

            if (g2cUseHuaFei.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cUseHuaFei.Message);

                return;
            }

            GameUtil.changeData(3, -huafei);

            // 兑换话费
            if (type == 1)
            {
                ++HuaFei_5_RestCount;
                ToastScript.createToast((huafei / 100.0f).ToString() + "元话费兑换成功");
            }
            // 兑换元宝
            else if (type == 2)
            {
                ++YuanBao_RestCount;
                GameUtil.changeDataWithStr(g2cUseHuaFei.Reward);
                ShowRewardUtil.Show(g2cUseHuaFei.Reward);
            }

            Button_HuaFei.transform.Find("Text").GetComponent <Text>().text = "兑换 " + HuaFei_5_RestCount + "/1";
            Button_Key.transform.Find("Text").GetComponent <Text>().text    = "兑换 " + YuanBao_RestCount + "/10";
        }
    public void netDataDown()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "netDataDown"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "netDataDown", null, null);
            return;
        }

        // 拉取数值表
        {
            NetLoading.getInstance().Show();

            NetConfig.reqNetConfig();
            PropData.getInstance().reqNet();
            ChatData.getInstance().reqNet();
            HuDongData.getInstance().reqNet();
            SensitiveWordUtil.reqNet();
            VipData.reqNet();
        }

        if (OtherData.s_isTest)
        {
            ToastScript.createToast("这是测试包");
        }
        else
        {
            LogUtil.Log("这是正式包");
        }
    }
    // 请求登录
    public void reqLogin()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "reqLogin"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "reqLogin", null, null);
            return;
        }

        if ((m_inputAccount.text.CompareTo("") == 0) || (m_inputPassword.text.CompareTo("") == 0))
        {
            ToastScript.createToast("请输入账号密码");
            return;
        }

        NetLoading.getInstance().Show();

        {
            JsonData data = new JsonData();

            data["tag"]     = TLJCommon.Consts.Tag_Login;
            data["account"] = m_inputAccount.text;
            string md5 = CommonUtil.GetMD5(m_inputPassword.text);
            LogUtil.Log(md5);
            data["password"]     = md5;
            data["passwordtype"] = 1;

            LoginServiceSocket.s_instance.sendMessage(data.ToJson());
        }
    }
Beispiel #8
0
        public async void OnBindPhone(string phone, string code)
        {
            try
            {
                UINetLoadingComponent.showNetLoading();
                G2C_BindPhone g2cBindPhone = (G2C_BindPhone)await SessionComponent.Instance.Session.Call(new C2G_BindPhone { Uid = PlayerInfoComponent.Instance.uid, Phone = phone, Code = code });

                UINetLoadingComponent.closeNetLoading();

                if (g2cBindPhone.Error != ErrorCode.ERR_Success)
                {
                    ToastScript.createToast(g2cBindPhone.Message);
                    return;
                }

                ToastScript.createToast("绑定手机号成功");
                PlayerInfoComponent.Instance.GetPlayerInfo().Phone = phone;
                if (Game.Scene.GetComponent <UIComponent>().Get(UIType.UIPlayerInfo) != null)
                {
                    Game.Scene.GetComponent <UIComponent>().Get(UIType.UIPlayerInfo).GetComponent <UIPlayerInfoComponent>().Update();
                }
                isSuccess = true;
                Game.Scene.GetComponent <UIComponent>().Remove(UIType.UIBindPhone);
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
    public void realNameCallBack(string result)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("RealNameScript_hotfix", "realNameCallBack"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.RealNameScript_hotfix", "realNameCallBack", null, result);
            return;
        }

        JsonData jsonData = JsonMapper.ToObject(result);
        var      code     = (int)jsonData["code"];

        if (code == (int)Consts.Code.Code_OK)
        {
            UserData.IsRealName = true;
            if (UserInfoScript.Instance != null)
            {
                UserInfoScript.Instance.InitUI();
            }

            ToastScript.createToast("实名认证成功,请去邮箱领取奖励!");

            LogicEnginerScript.Instance.GetComponent <GetEmailRequest>().OnRequest();
            Destroy(this.gameObject);
        }
        else
        {
            ToastScript.createToast("实名认证错误");
        }
    }
Beispiel #10
0
        public void Awake()
        {
            ToastScript.clear();
            initData();

            RequestDailySignState();
        }
Beispiel #11
0
    public static bool checkCanEnterRoom(string gameRoomType)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("GameUtil_hotfix", "checkCanEnterRoom"))
        {
            bool b = (bool)ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.GameUtil_hotfix", "checkCanEnterRoom", null, gameRoomType);
            return(b);
        }

        if (gameRoomType.CompareTo(TLJCommon.Consts.GameRoomType_XiuXian_JingDian_ChuJi) == 0)
        {
            if (UserData.gold < 1500)
            {
                ToastScript.createToast("金币不足1500,请前去购买");
                return(false);
            }
        }
        else if (gameRoomType.CompareTo(TLJCommon.Consts.GameRoomType_XiuXian_JingDian_ZhongJi) == 0)
        {
            if (UserData.gold < 35000)
            {
                ToastScript.createToast("金币不足35000,请前去购买");
                return(false);
            }
        }
        else if (gameRoomType.CompareTo(TLJCommon.Consts.GameRoomType_XiuXian_JingDian_GaoJi) == 0)
        {
            if (UserData.gold < 100000)
            {
                ToastScript.createToast("金币不足100000,请前去购买");
                return(false);
            }
        }
        else if (gameRoomType.CompareTo(TLJCommon.Consts.GameRoomType_XiuXian_ChaoDi_ChuJi) == 0)
        {
            if (UserData.gold < 1500)
            {
                ToastScript.createToast("金币不足1500,请前去购买");
                return(false);
            }
        }
        else if (gameRoomType.CompareTo(TLJCommon.Consts.GameRoomType_XiuXian_ChaoDi_ZhongJi) == 0)
        {
            if (UserData.gold < 35000)
            {
                ToastScript.createToast("金币不足35000,请前去购买");
                return(false);
            }
        }
        else if (gameRoomType.CompareTo(TLJCommon.Consts.GameRoomType_XiuXian_ChaoDi_GaoJi) == 0)
        {
            if (UserData.gold < 100000)
            {
                ToastScript.createToast("金币不足100000,请前去购买");
                return(false);
            }
        }

        return(true);
    }
Beispiel #12
0
        private async void RequestDailySign()
        {
            UINetLoadingComponent.showNetLoading();

            G2C_DailySign g2cDailySign = (G2C_DailySign)await SessionComponent.Instance.Session.Call(new C2G_DailySign { Uid = PlayerInfoComponent.Instance.uid });

            UINetLoadingComponent.closeNetLoading();

            if (g2cDailySign.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cDailySign.Message);

                return;
            }

            string reward = g2cDailySign.Reward;

            GameUtil.changeDataWithStr(reward);

            ShowRewardUtil.Show(reward);

            PlayerInfoComponent.Instance.GetPlayerInfo().IsSign = true;

            {
                Button btn = Item2.transform.Find("Button").GetComponent <Button>();
                btn.interactable = false;
                btn.GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_main", "DayDo_tomorrow");

                string TomorrowReward = g2cDailySign.TomorrowReward;
                int    prop_id        = CommonUtil.splitStr_Start(TomorrowReward, ':');
                int    prop_num       = CommonUtil.splitStr_End(TomorrowReward, ':');
                Item2.transform.Find("Text").GetComponent <Text>().text = ("奖励 <color=#FF8604FF>" + prop_num + "</color>金币");
            }
        }
Beispiel #13
0
    public void onReceive_SetSecondPsw(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("SetSecondPswPanelScript_hotfix", "onReceive_SetSecondPsw"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.SetSecondPswPanelScript_hotfix", "onReceive_SetSecondPsw", null, data);
            return;
        }

        JsonData jd = JsonMapper.ToObject(data);

        int code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            ToastScript.createToast("设置成功");
            UserData.isSetSecondPsw       = true;
            OtherData.s_hasCheckSecondPSW = true;

            Destroy(gameObject);
        }
        else
        {
            ToastScript.createToast("设置失败");
        }
    }
    public void onReceive_ChangeHead(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("ChangeHeadPanelScript_hotfix", "onReceive_ChangeHead"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.ChangeHeadPanelScript_hotfix", "onReceive_ChangeHead", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd = JsonMapper.ToObject(data);

        int code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            //UserData.head = "Sprites/Head/head_" + m_choiceHead;
            UserData.head = "head_" + m_choiceHead;

            OtherData.s_mainScript.refreshUI();
            OtherData.s_userInfoScript.InitUI();

            ToastScript.createToast("修改成功");
        }
        else
        {
            ToastScript.createToast("服务器出错");
        }
    }
Beispiel #15
0
        private async void RequestRealName()
        {
            UINetLoadingComponent.showNetLoading();
            G2C_RealName g2cRealName = (G2C_RealName)await SessionComponent.Instance.Session.Call(new C2G_RealName { Uid = PlayerInfoComponent.Instance.uid, Name = InputField_name.text, IDNumber = InputField_idNumber.text });

            UINetLoadingComponent.closeNetLoading();

            if (g2cRealName.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cRealName.Message);

                return;
            }

            PlayerInfoComponent.Instance.GetPlayerInfo().IsRealName = true;

            GameUtil.changeData(1, 3000);

            ShowRewardUtil.Show("1:3000");

            ToastScript.createToast("认证成功");

            Game.Scene.GetComponent <UIComponent>().Get(UIType.UIPlayerInfo).GetComponent <UIPlayerInfoComponent>().Update();
            Game.Scene.GetComponent <UIComponent>().Remove(UIType.UIRealName);
        }
    public void GetRealName(InputField input)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("RealNameScript_hotfix", "GetRealName"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.RealNameScript_hotfix", "GetRealName", null, input);
            return;
        }

        _isCorrectRealName = VerifyRuleUtil.CheckRealName(input.text);
        bool isSensitiveWord = SensitiveWordUtil.IsSensitiveWord(input.text);

        if (isSensitiveWord)
        {
            _isCorrectRealName = false;
            ToastScript.createToast("您的名字有敏感词");
        }

        if (_isCorrectRealName)
        {
            _realName = input.text;
        }
        else
        {
            ToastScript.createToast("请输入正确的姓名");
        }
    }
Beispiel #17
0
        public override async void Start(UILoadResComponent self)
        {
            // 检测apk更新
            if (true)
            {
                using (UnityWebRequestAsync webRequestAsync = ETModel.ComponentFactory.Create <UnityWebRequestAsync>())
                {
                    await webRequestAsync.DownloadAsync("http://fwdown.hy51v.com/njmj/online/files/versionconfig.json");

                    string data = webRequestAsync.Request.downloadHandler.text;
                    ApkVersionConfig.getInstance().init(data);
                    Log.Debug("channel_name = " + PlatformHelper.GetChannelName());
                    Log.Debug("VersionName = " + PlatformHelper.GetVersionName());
                    VersionInfo versionInfo = ApkVersionConfig.getInstance().getDataById(PlatformHelper.GetChannelName());
                    if (versionInfo != null)
                    {
                        // apk更新
                        if (versionInfo.version.CompareTo(PlatformHelper.GetVersionName()) > 0)
                        {
                            DownApkScript.create();

                            return;
                        }
                    }
                }
            }

            // 取消预加载
            // await LoadRes();

            ToastScript.createToast("加载完毕");

            Game.EventSystem.Run(EventIdType.LoadingFinish);
        }
    public void OnClickRealName()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("RealNameScript_hotfix", "OnClickRealName"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.RealNameScript_hotfix", "OnClickRealName", null, null);
            return;
        }

        if (string.IsNullOrEmpty(RealNameInputField.text) || string.IsNullOrEmpty(IdentificationInputField.text))
        {
            ToastScript.createToast("输入的内容不能为空");

            return;
        }

        if (!_isCorrectRealName)
        {
            ToastScript.createToast("请输入正确的姓名");

            return;
        }

        if (!_isCorrectIdentification)
        {
            ToastScript.createToast("请输入正确的身份证");
            return;
        }

        LogicEnginerScript.Instance.GetComponent <RealNameRequest>().CallBack = realNameCallBack;
        LogicEnginerScript.Instance.GetComponent <RealNameRequest>().OnRequest(_realName, _identification);
    }
    public void onReceive_QuickRegister(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LoginScript_hotfix", "onReceive_QuickRegister"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LoginScript_hotfix", "onReceive_QuickRegister", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd   = JsonMapper.ToObject(data);
        int      code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            string uid = jd["uid"].ToString();

            PlayerPrefs.SetString("account", m_inputAccount_register.text);
            PlayerPrefs.SetString("password", m_inputPassword_register.text);

            UserData.uid = uid;

            SceneManager.LoadScene("MainScene");
        }
        else if (code == (int)TLJCommon.Consts.Code.Code_CommonFail)
        {
            var msg = (string)jd["msg"];
            ToastScript.createToast(msg);
        }
        else
        {
            ToastScript.createToast("服务器内部错误");
        }
    }
        protected override void Run(ETModel.Session session, Actor_ShowAnimType message)
        {
            UI uiRoom = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIRoom);

            if (uiRoom == null)
            {
                return;
            }
            UIRoomComponent roomComponent = uiRoom.GetComponent <UIRoomComponent>();

            Log.Info("显示:" + message.Type);

            try
            {
                switch (message.Type)
                {
                case 1:
                    ToastScript.createToast("扣除服务费:" + message.Count);
                    break;

                case 2:
                case 3:
                    roomComponent.ShowAnim(message.Type);
                    break;

                case 4:
                    break;
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
    public void onReceive_UseLaBa(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("LaBaPanelScript_hotfix", "onReceive_UseLaBa"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.LaBaPanelScript_hotfix", "onReceive_UseLaBa", null, data);
            return;
        }

        JsonData jd   = JsonMapper.ToObject(data);
        int      code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            ToastScript.createToast("使用成功");

            GameUtil.changeData(106, -1);

            if (BagPanelScript.Instance != null)
            {
                BagPanelScript.Instance.UpdateUI();
            }

            Destroy(gameObject);
        }
    }
        private async void GetReward()
        {
            UINetLoadingComponent.showNetLoading();
            G2C_GetTaskReward g2cGet = (G2C_GetTaskReward)await SessionComponent.Instance.Session.Call(new C2G_GetTaskReward { UId = PlayerInfoComponent.Instance.uid, TaskInfo = info, GetType = 2 });

            UINetLoadingComponent.closeNetLoading();

            if (g2cGet.Error != ErrorCode.ERR_Success)
            {
                ToastScript.createToast(g2cGet.Message);
            }
            else
            {
                GameUtil.changeData(1, info.Reward);
                Game.Scene.GetComponent <UIComponent>().Get(UIType.UIMain)
                .GetComponent <UIMainComponent>().refreshUI();

                string str = "1:" + info.Reward;
                ShowRewardUtil.Show(str);
                string icon = new StringBuilder().Append("chengjiu_")
                              .Append(info.Id).ToString();
                Debug.Log("已经领取成就奖励");
                Game.Scene.GetComponent <UIComponent>().Get(UIType.UIChengjiu).GetComponent <UIChengjiuComponent>().DeCount();
                Complete.SetActive(false);
                ChengjiuItemBtn.GetComponent <Image>().sprite =
                    CommonUtil.getSpriteByBundle("uichengjiuicon", icon);
            }
        }
    public void buy()
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("MedalDuiHuanQueRenPanelScript_hotfix", "buy"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.MedalDuiHuanQueRenPanelScript_hotfix", "buy", null, null);
            return;
        }

        int totalPrice = 0;

        totalPrice = m_medalDuiHuanRewardData.price * m_goods_num;

        if (UserData.medal < totalPrice)
        {
            ToastScript.createToast("徽章不足,无法兑换");
            return;
        }

        if (UserData.vipLevel < m_medalDuiHuanRewardData.vipLevel)
        {
            ToastScript.createToast("贵族等级不足,无法兑换");
            return;
        }

        {
            NetLoading.getInstance().Show();

            LogicEnginerScript.Instance.GetComponent <MedalDuiHuanRequest>().goods_id = m_medalDuiHuanRewardData.goods_id;
            LogicEnginerScript.Instance.GetComponent <MedalDuiHuanRequest>().num      = m_goods_num;
            LogicEnginerScript.Instance.GetComponent <MedalDuiHuanRequest>().CallBack = onReceive_BuyGoods;
            LogicEnginerScript.Instance.GetComponent <MedalDuiHuanRequest>().OnRequest();
        }
    }
    public void reqChat_emoji(int id)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("ChatPanelScript_hotfix", "reqChat_emoji"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.ChatPanelScript_hotfix", "reqChat_emoji", null, id);
            return;
        }

        if (m_canChat)
        {
            m_canChat = false;

            if (m_parentScript != null)
            {
                m_parentScript.reqChat(2, id);
            }
            else if (m_parentScript_ddz != null)
            {
                m_parentScript_ddz.m_DDZ_NetReqLogic.reqChat(2, id);
            }
            Invoke("onInvoke", 2);
        }
        else
        {
            ToastScript.createToast("请隔2秒再发送");
        }
    }
Beispiel #25
0
        private void CreateUI(G2C_FriendRoomInfo m2cFriend)
        {
            ScoreTxt.text = m2cFriend.Score.ToString();
            PlayerInfoComponent.Instance.GetPlayerInfo().Score = m2cFriend.Score;

            //今天沒有贈送好友房钥匙
            if (!PlayerInfoComponent.Instance.GetPlayerInfo().IsGiveFriendKey)
            {
                //显示赠送界面
                ToastScript.createToast("每日赠送3把钥匙,仅限当日使用");
                PlayerInfoComponent.Instance.GetPlayerInfo().IsGiveFriendKey = m2cFriend.IsGiveFriendKey;
            }

            PlayerInfoComponent.Instance.GetPlayerInfo().FriendKeyCount = m2cFriend.KeyCount;
            #endregion

            if (m2cFriend.Info.Count <= 0)
            {
                NoRoomTipTxt.SetActive(true);
            }
            else
            {
                NoRoomTipTxt.SetActive(false);
            }
            CreateRoomItemss(m2cFriend.Info);
        }
    public void onReceive_UseProp(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("PropDetailPanelScript_hotfix", "onReceive_UseProp"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.PropDetailPanelScript_hotfix", "onReceive_UseProp", null, data);
            return;
        }

        NetLoading.getInstance().Close();

        JsonData jd   = JsonMapper.ToObject(data);
        int      code = (int)jd["code"];

        if (code == (int)TLJCommon.Consts.Code.Code_OK)
        {
            ToastScript.createToast("使用成功");

            useProp(m_propInfo.m_id);
            UpdatePropData();
        }
        else
        {
            ToastScript.createToast("使用失败");
        }
    }
Beispiel #27
0
        private async void OnEnterRoom(int i)
        {
            try
            {
                UINetLoadingComponent.showNetLoading();

                RoomConfig roomConfig = ConfigHelp.Get <RoomConfig>(i);
                if (PlayerInfoComponent.Instance.GetPlayerInfo().GoldNum < roomConfig.MinThreshold)
                {
                    ToastScript.createToast("金币不足:" + roomConfig.MinThreshold);
                    UINetLoadingComponent.closeNetLoading();
                    return;
                }
                G2C_EnterRoom enterRoom = (G2C_EnterRoom)await Game.Scene.GetComponent <SessionComponent>().Session.Call(new C2G_EnterRoom()
                {
                    RoomType = i
                });

                PlayerInfoComponent.Instance.RoomType = i;
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
Beispiel #28
0
        public void onClickOK()
        {
            if (InputField_name.text.CompareTo("") == 0)
            {
                ToastScript.createToast("请输入姓名");
                return;
            }

            if (InputField_idNumber.text.CompareTo("") == 0)
            {
                ToastScript.createToast("请输入身份证号");
                return;
            }

            if (!VerifyRuleUtil.CheckRealName(InputField_name.text))
            {
                ToastScript.createToast("请输入正确的姓名");
                return;
            }

            if (!VerifyRuleUtil.CheckIDCard(InputField_idNumber.text))
            {
                ToastScript.createToast("请输入正确的身份证号码");
                return;
            }

            RequestRealName();
        }
Beispiel #29
0
    //绑定手机回调
    public void bindPhoneCallBack(string data)
    {
        // 优先使用热更新的代码
        if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("BindPhoneScript_hotfix", "bindPhoneCallBack"))
        {
            ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.BindPhoneScript_hotfix", "bindPhoneCallBack", null, data);
            return;
        }

        JsonData jsonData = JsonMapper.ToObject(data);
        var      code     = (int)jsonData["code"];
        var      msg      = (string)jsonData["msg"];

        if (code == (int)Consts.Code.Code_OK)
        {
            if (phone_type == 0)
            {
                ToastScript.createToast("绑定手机成功,请去邮箱领取奖励!");
            }
            else
            {
                ToastScript.createToast("修改手机成功!");
            }

            LogicEnginerScript.Instance.GetComponent <GetEmailRequest>().OnRequest();
            UserData.phone = _phoneNum;
            UserInfoScript.Instance.InitUI();
            Destroy(this.gameObject);
        }
        else
        {
            LogUtil.Log("绑定手机失败:" + code);
            ToastScript.createToast(msg);
        }
    }
Beispiel #30
0
    public void Connect()
    {
        try
        {
            IPAddress ip;

            if (string.IsNullOrEmpty(m_yuming))
            {
                ip = IPAddress.Parse(m_ipAddress);
            }
            else
            {
                IPHostEntry IPinfo = Dns.GetHostEntry(m_yuming);
                if (IPinfo.AddressList.Length <= 0)
                {
                    ToastScript.createToast("域名解析出错");
                    return;
                }

                ip = IPinfo.AddressList[0];
            }

            Debug.Log("Socket_C----ip = " + ip.ToString() + "    port = " + m_ipPort);

            IPEndPoint ipEndPort = new IPEndPoint(ip, m_ipPort);
            if (ip.AddressFamily.CompareTo(AddressFamily.InterNetworkV6) == 0)
            {
                m_socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
            }
            else
            {
                m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            }

            m_socket.Connect(ipEndPort);
            m_isStart = true;

            if (m_onSocketEvent_Connect != null)
            {
                m_onSocketEvent_Connect(true);
            }

            Debug.Log("Socket_C----连接服务器成功...");

            Task t = new Task(() => { StartReceive(); });
            t.Start();

            // 开始心跳包
            {
                StopHeartBeat();
                StartHeartBeat();
            }
        }
        catch (SocketException ex)
        {
            Debug.Log("Socket_C----连接服务器失败:" + ex + "  " + m_ipAddress.ToString() + "  " + m_ipPort);

            m_onSocketEvent_Connect(false);
        }
    }