示例#1
0
 void fastLoginBack(int status, string msg)
 {
     Proto.httpRegOrLoginRsp data = JsonUtility.FromJson <Proto.httpRegOrLoginRsp>(msg);
     if (status != 0)
     {
         UIManager.instance.SetSomeInfo("请求超时!");
     }
     else if (data.code == 1)
     {
         UIManager.instance.SetSomeInfo("用户名不存在!");
     }
     else if (data.code == 2)
     {
         UIManager.instance.SetSomeInfo("密码错误!");
     }
     else if (data.code == 0)
     {
         Debug.Log("登录成功:" + msg.ToString());
         ResetLocalRecords();
         LoginMgr.instance.ConnectToConnector(data.host, data.port, data.uid, data.token);
     }
     else
     {
         UIManager.instance.SetSomeInfo("未知错误!");
     }
 }
示例#2
0
 void OnRegisterBack(int status, string msg)
 {
     Proto.httpRegOrLoginRsp data = JsonUtility.FromJson <Proto.httpRegOrLoginRsp>(msg);
     if (status != 0)
     {
         UIManager.instance.SetSomeInfo("连接超时!");
     }
     else if (data.code == 3)
     {
         UIManager.instance.SetSomeInfo("用户名已存在!");
     }
     else if (data.code == 0)
     {
         ResetLocalRecords();
         Debug.Log("注册成功:" + msg.ToString());
         LoginMgr.instance.ConnectToConnector(data.host, data.port, data.uid, data.token);
     }
     else
     {
         UIManager.instance.SetSomeInfo("未知错误!");
     }
 }