Exemplo n.º 1
0
    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
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
 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();
     }
 }
Exemplo n.º 4
0
    public static void InitUIRoot()
    {
        GameObject rootCanvas = ResourceManager.GetGameObject(URLConst.GetUI("UIRoot"));
        Transform  canvas     = rootCanvas.transform.FindChild("UICanvas");
        GameObject tips       = rootCanvas.transform.FindChild("TipsLayer").gameObject;

        QuickTips.InitQuickTipsLayer(tips, 100);
        GameConst.auto = rootCanvas.transform.FindChild("auto").gameObject;
        UIEventHandlerBase.AddListener(GameConst.auto, UIEventType.ON_POINTER_CLICK, delegate(GameObject obj, BaseEventData evn)
        {
            ProtoReq.cancelAuto();
        });
        GameConst.auto.SetActive(false);
        AlertMgr.Instance.Init(rootCanvas.transform.FindChild("Alert").gameObject);
        AlertMgr.Instance._alert.SetActive(false);

        rootCanvas.SetActive(true);
        rootCanvas.transform.localScale = Vector3.one;
        GameObject.DontDestroyOnLoad(rootCanvas);

        GameObject eventSystem = GameObject.Find("EventSystem");

        if (eventSystem == null)
        {
            eventSystem = new GameObject("EventSystem");
            eventSystem.AddComponent <EventSystem>();
            eventSystem.AddComponent <StandaloneInputModule>();
            eventSystem.AddComponent <TouchInputModule>();
        }
        GameObject.DontDestroyOnLoad(eventSystem);
    }
Exemplo n.º 5
0
 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("注册失败,用户已存在");
     }
 }
Exemplo n.º 6
0
    private void addClick()
    {
        _close.onClick.AddListener(delegate
        {
            ClosePanel();
        });

        _confirm.onClick.AddListener(delegate
        {
            if (_idInput.text.Equals(""))
            {
                QuickTips.ShowRedQuickTips("请输入玩家id");
                return;
            }
            ProtoReq.GMQuerySinglePlayer(int.Parse(_idInput.text).IdEx());
        });

        _set.onClick.AddListener(delegate
        {
            if (_idInput.text.Equals(""))
            {
                QuickTips.ShowRedQuickTips("请输入玩家id");
                return;
            }

            if (int.Parse(_coinInput.text) > DataMgr.Instance.money)
            {
                _warning.SetActive(true);
                return;
            }
            _warning.SetActive(false);
            ProtoReq.addCoin(int.Parse(_idInput.text).IdEx(), int.Parse(_coinInput.text));
            _idInput.text = "";
        });

        _up.onClick.AddListener(delegate
        {
            if (index >= 6)
            {
                ProtoReq.GMQueryMoneyLog(MainRole.Instance.Id, true, index - 6);
            }
            page = -1;
        });

        _down.onClick.AddListener(delegate
        {
            ProtoReq.GMQueryMoneyLog(MainRole.Instance.Id, true, index + 6);
            page = 1;
        });
    }
Exemplo n.º 7
0
    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("没有适合座位了");
        }
    }
Exemplo n.º 8
0
    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();
        });
    }
Exemplo n.º 9
0
    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
    }
Exemplo n.º 10
0
 private void SysErrorRsp(Msg msg)
 {
     QuickTips.ShowQuickTipsNor(((Table.SysErrorRsp)msg.body).err_info);
 }