コード例 #1
0
ファイル: Panel_Login.cs プロジェクト: HeNuoScott/Net3DGame
 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);
         }
     }
 }
コード例 #2
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);
         }
     }
 }