Token From Boltnetwork.Connect Is Null Most Of The Time

Trying to send a username to the server when connecting but the token i send using Boltnetwork.Connect() is null about 90% of the time.

Heres the code:
public override void BoltStartDone()
    {
        BoltNetwork.RegisterTokenClass<UserConnectToken>();
    }

public void JoinGame()
{
    UserConnectToken connectToken = new UserConnectToken();
    connectToken.username = m_joinUserName.text;
    BoltNetwork.Connect(m_serverElementsList[SelectorFindClosest()].m_session, connectToken);
}

public override void ConnectRequest(UdpEndPoint endpoint, IProtocolToken token)
    {
        if (token == null)
        {
            Debug.Log("Token is Null");
        }
        else
        {
             BoltNetwork.Accept(endpoint, token);
        }
    }

The UserConnectToken class is the same as the Token UserToken in the examples.

Comments

  • Are you using the Photon Cloud integration?
  • yes
  • replace your PhotonPoller.cs with the one from the latest version on asset store
  • Updating PhotonPoller.cs didnt help, but I did Notice that its a problem with my other token that i use in BoltNetwork.SetHostInfo(). Because of this i get two of the same errors:

Sign In or Register to comment.