private void login() { //QuickTips.ShowRedQuickTips("消息"); //HallPanel.Instance.load(); if (!_toggle.isOn) { QuickTips.ShowQuickTipsNor("请同意用户协议"); return; } #if !UNITY_EDITOR if (GameConst.isGuest) { ProtoReq.LoginReq(GameConst.isGuest, _accInput.text.ToZhuan(), _accInput.text.ToZhuan(), 0, "htttp://test", _nameInput.text); } else { //SDKMgr.Instance.GetUserInfo();Authorize SDKMgr.Instance.GetUserInfo(); } #else if (string.IsNullOrEmpty(_accInput.text) || string.IsNullOrEmpty(_nameInput.text)) { QuickTips.ShowQuickTipsNor("输入有误"); } else { ProtoReq.LoginReq(GameConst.isGuest, _accInput.text.ToZhuan(), _nameInput.text, 0, "htttp://test"); } #endif }
private void voteQuitRsp(Msg msg) { Table.VoteQuitRsp rsp = (Table.VoteQuitRsp)(msg.body); string str = rsp.yes ? "同意解散房间" : "不同意解散房间"; QuickTips.ShowQuickTipsNor(RoleController.Instance.getPlayerById(rsp.id).Name + str); }
private void enterRoom_rsp(Msg msg) { GlobleTimer.Instance.removeUpdate(addTimer); GlobleTimer.Instance.addUpdate(addTimer); if (((Room.EnterRsp)msg.body).err_no == 0) { int tableId = ((Room.EnterRsp)msg.body).tab_id; if (tableId > 0) { //AlertMgr.Instance.showAlert(ALERT_TYPE.type1,"是否重连到桌子:"+ tableId+"的对局", delegate{ // ProtoReq.ReJoinTable(tableId); //}); QuickTips.ShowQuickTipsNor("重连到桌子:" + tableId + "的对局"); ProtoReq.ReJoinTable(tableId); } else { //HallPanel.Instance.load(); } } //RoomController.Instance.enteredRoom((Room.EnterRsp)msg.body); else { //HallPanel.Instance.load(); } }
private void registRsp(Msg msg) { Login.IOS_RegistRsp rsp = (Login.IOS_RegistRsp)msg.body; if (rsp.errno == 0) { EventDispatcher.Instance.Dispatch(GameEventConst.REGISTED); QuickTips.ShowQuickTipsNor("注册成功"); } else { QuickTips.ShowQuickTipsNor("注册失败,用户已存在"); } }
public void joinedTable(Table.JoinRsp join) { Debug.Log("JoinRsp"); if (join.err_no == 0) { RoleController.Instance.clear(); GameConst.ower = join.owner; DataMgr.Instance.sumRound = join.rule.totalround; DataMgr.Instance.maxbet = join.rule.maxbet; DataMgr.Instance.jiangma = join.rule.jiangma; DataMgr.Instance.maima = join.rule.maima; ProtoReq.Ready(); for (int i = 0; i < join.roles.Count; i++) { RoleController.Instance.addPlayer(join.roles[i]); Debug.Log("role" + i + join.roles[i].name); } RoomPanel.Instance.load(); } else if (join.err_no == 1) { QuickTips.ShowQuickTipsNor("房间不存在"); } else if (join.err_no == 2) { QuickTips.ShowQuickTipsNor("人数已满"); } else if (join.err_no == 3) { QuickTips.ShowQuickTipsNor("已经在座位上,可能别处登录"); } else if (join.err_no == 4) { QuickTips.ShowQuickTipsNor("没有适合座位了"); } }
public override void InitPanel(Transform uiSprite) { base.InitPanel(uiSprite); _login = uiSprite.FindChild("login").GetComponent <Button>(); _zc = uiSprite.FindChild("zc").GetComponent <Button>(); _close = uiSprite.FindChild("CloseBtn").GetComponent <Button>(); _name = uiSprite.FindChild("name").GetComponent <InputField>(); _password = uiSprite.FindChild("password").GetComponent <InputField>(); _login.onClick.AddListener(delegate { if (string.IsNullOrEmpty(_name.text) || string.IsNullOrEmpty(_password.text)) { QuickTips.ShowQuickTipsNor("用户名或密码不能为空"); return; } ProtoReq.LoginReq(GameConst.isGuest, _name.text.ToZhuan(), _name.text.ToZhuan(), 0, "htttp://test", _password.text); //DestoryPanel(); ClosePanel(); }); _zc.onClick.AddListener(delegate { if (string.IsNullOrEmpty(_name.text) || string.IsNullOrEmpty(_password.text)) { QuickTips.ShowQuickTipsNor("用户名或密码不能为空"); return; } ProtoReq.zc(_name.text, _password.text); }); _close.onClick.AddListener(delegate { ClosePanel(); }); }
public override void InitPanel(Transform uiSprite) { base.InitPanel(uiSprite); _login = uiSprite.Find("Button").GetComponent <Button>(); _guestLogin = uiSprite.Find("Button1").GetComponent <Button>(); _guestZc = uiSprite.Find("zcBtn").GetComponent <Button>(); _toggle = uiSprite.Find("info/Toggle").GetComponent <Toggle>(); _toggle.isOn = PlayerPrefs.HasKey("check") ? true : false; _guestLogin.gameObject.SetActive(false); _login.gameObject.SetActive(false); _guestZc.gameObject.SetActive(false); _login.onClick.AddListener(delegate { login(); }); _guestLogin.onClick.AddListener(delegate { if (!_toggle.isOn) { QuickTips.ShowQuickTipsNor("请同意用户协议"); return; } if (GameConst.isGuest) { GuestLoginPanel.Instance.load(2); } }); _guestZc.onClick.AddListener(delegate { if (!_toggle.isOn) { QuickTips.ShowQuickTipsNor("请同意用户协议"); return; } if (GameConst.isGuest) { GuestLoginPanel.Instance.load(1); } }); _toggle.onValueChanged.AddListener(delegate { PlayerPrefs.SetInt("check", 1); //_toggle.isOn = !_toggle.isOn; }); _version = uiSprite.Find("version").GetComponent <Text>(); _accInput = uiSprite.Find("acc").GetComponent <InputField>(); _nameInput = uiSprite.Find("name").GetComponent <InputField>(); #if UNITY_EDITOR _accInput.gameObject.SetActive(true); _nameInput.gameObject.SetActive(true); #else _accInput.gameObject.SetActive(false); _nameInput.gameObject.SetActive(false); #endif }
private void SysErrorRsp(Msg msg) { QuickTips.ShowQuickTipsNor(((Table.SysErrorRsp)msg.body).err_info); }