Ejemplo n.º 1
0
    /// <summary>
    /// 处理获取验证码后返回的消息
    /// </summary>
    /// <param name="value"></param>
    /// <param name="callback"></param>
    private void _HandleCodeBack(string value, Action callback)
    {
        Debug.Log("sssssss" + value.ToString());
        var      getcodeback = new PlayerGetCodeBackVo();     //Coding<PlayerGetCodeBackVo>.decode (value);
        JsonData data        = JsonMapper.ToObject(value);

        getcodeback.status = int.Parse(data ["status"].ToString());
        getcodeback.msg    = data ["msg"].ToString();
        getcodeback.code   = data ["data"] ["code"].ToString();
        if (getcodeback.status == 0)     //成功
        {
            identyCode = getcodeback.code;
            MessageHint.Show("已经发验证码,注意接收");

            var registController = UIControllerManager.Instance.GetController <Client.UI.UIRegistController>();
            if (registController.getVisible())
            {
                registController.StartCountTime();
            }


            var modifyController = UIControllerManager.Instance.GetController <Client.UI.UIModifyWindowController>();
            if (modifyController.getVisible())
            {
                modifyController.StartCountTime();
            }
        }
        else
        {
            Console.WriteLine(getcodeback.msg);
        }
    }
Ejemplo n.º 2
0
        private void _OnSureHandler(GameObject go)
        {
            var data = new JsonData();

            if (input_name.text == "")
            {
                MessageHint.Show("请输入姓名");
                return;
            }

            if (headpath == "")
            {
                MessageHint.Show("请选择人物头像");
                return;
            }

            data["gender"]    = this.sexname;
            data["playerImg"] = this.headpath;
            data["nick"]      = input_name.text;

            if (_controller.windowType == 0)
            {
                HttpRequestManager.GetInstance().GetPlayerInfor(data.ToJson(), _CreateRoleSuccess);
            }
            else
            {
                var tmpInfor = GameModel.GetInstance.tmpModifyPlayerInfor;
                tmpInfor.nickName = input_name.text;
                tmpInfor.sex      = int.Parse(this.sexname);
                tmpInfor.headImg  = this.headpath;
                NetWorkScript.getInstance().ModifyPlayerInfor(input_name.text, tmpInfor.sex, headpath, GameModel.GetInstance.myHandInfor.uuid);
            }
        }
Ejemplo n.º 3
0
    private void _handPlayerInforBack(string value, Action callback)
    {
        //			Console.WriteLine (str);
        //request result :{"msg":"玩家角色创建成功",
        //"data":{"role":{"accountId":"25","gameNumber":"1","gender":"1","headImg":"","name":"12313213","uuid":"0007a98f-cf6f-42bf-b3a0-0f3aba2a055b"}},"status":0}
        var    backdata = JsonMapper.ToObject(value);
        int    status   = int.Parse(backdata ["status"].ToString());
        string msg      = backdata ["msg"].ToString();

        if (status == 0)
        {
            NetWorkScript.getInstance().init();

            Debug.Log("ssssssss------------" + status.ToString());
            MessageHint.Show(msg);

            var role = backdata["data"]["role"];

            var nickname = role ["name"].ToString();
            var headimg  = role["headImg"].ToString();
            var sex      = int.Parse(role["gender"].ToString());
            var uuid     = role["uuid"].ToString();

            GameModel.GetInstance.setPlayerInfor(nickname, sex, uuid, headimg);

            if (callback != null)
            {
                callback();
            }
        }
        else if (status == 1)
        {
            MessageHint.Show(msg);
        }
    }
Ejemplo n.º 4
0
        private void _onCancleHandler(GameObject go)
        {
            Audio.AudioManager.Instance.BtnMusic();

            if (_selfQuit == true)
            {
                return;
            }

            _controller.QuitCard();
            _controller.NetQuitGame();
            _handleSuccess = true;
            Client.Unit.BattleController.Instance.Send_RoleSelected(0);
            if (GameModel.GetInstance.isPlayNet == true)
            {
                MessageHint.Show("其他玩家正在操作中");
            }
            _controller.setVisible(false);

            //			if (_playerManager.IsHostPlayerTurn())
            //			{
            //
            //			}
            //Console.Error.WriteLine("sss");
        }
