How to actually get a Realtime SDK?

Hello!
My question may seem silly (sorry fot that), but i'm not sure how actually can i acquire a realtime SDK? Plus i would like to integrate PlayFab with Photon as well.

When navigating throught "products" page i can easilly access Free PUN, but the only option i have at "realtime" page is "try free plan" that leads to a new account creation(but i already have one).

Okay, i've made a new "realtime" project with my dashboard and connected this to PlayFab with this tutorial https://api.playfab.com/docs/tutorials/landing-tournaments/photon-unity
But, this tutorial actually points me to "Free PUN" package that does not contain Realtime API.
So, then when using "ConnectToMaster(clientVersion)" i have console errors:

OperationResponse 230: ReturnCode: 32755 (Custom authentication service error: Error). Parameters: {} Server: NameServer
UnityEngine.Debug:LogError(Object)

There was more or less simmular question on PlayFab forums and Devs answered that PUN is not actually supported with a "Playfab Photon Addon". Only Photon realtime. But tutorial leads me to a "Free PUN" package and it doest not contain realtime functionality. (basically, i can't use "LoadBalancingClient" from photon tutorials).

It feels like i'm missing some crucial part. Could you help with this ussie?

Thank you for you time!

Best Answer

  • JohnTubeJohnTube mod
    edited July 9 Accepted Answer
    Hi @L31ghT,

    Thank you for choosing Photon!

    PlayFab supports both PUN and Photon Realtime.
    You can read about PUN vs. Photon Realtime here.

    You need to setup Custom Authentication properly.
    Follow our guides and PlayFab's.

    - PlayFab integration guide for PUN
    - PlayFab integration guide for Photon Realtime

    To get SDK:

    - PUN
    - Photon Realtime Unity SDK

    From the snippet, I think you are using the wrong connect method or the wrong method parameter or a misleading parameter name:

    NE_PhotonNetworkManager.Instance.ConnectToMaster(clientVersion);

    you should connect to Photon Cloud instead using:

    PhotonNetwork.ConnectUsingSettings(_clientVersion);

    Or maybe you are mixing PUN and Photon Realtime (LoadBalancing API) in the same project.
    Which is not what you need I believe.

Answers

  • L31ghTL31ghT
    edited July 8
    Update:
    To be more specific, here is my code:

    This code returns me an error i described above:
    
        // *****************************
        // OnPhotonAuthReply
        // *****************************
        void OnPhotonAuthReply(GetPhotonAuthenticationTokenResult _reply) {
            Debug.Log("[PLAYFAB] PHOTON token recieved!");
            loginData.photonTokenResult = _reply;
    
            AuthenticationValues authValues = new AuthenticationValues();
    
            authValues.AuthType = CustomAuthenticationType.Custom;
            authValues.AddAuthParameter("username", loginData.loginReply.PlayFabId);
            authValues.AddAuthParameter("token", loginData.photonTokenResult.PhotonCustomAuthenticationToken);
    
            loginData.photonAuthValues  = authValues;
            PhotonNetwork.AuthValues    = authValues;
    
            NE_PhotonNetworkManager.Instance.ConnectToMaster(clientVersion);
            // ConnectToMaster() contains:
            // PhotonNetwork.autoJoinLobby = false;
            // PhotonNetwork.ConnectUsingSettings(_clientVersion);
        }
  • JohnTubeJohnTube mod
    edited July 9 Accepted Answer
    Hi @L31ghT,

    Thank you for choosing Photon!

    PlayFab supports both PUN and Photon Realtime.
    You can read about PUN vs. Photon Realtime here.

    You need to setup Custom Authentication properly.
    Follow our guides and PlayFab's.

    - PlayFab integration guide for PUN
    - PlayFab integration guide for Photon Realtime

    To get SDK:

    - PUN
    - Photon Realtime Unity SDK

    From the snippet, I think you are using the wrong connect method or the wrong method parameter or a misleading parameter name:

    NE_PhotonNetworkManager.Instance.ConnectToMaster(clientVersion);

    you should connect to Photon Cloud instead using:

    PhotonNetwork.ConnectUsingSettings(_clientVersion);

    Or maybe you are mixing PUN and Photon Realtime (LoadBalancing API) in the same project.
    Which is not what you need I believe.
  • L31ghTL31ghT
    edited July 9
    Thank you for your reply and links provided!
    It was very helpful and i've finally located a problem :)
    Thanks again!
Sign In or Register to comment.