ahad siddiqui
ahad siddiqui

Reputation: 11

Using Photon real-time with .NET having connection problem

I'm trying to connect to Photon using PlayFab access token and app ID in my windows form application. But every time connection status stuck at "ConnectingtoNameServer", i didn't find enough threads on the internet to solve this problem. Here is my code :

LoadBalancingClient lbclient = new LoadBalancingClient( "us",PAppID,"1.0",ExitGames.Client.Photon.ConnectionProtocol.Udp);
lbclient.AuthValues = new Photon.Realtime.AuthenticationValues();
lbclient.AuthValues.AuthType = Photon.Realtime.CustomAuthenticationType.Custom;
lbclient.AuthValues.AddAuthParameter("username", PlayfabIDUSer);                       
lbclient. AuthValues.AddAuthParameter("token", tok);                        
lbclient.AuthValues.UserId = PlayfabIDUSer;                        
lbclient.NameServerHost = "ns.exitgames.com";                        
lbclient.ConnectToRegionMaster("eu");

Any help would be appreciated.

Upvotes: 1

Views: 211

Answers (1)

JohnTube
JohnTube

Reputation: 1812

You need to call lbclient.Service() periodically in your main/game loop (like a "message pump"). You could do it in a background thread or task.

Read more here and here.

Upvotes: 1

Related Questions