Ejemplo n.º 5
0
    private void _HandleServiceList(string value, Action callback)
    {
        serviceList.Clear();
        //request result :{"msg":"查询成功","data":[{"serverName":"电信"},{"serverName":"联通"}],"status":0}
        JsonData data = JsonMapper.ToObject(value);

        var state = int.Parse(data ["status"].ToString());

        if (state == 0)
        {
            var jsonlist = data["data"];

            if (jsonlist.IsArray == true)
            {
                for (int i = 0; i < jsonlist.Count; i++)
                {
                    var serverdata = jsonlist [i];
                    this.serviceList.Add(serverdata["serverName"].ToString());
                }
            }
        }
        else
        {
            MessageHint.Show("获取服务器失败");
        }

        if (null != callback)
        {
            callback();
        }
    }
Ejemplo n.º 6
0
        private void _TimeUpdateHandler(float deltaTime)
        {
            if (GameModel.GetInstance.AlowGameCount() == false)
            {
                return;
            }

            if (_initClock == false || _handleSuccess == true || _selfQuit == true)
            {
                return;
            }

            if (_leftTime > 0)
            {
                _leftTime -= deltaTime;
                if (null != _leftTime)
                {
                    lb_time.text = GetTime(_leftTime);
                }
            }
            else
            {
                //				lb_time.text ="0";
                _selfQuit = true;
                _controller.NetQuitGame();
                Client.Unit.BattleController.Instance.Send_RoleSelected(0);
                if (GameModel.GetInstance.isPlayNet == true)
                {
                    MessageHint.Show("其他玩家正在操作中");
                }
                _controller.setVisible(false);
            }
        }
Ejemplo n.º 7
0
        private void _OnSendPacketHandler(GameObject go)
        {
            Audio.AudioManager.Instance.BtnMusic();

            var player = PlayerManager.Instance.HostPlayerInfo;

            int cashCount = GetCashCount();

//            if (cashCount > MaxCashCount)
//            {
//                MessageHint.Show("红包金额过高。");
//            }
            if (cashCount > player.totalMoney)
            {
                MessageHint.Show("您没有这么多钱。");
            }
            else if (cashCount < MinCashCount)
            {
                MessageHint.Show("请输入大于0的金额");
            }
            else
            {
                //				string _redText="<color=#e53232>{0}</color>";
                //				string _greenText="<color=#00b050>+{0}</color>";
                //                MessageHint.Show("红包发送成功~!");
                //TODO 此处应该调用通用接口,玩家减少这些钱,NPC增加这些钱
                //MessageHint.Show(string.Format("您给<color=#00b050>{0}</color>包了一个<color=#f1df17>{1}</color>元的红包",_controller.player.playerName,cashCount.ToString()));
                MessageTips.Show(string.Format(GameTipManager.Instance.gameTips.overOuterSendRed, _controller.player.playerName));

                if (GameModel.GetInstance.isPlayNet == false)
                {
                    player.totalMoney -= cashCount;
                    var battleControll = UIControllerManager.Instance.GetController <UIBattleController>();
                    if (null != battleControll)
                    {
                        battleControll.SetCashFlow((int)player.totalMoney, -1);
                        if (GameModel.GetInstance.isPlayNet == false)                        //单机状态下,刷新目标玩家的金币
                        {
                            _controller.player.totalMoney += cashCount;
                            var index = Array.IndexOf(PlayerManager.Instance.Players, _controller.player);
                            if (index > 0)
                            {
                                battleControll.SetPersonInfor(_controller.player, index);
                            }
                        }
                    }
                }

                if (cashCount > 0)
                {
                    Audio.AudioManager.Instance.Tip_RedPackage(PlayerManager.Instance.HostPlayerInfo.careerID);
                }

                if (GameModel.GetInstance.isPlayNet == true)
                {
                    NetWorkScript.getInstance().Send_RedPocket(GameModel.GetInstance.curRoomId, -cashCount);
                }
                _ClosePanel();
            }
        }
