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

        if (res.status != Respones.OK)
        {
            Debug.LogError("Login error:" + res.status);
            return;
        }

        UserCenterInfo uinfo = res.uinfo;

        ugame.Instance.save_uinfo(uinfo, false);

        event_manager.Instance.dispatch_event("login_success");
        event_manager.Instance.dispatch_event("sync_uinfo");
        PlayerPrefs.SetString("moba_guest_key", "");
    }
Esempio n. 2
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);
    }
Esempio n. 3
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);
    }