private void On_TCP_Message(MessageBuffer msg)
    {
        Debug.Log((ServerToClientID)msg.Id());

        // 请求匹配成功
        if (ServerToClientID.TcpResponseRequestMatch == (ServerToClientID)msg.Id())
        {
            ImageWait.SetActive(true);
        }
        // 取消匹配成功
        else if (ServerToClientID.TcpResponseCancelMatch == (ServerToClientID)msg.Id())
        {
            ImageWait.SetActive(false);
        }
        // 允许进入战场
        else if (ServerToClientID.TcpEnterBattle == (ServerToClientID)msg.Id())
        {
            Debug.Log("进入战场");
        }
    }
Exemple #2
0
 private void LoginCon_On_TCP_Message(MessageBuffer msg)
 {
     if (ServerToClientID.TcpResponseLogin == (ServerToClientID)msg.Id())
     {
         TcpResponseLogin _mes = ProtoTransfer.DeserializeProtoBuf3 <TcpResponseLogin>(msg);
         if (_mes.Result)
         {
             Debug.Log("登录成功~~~" + _mes.Uid);
             ClientService.GetSingleton().token = _mes.Token;
             //场景
             ClearSceneData.LoadScene(GameConfig.mainScene);
         }
         else
         {
             text.text = _mes.Reason;
             waitTip.SetActive(false);
         }
     }
 }
Exemple #3
0
 private void LoginCon_On_TCP_Message(MessageBuffer msg)
 {
     if (ServerToClientID.TcpResponseRegister == (ServerToClientID)msg.Id())
     {
         TcpResponseRegister _mes = ProtoTransfer.DeserializeProtoBuf3 <TcpResponseRegister>(msg);
         if (_mes.Result)
         {
             Debug.Log("注册成功~~~");
             ClientService.GetSingleton().token = _mes.Token;
             this.gameObject.SetActive(false);
             panel_Login.SetActive(true);
             waitTip.SetActive(false);
         }
         else
         {
             text.text = "注册失败";
             waitTip.SetActive(false);
         }
     }
 }