Ejemplo n.º 8
0
        private void _OnSureGameHandler(GameObject go)
        {
            Audio.AudioManager.Instance.BtnMusic();

            if (this.newInfor.careers == "")
            {
                MessageHint.Show("请输入您的职业");
                return;
            }

            if (this._MonthPay() > this._TotalIncome())
            {
                MessageHint.Show("您的总支出大于了您的收入,请重新输入");
                return;
            }


            this._DownNewPlayerGuid();
            Audio.AudioManager.Instance.Stop();
            if (null != _controller)
            {
                var controller = Client.UIControllerManager.Instance.GetController <UILoadingWindowController>();
                controller.setVisible(true);
                controller.LoadBattleUI();

                var controller2 = Client.UIControllerManager.Instance.GetController <UISpecialeffectsWindowController>();
                controller2.setVisible(true);
            }

            this._controller.setVisible(false);

            PlayerManager.Instance.SetPlayerHero(this.newInfor, _controller.GetChooseIndex(), GameModel.GetInstance.myHandInfor.nickName);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 设置玩家信息
        /// </summary>
        /// <param name="go"></param>
        private void SaveInforHandler(GameObject go)
        {
            if (setName.text == "")
            {
                MessageHint.Show("姓名不能为空");
                return;
            }

            if (nian.options[nian.value].text == "")
            {
                MessageHint.Show("年份不能为空");
                return;
            }

            if (yue.options[yue.value].text == "")
            {
                MessageHint.Show("月份不能为空");
                return;
            }

            if (ri.options[ri.value].text == "")
            {
                MessageHint.Show("日期不能为空");
                return;
            }

            var dataStr = string.Format("{0}.{1}.{2}", nian.options[nian.value].text, yue.options[yue.value].text, ri.options[ri.value].text);

            int tmpsex = 1;

            if (isSexMan == false)
            {
                tmpsex = 0;
            }


            var tarBirthday = string.Format("{0}.{1}.{2}", nianInt, yueInt, riInt);
            var tarName     = setName.text;

            var myInfor = GameModel.GetInstance.myHandInfor;

            if (myInfor.nickName == tarName && tarBirthday == myInfor.birthday && tmpsex == myInfor.sex)
            {
                //Console.Error.WriteLine("当前的信息是一致的");
                set.gameObject.SetActive(false);
                return;
            }


            var tmpdata = new LitJson.JsonData();

            tmpdata["name"]          = tarName;
            tmpdata["gender"]        = tmpsex;
            tmpdata["birthday"]      = tarBirthday;
            tmpdata["constellation"] = this.RushStar();
            tmpdata["playerId"]      = myInfor.uuid;

            HttpRequestManager.GetInstance().UpdatePlayerInfor(tmpdata.ToJson(), _UpdateInforBack);
            set.gameObject.SetActive(false);
        }
Ejemplo n.º 10
0
        private void _BorrowHandler(GameObject go)
        {
            ///借款接口
            ///
            if (null == tmpItem)
            {
                MessageHint.Show("请选择要借款的好友");
                return;
            }

            if (_inputMoney.text == "")
            {
                MessageHint.Show("请选择要借款的数目");
                return;
            }

            //var borrowMoney = int.Parse(_inputMoney.text);
            var   tmpId    = tmpItem.PlayerID;
            float rate     = 1;
            var   tmpMoney = int.Parse(_inputMoney.text);

            if (tmpMoney > tmpItem.MaxMoney)
            {
                MessageHint.Show("请输入的金额大于好友拥有的金额,请重新输入");
                _inputMoney.text = "";
                return;
            }

            NetWorkScript.getInstance().BorrowFriendMoney(tmpId, tmpMoney);
        }
Ejemplo n.º 11
0
        private void _onBtnSureHandler(GameObject go)
        {
            if (input_identify.text == "")
            {
                Console.WriteLine("请入验证码");
                MessageHint.Show("请入验证码");
                return;
            }

            //input_phone.text == "" || input_phone.text.Length < 11
            if (GameModel.IsTelephone(input_phone.text) == false)
            {
                Console.WriteLine("请输入正确的手机号");
                MessageHint.Show("手机号错误,请重新输入");
                input_phone.text = "";
                return;
            }

            if (input_scret.text == "")
            {
                Console.WriteLine("请输入密码");
                MessageHint.Show("请输入密码");
                return;
            }

            var scretModel = new PlayerRegistVo();

            scretModel.code     = input_identify.text;
            scretModel.password = input_scret.text;
            scretModel.phone    = input_phone.text;

            //var tpm = new JsonData ();
            //tpm["code"]=scretModel.code ;
            //tpm["password"]=scretModel.password;
            //tpm ["phone"] = scretModel.phone;
            //var newData = new JsonData ();
            //newData ["jsonString"] = tpm;


            var backdata = "";
            var tmpG     = Coding <PlayerRegistVo> .encode(scretModel);

            Console.WriteLine("jsonString:" + tmpG);

            Console.WriteLine("修改密码成功sssssssss");
            HttpRequestManager.GetInstance().GetModifyData(tmpG, _HandlerSuccess);

            Console.WriteLine(backdata);

            //			var backdatavo = Coding<PlayerRegistBackVo>.decode (backdata);
            //
            //			if(backdatavo.status==0)//chenggong
            //			{
            //				MessageHint.Show (backdatavo.msg);
            //			}
            //			else
            //			{
            //				MessageHint.Show (backdatavo.msg);
            //			}
        }
Ejemplo n.º 12
0
    private void _handlerFeedback(string value, Action callback = null)
    {
        var backVo   = new FankuiBackVo();      //Coding<FankuiBackVo>.decode (value);
        var jsonData = JsonMapper.ToObject(value);

        backVo.status = int.Parse(jsonData ["status"].ToString());
        backVo.msg    = jsonData ["msg"].ToString();


        ////0成功,1失败
        //public int status;
        /// <summary>
        /// The .:”反馈提示玩家”
        /// </summary>
        //public string msg;

        if (backVo.status == 0)        //成功
        {
            if (null != callback)
            {
                callback();
            }
        }
        else
        {
            //失败
        }

        MessageHint.Show(backVo.msg);
    }
Ejemplo n.º 13
0
        private void _CheckOutDay(GameEventArgs evt)
        {
            var playerIndex = Client.Unit.BattleController.Instance.CurrentPlayerIndex;

            var player = PlayerManager.Instance.Players[playerIndex];

            var isHostPlayerTurn = PlayerManager.Instance.IsHostPlayerTurn();

            if (null != player)
            {
                var checkoutMoney = (player.cashFlow + player.totalIncome + player.innerFlowMoney - player.MonthPayment);

                player.totalMoney += checkoutMoney;

                MessageHint.Show(string.Format(SubTitleManager.Instance.subtitle.getCheckOutMoney2, player.playerName, checkoutMoney.ToString()), null, true);
                player.checkOutCount++;

                var battleController = Client.UIControllerManager.Instance.GetController <UIBattleController> ();
                if (null != battleController)
                {
                    if (isHostPlayerTurn)
                    {
                        battleController.SetCashFlow((int)player.totalMoney);
                    }
                    else
                    {
                        battleController.SetPersonInfor(player, playerIndex, false);
                    }
                }
            }
        }
Ejemplo n.º 14
0
    /// <summary>
    /// 处理更新人物信息返回的数据
    /// </summary>
    /// <param name="value"></param>
    /// <param name="callback"></param>
    private void _HandlerUpdateInfor(string value, Action callback)
    {
        var jsonData = JsonMapper.ToObject(value);
        var tipStr   = jsonData["msg"].ToString();
        var state    = int.Parse(jsonData["status"].ToString());

        //    "msg": "添加信息成功",
        //"data": {
        //        "birthday": "1990.11.12",
        //    "gender": "1",
        //    "constellation": "天蝎座",
        //    "name": "55555"
        //},
        //"status": 0

        if (state == 0)
        {
            var data          = jsonData["data"];
            var birthday      = data["birthday"].ToString();
            var gender        = int.Parse(data["gender"].ToString());
            var constellation = data["constellation"].ToString();
            var name          = data["name"].ToString();

            var tmpInfor = GameModel.GetInstance.myHandInfor;
            tmpInfor.nickName      = name;
            tmpInfor.sex           = gender;
            tmpInfor.birthday      = birthday;
            tmpInfor.constellation = constellation;
            if (null != callback)
            {
                callback();
            }
        }
        MessageHint.Show(tipStr);
    }
Ejemplo n.º 15
0
        // 是否有足够的钱购买
        public bool IsCanBuyShare(ChanceShares shares, int num)
        {
            var canbuy    = true;
            var heroInfor = playerInfor;
            var tmpMoney  = 0f;

            for (var i = 0; i < _changeVoList.Count; i++)
            {
                var tmpVo = _changeVoList[i];
                if (tmpVo.shareData.id == shares.id)
                {
                    tmpMoney += num * tmpVo.shareData.payment;
                }
                else
                {
                    tmpMoney += tmpVo.changeNum * tmpVo.shareData.payment;
                }
            }

            if (heroInfor.totalMoney + tmpMoney < 0)
            {
                canbuy = false;
                if (PlayerManager.Instance.IsHostPlayerTurn() == true)
                {
                    MessageHint.Show(SubTitleManager.Instance.subtitle.lackOfGold);
                }
            }
            return(canbuy);
        }
Ejemplo n.º 16
0
        public void QuitCard()
        {
            var heroInfor = playerInfor;

            if (null != cardData)
            {
                MessageHint.Show(string.Format(SubTitleManager.Instance.subtitle.quitFateCard1, heroInfor.playerName), null, true);
            }
        }
Ejemplo n.º 17
0
        public void QuitCard()
        {
            var heroInfor = playerInfor;// PlayerManager.Instance.Players[Client.Unit.BattleController.Instance.CurrentPlayerIndex];

            if (null != cardData)
            {
                MessageHint.Show(string.Format(SubTitleManager.Instance.subtitle.quitChanceCard2, heroInfor.playerName, cardData.title), null, true);
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 处理购买保险
        /// </summary>
        /// <returns></returns>
        public bool HandlerCardData()
        {
            var canHandle = false;

            //var turnIndex = Client.Unit.BattleController.Instance.CurrentPlayerIndex;
            var heroInfor = PlayerManager.Instance.HostPlayerInfo;

            //保险
            if (heroInfor.totalMoney + paymeny < 0)
            {
                Console.WriteLine("余额不足了");
                MessageHint.Show(SubTitleManager.Instance.subtitle.lackOfGold);
                canHandle = false;
                this.setVisible(false);
                return(canHandle);
            }
            else
            {
                if (GameModel.GetInstance.isPlayNet == false)
                {
                    if (heroInfor.InsuranceList.Count > 0)
                    {
                        MessageHint.Show("您已经购买保险,不能重复购买");
                        this.setVisible(false);
                        return(false);
                    }
                    MessageHint.Show("购买保险成功");
                    heroInfor.totalMoney   += paymeny;
                    heroInfor.totalPayment -= paymeny;
                    canHandle = true;
                    //				MessageHint.Show (string.Format(SubTitleManager.Instance.subtitle.innerFateSafe2,heroInfor.playerName,title),null,true);
                    heroInfor.Settlement._buyCareNum += 1;
                    heroInfor.InsuranceList.Add(90001);

                    var borrowController = UIControllerManager.Instance.GetController <UIBorrowWindowController> ();
                    borrowController.UpdateBorrowBoardMoney();
                }
                else if (GameModel.GetInstance.isPlayNet == true)
                {
                    NetWorkScript.getInstance().Game_BuyEnsurance(GameModel.GetInstance.curRoomId, Math.Abs((int)paymeny));
                }
            }

            if (GameModel.GetInstance.isPlayNet == false)
            {
                var battleController = UIControllerManager.Instance.GetController <UIBattleController>();
                if (null != battleController)
                {
                    battleController.SetQualityScore((int)heroInfor.qualityScore, heroInfor.targetQualityScore);
                    battleController.SetTimeScore((int)heroInfor.timeScore, heroInfor.targetTimeScore);
                    battleController.SetNonLaberIncome((int)heroInfor.CurrentIncome, (int)heroInfor.TargetIncome);
                    battleController.SetCashFlow((int)heroInfor.totalMoney, heroInfor.TargetIncome);
                }
            }
            return(canHandle);
        }
Ejemplo n.º 19
0
    /// <summary>
    /// 上传纹理集图片到服务器,然后显示上传的图片。此处单独作为新建角色信息时接口,后需要单独摘出
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    IEnumerator UploadImageData(Texture2D data, Action callBack)
    {
        //MessageHint.Show("上传图片的宽度:"+data.width+",高度是:"+data.height);
        //data.Resize(200, 200);
        //MessageHint.Show("上传图片的宽度:" + data.width + ",高度是:" + data.height);
        byte[] bs = ScaleTexture(data, 180, 180).EncodeToPNG();
        //Encoding.UTF8.GetBytes(postData)
        WWWForm form = new WWWForm();        //

        form.AddBinaryData("picture", bs, "filename.png", "image/png");

        var playerId = GameModel.GetInstance.myHandInfor.uuid;

        form.AddField("playerId", playerId);

        WWW www = new WWW(targetURL + "/user/image", form);

        yield return(www);

        if (www.error != null)
        {
            Debug.Log("error is :" + www.error);
        }
        else
        {
            var backdata = JsonMapper.ToObject(WWW.UnEscapeURL(www.text));
            int status   = int.Parse(backdata ["status"].ToString());
            //string msg = backdata ["msg"].ToString ();
            if (status == 0)
            {
                // Console.Warning.WriteLine("返回的卡牌数据:"+ backdata["data"]["path"].ToString());
                var tmpPath = backdata ["data"] ["path"].ToString();
                //var playerController = UIControllerManager.Instance.GetController<Client.UI.UIPlayerInforController> ();
                //            if(playerController.getVisible())
                //            {
                //                playerController.SetHeadPath(tmpPath);
                //            }
                //var personController = UIControllerManager.Instance.GetController<Client.UI.UIPersonalController>();
                //if(personController.getVisible())
                //{
                //    GameModel.GetInstance.myHandInfor.headImg = tmpPath;
                //}
                Console.Error.WriteLine("头像下载路径是:" + tmpPath);
                GameModel.GetInstance.myHandInfor.headImg = tmpPath;
                if (null != callBack)
                {
                    callBack();
                }
                MessageHint.Show("上传图片成功");
            }
            else
            {
                MessageHint.Show("上传图片失败");
            }
        }
    }
Ejemplo n.º 20
0
        public void QuitCard()
        {
            var heroInfor = playerInfor;

            if (null != cardData)
            {
                MessageHint.Show(string.Format(SubTitleManager.Instance.subtitle.quitChanceCard2, heroInfor.playerName, cardData.title), null, true);
            }
//			NetQuitGame ();
        }
Ejemplo n.º 21
0
            private void OpenPacket()
            {
                int random = 0;

                if (GameModel.GetInstance.isPlayNet == false)
                {
                    if (_playerInfo.totalMoney > 0)
                    {
                        random = UnityEngine.Random.Range(0, Mathf.FloorToInt(_playerInfo.totalMoney * 0.05f));
                    }
                    else
                    {
                        random = 0;
                    }
                }
                else
                {
                    if (null != GameModel.GetInstance.NetReadPackageJson)
                    {
                        var peopleMoney = 0;

                        if (((IDictionary)GameModel.GetInstance.NetReadPackageJson).Contains(_playerInfo.playerID))
                        {
                            peopleMoney = int.Parse(GameModel.GetInstance.NetReadPackageJson [_playerInfo.playerID].ToString());
                        }
                        random = Mathf.Abs(peopleMoney);
                    }
                }

                if (GameModel.GetInstance.isPlayNet == false)
                {
                    _playerInfo.totalMoney -= random;
                    PlayerManager.Instance.HostPlayerInfo.totalMoney += random;

                    var index      = Array.IndexOf(PlayerManager.Instance.Players, _playerInfo);
                    var controller = UIControllerManager.Instance.GetController <UIBattleController> ();
                    controller.SetCashFlow((int)PlayerManager.Instance.HostPlayerInfo.totalMoney, -1);
                    if (index > 0)
                    {
                        controller.SetPersonInfor(_playerInfo, index, false);
                    }
                }

                _lbgetCashCount.text = string.Format("{0}元", random.ToString());
                //MessageHint.Show("播打开红包特效,调用飞金币接口.");

                MessageHint.Show(string.Format("您收到了<color=#00b050>{0}</color>的<color=#f1df17>{1}</color>元红包", _playerInfo.playerName, random.ToString()));

                _objnotgetpacket.SetActiveEx(false);
                _objgetpacket.SetActiveEx(true);

                //TODO此处应该等待打开红包特效结束,飞金币后调用关闭
                //TODO 此处应该调用通用接口,玩家减少这些钱,NPC增加这些钱
                EndCallBack();
            }
Ejemplo n.º 22
0
        private void _CloseHandler()
        {
            _controller.setVisible(false);

            if (GameModel.GetInstance.isPlayNet == true)
            {
                MessageHint.Show("其他玩家正在操作中");
            }

            Client.Unit.BattleController.Instance.Send_RoleSelected(1);
        }
Ejemplo n.º 23
0
    /// <summary>
    /// 显示所有玩家的分享
    /// </summary>
    /// <param name="value"></param>
    /// <param name="callback"></param>
    private void _handlerFeelingShare(string value, Action callback = null)
    {
        var controll = UIControllerManager.Instance.GetController <Client.UI.UIFeelingBaordController>();
        var jsonData = JsonMapper.ToObject(value);


        var state = int.Parse(jsonData["status"].ToString());

        if (state == 1)
        {
            MessageHint.Show("");
            return;
        }

        var dataList = jsonData["data"];

        if (((IDictionary)dataList).Contains("inspirations"))
        {
            var tmpList = dataList["inspirations"];

            if (tmpList.IsArray)
            {
                for (var i = 0; i < tmpList.Count; i++)
                {
                    var tmpVo    = new FeelingVo();
                    var tmpValue = tmpList[i];
                    tmpVo.content = tmpValue["content"].ToString();
                    //Console.Error.WriteLine("lllllllllllllll" + i);
                    controll.GameFeeling.Add(tmpVo);
                }
            }
            //Console.Error.WriteLine("当前数组的长度--"+controll.GameFeeling.Count);
        }

        var _current = int.Parse(dataList["page"].ToString());
        var _total   = int.Parse(dataList["count"].ToString());

        if (_current == _total)
        {
            controll.IsAllLoadGameFeel = true;
        }

        controll.currentGameFeeling = _current;
        controll.GameFeelPages      = _total;

        if (null != callback)
        {
            callback();
        }
    }
Ejemplo n.º 24
0
        public void QuitCard()
        {
            var heroInfor = this.playerInfor;// PlayerManager.Instance.Players[Client.Unit.BattleController.Instance.CurrentPlayerIndex];

            if (null != cardData)
            {
                MessageHint.Show(string.Format(SubTitleManager.Instance.subtitle.quitChanceCard2, heroInfor.playerName, cardData.title), null, true);
            }

            if (this.normalQuit() == false)
            {
                heroInfor.Settlement._smallIntegral += cardData.quitScore;
            }
        }
Ejemplo n.º 25
0
        private void _OnShowBalanceBoard(GameObject go)
        {
            Audio.AudioManager.Instance.BtnMusic();
            if (_noBalance == true)
            {
                MessageHint.Show(string.Format("{0}暂无资产", _controller.playerInfor.playerName), null, true);
                return;
            }

            content_balance.SetActiveEx(true);
            content_income.SetActiveEx(false);
            img_btnbalancebg.SetActiveEx(true);
            img_btnincomebg.SetActiveEx(false);
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 点击加入房间
        /// </summary>
        /// <param name="go"></param>
        private void _OnSureEnteroomHandler(GameObject go)
        {
            //提交进入游戏房间
            var tmpstr = lb_roomNum.text;

            if (tmpstr.Length < 6)
            {
                MessageHint.Show("请输入6位房间号");
                return;
            }

            GameModel.GetInstance.curRoomId = tmpstr;
            NetWorkScript.getInstance().RequestEnterRoom(GameModel.GetInstance.myHandInfor.uuid, tmpstr);
        }
Ejemplo n.º 27
0
 /// <summary>
 /// Ons the show advice handler. 添加咨询面板
 /// </summary>
 /// <param name="go">Go.</param>
 private void _OnShowAdviceHandler(GameObject go)
 {
     if (null != _controller)
     {
         if (_controller.player.isEnterInner == false)
         {
             MessageHint.Show("内圈结算时可查看知识库");
         }
         else
         {
             var controller = UIControllerManager.Instance.GetController <UIConsultingWindowController>();
             controller.isShowBlackBg = true;
             controller.setVisible(true);
         }
     }
 }
Ejemplo n.º 28
0
        /// <summary>
        /// Determines whether this instance has money buy craps. 是否有钱购买其它的筛子
        /// </summary>
        /// <returns><c>true</c> if this instance has money buy craps; otherwise, <c>false</c>.</returns>
        public bool HasMoneyBuyCraps()
        {
            //var turnIndex = Client.Unit.BattleController.Instance.CurrentPlayerIndex;
            var heroInfor = this.playerInfor;// PlayerManager.Instance.Players[turnIndex];

            if (heroInfor.totalMoney + cardData.payment * this.castRate < 0)
            {
                Console.WriteLine("余额不足了");
                if (PlayerManager.Instance.HostPlayerInfo.playerID == playerInfor.playerID)
                {
                    MessageHint.Show(SubTitleManager.Instance.subtitle.lackOfGold);
                }
                return(false);
            }
            return(true);
        }
Ejemplo n.º 29
0
        public bool HasMoneyBuyCraps()
        {
            var turnIndex = Client.Unit.BattleController.Instance.CurrentPlayerIndex;
            var heroInfor = PlayerManager.Instance.Players[turnIndex];

            if (heroInfor.totalMoney + cardData.paymeny < 0)
            {
                Console.WriteLine("余额不足了");
                if (PlayerManager.Instance.IsHostPlayerTurn() == true)
                {
                    MessageHint.Show(SubTitleManager.Instance.subtitle.lackOfGold);
                }
                return(false);
            }
            return(true);
        }
Ejemplo n.º 30
0
        private void _OnClickSendHandler(GameObject go)
        {
            if (lb_input.text != "")
            {
//				var chatvo = new NetChatVo ();
//				chatvo.chat = lb_input.text;
//				chatvo.playerName = GameModel.GetInstance.myHandInfor.nickName;
//				chatvo.playerId = GameModel.GetInstance.myHandInfor.uuid;
//				_controller.AddNewChatLog (chatvo);
                NetWorkScript.getInstance().GameHollChatBroad(lb_input.text);
                lb_input.text = "";
            }
            else
            {
                MessageHint.Show("请先输入文本");
            }
        }