Example #1
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);
    }
Example #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);
    }
Example #3
0
 public void save_uinfo(UserCenterInfo uinfo, bool is_guest, string guest_key = null)
 {
     this.unick     = uinfo.unick;
     this.uface     = uinfo.uface;
     this.usex      = uinfo.usex;
     this.uvip      = uinfo.uvip;
     this.is_guest  = is_guest;
     this.guest_key = guest_key;
 }
Example #4
0
 public void SaveUInfo(UserCenterInfo uinfo, bool is_guest, string
                       guest_key = null)
 {
     this.uNick    = uinfo.unick;
     this.uFace    = uinfo.uface;
     this.uSex     = uinfo.usex;
     this.uVip     = uinfo.uvip;
     this.isGuest  = is_guest;
     this.guestKey = guest_key;
 }
Example #5
0
 /// <summary>
 /// 保存用户信息
 /// </summary>
 /// <param name="info"></param>
 public static void SaveInfo(UserCenterInfo info, bool isGuest)//,string guestKey=null)
 {
     Assert.IsNotNull(info);
     unick           = info.unick;
     uface           = info.uface;
     usex            = info.usex;
     uvip            = info.uvip;
     NetInfo.isGuest = isGuest;
     //guest_key = guestKey;
 }
Example #6
0
    void handle_uname_login_res(cmd_msg msg)
    {
        UnameLoginRes res = proto_man.protobuf_deserialize <UnameLoginRes>(msg.body);

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

        ugames.Instance.save_uinfo(uinfo, false);

        event_manager.Instance.dispatch_event(event_manager.EVT_LOGIN_SUCCESS, uinfo);
    }
Example #7
0
    void handle_edit_profile_res(cmd_msg msg)
    {
        EditProfileRes e_res = proto_man.protobuf_deserialize <EditProfileRes>(msg.body);

        if (e_res == null)
        {
            return;
        }
        if (e_res.status != Respones.OK)
        {
            Debug.Log("profile status: " + e_res.status);
            return;
        }
        UserCenterInfo info = new UserCenterInfo();

        info.unick = this.editProfileReq.unick;
        info.face  = this.editProfileReq.uface;
        info.sex   = this.editProfileReq.usex;
        ugames.Instance.save_uinfo(info, ugames.Instance.is_guest);
    }
Example #8
0
    private void OnUnameLoginReturn(cmd_msg msg)
    {
        UnameLoginRes res = proto_man
                            .protobuf_deserialize <UnameLoginRes>(msg.body);

        if (res == null)
        {
            return;
        }

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

        UGame.Instance.SaveUInfo(uinfo, false);

        EventManager.Instance.DispatchEvent("login_success", null);
        EventManager.Instance.DispatchEvent("sync_uinfo", null);
    }
Example #9
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);
    }