private void on_guest_login_return(cmd_msg msg)
    {
        GuestLoginRes res = proto_man.protobuf_deserialize <GuestLoginRes>(msg.body);

        if (res == null)
        {
            Debug.LogError("res == null");
            return;
        }

        if (res.status != Respones.OK)
        {
            PlayerPrefs.DeleteKey("moba_guest_key");
            Debug.LogError("error to login: "******"  " + uinfo.uid + "  " + uinfo.uface);
        ugame.Instance.save_uinfo(uinfo, true, this.g_key);

        event_manager.Instance.dispatch_event("login_success");
        event_manager.Instance.dispatch_event("sync_uinfo");
    }
Пример #2
0
    private void OnGuestLoginReturn(cmd_msg msg)
    {
        GuestLoginRes res = proto_man
                            .protobuf_deserialize <GuestLoginRes>(msg.body);

        if (res == null)
        {
            return;
        }

        if (res.status != Response.OK)
        {
            Debug.Log("Guest Login status:" + res.status);
            return;
        }

        UserCenterInfo uinfo = res.uinfo;

        UGame.Instance.SaveUInfo(uinfo, true, this.g_key);

        //保存游客Key到本地
        if (this._isSaveGKey)
        {
            this._isSaveGKey = false;
            PlayerPrefs.SetString("xcy_moba_guest_key", this.g_key);
        }

        EventManager.Instance.DispatchEvent("login_success", null);
        EventManager.Instance.DispatchEvent("sync_uinfo", null);
    }
Пример #3
0
    void on_guest_login_return(cmd_msg msg)
    {
        GuestLoginRes res = proto_man.protobuf_deserialize <GuestLoginRes>(msg.body);

        if (res == null)
        {
            return;
        }

        if (res.status != Respones.OK)
        {
            Debug.Log("Guest login status: " + res.status);
            return;
        }

        UserCenterInfo uinfo = res.uinfo;

        ugame.Instance.save_uinfo(uinfo, true, this.g_key);

        // 保存游戏的key到本地
        if (this.is_save_gkey)
        {
            this.is_save_gkey = false;
            PlayerPrefs.SetString("bycw_moba_guest_key", this.g_key);
        }
        //end

        event_manager.Instance.dispatch_event("login_success", null);
        event_manager.Instance.dispatch_event("sync_uinfo", null);
    }
Пример #4
0
 public static void OnGuestLoginRes(GuestLoginRes ret)
 {
     if (ret.errcode == 0)
     {
         PlayerManager.info = ret.info;
         TcpNet.Instance.send_proto_msg_to_client((int)Stype.System, (int)Cmd.eGetPlayerDataReq, null);//向系统服务器获取数据
     }
     else
     {
         string  ErrTips = ErrCodeConfig.GetTipsById(ret.errcode);
         PopItem item    = UIManager.AddItem <PopItem>("PopItem", UIManager.PopPanelRoot);
         if (!string.IsNullOrEmpty(ErrTips))
         {
             item.SetTips(ErrTips);
         }
     }
 }
Пример #5
0
    void handle_guest_login_res(cmd_msg msg)
    {
        GuestLoginRes res = proto_man.protobuf_deserialize <GuestLoginRes>(msg.body);

        if (res == null)
        {
            return;
        }
        if (res.status != Respones.OK)
        {
            Debug.Log("Guest login status: " + res.status);
            return;
        }
        UserCenterInfo uinfo = res.info;

        ugames.Instance.save_uinfo(uinfo, true);

        if (this.is_save_gkey)
        {
            this.is_save_gkey = false;
            PlayerPrefs.SetString("login_guest_key", this.g_key);
        }
        event_manager.Instance.dispatch_event(event_manager.EVT_LOGIN_SUCCESS, uinfo);
    }