예제 #1
0
    private void ConnectedServer(RetLoginMsg msg)
    {
        RetTeamAddr addr = new RetTeamAddr();

        addr.Key     = msg.Key;
        addr.Address = msg.Address;
        NetworkUpdater.Instance.OnConnectedServer(addr);
    }
예제 #2
0
    /// <summary>
    /// 登录成功后返回消息
    /// </summary>
    /// <param name="data"></param>
    /// <param name="error"></param>
    private void OnLoginRet(RetLoginMsg data, RetErrorMsg error)
    {
        if (error != null || data == null)
        {
            string dec = string.Format("{0}\n(错误码:{1})", error.ErrorReason, error.RetCode);
            UIManager.Instance.ShowTips(dec);
            return;
        }

        bool res = HttpClient.SetSession(data.SessionKey, data.Id);

        if (res)
        {
            UIManager.Instance.ShowTips("登录成功");
            UIManager.Instance.CloseWindow("UILoginWindow");

            OnLoginSuccess(data);
        }
        else
        {
            UIManager.Instance.ShowTips("session结构不对");
        }
    }
예제 #3
0
 /// <summary>
 /// 账号密码信息存在本地
 /// </summary>
 private void RecordAccountMsg(RetLoginMsg msg)
 {
     //todo
 }
예제 #4
0
 /// <summary>
 /// 登录成功后一系列处理
 /// </summary>
 /// <param name="msg"></param>
 private void OnLoginSuccess(RetLoginMsg msg)
 {
     RecordAccountMsg(msg);
     ConnectedServer(msg);
 }