_gameVersion, Explained?

Options
Hi, I am building out my first Lobby.

I am at the _gameVersion private variable.
/// <summary>
/// This client's version number. Users are separated from each other by gameversion (which allows you to make breaking changes).
/// </summary>
string _gameVersion = "1";
It is used here...
       public void Connect()
        {
 
 
            // we check if we are connected or not, we join if we are , else we initiate the connection to the server.
            if (PhotonNetwork.connected)
            {
                // #Critical we need at this point to attempt joining a Random Room. If it fails, we'll get notified in OnPhotonRandomJoinFailed() and we'll create one.
                PhotonNetwork.JoinRandomRoom();
            }else{
                // #Critical, we must first and foremost connect to Photon Online Server.
                PhotonNetwork.ConnectUsingSettings(_gameVersion);
            }
        }

What I am wondering is, if it is a value used to separate each client, but, I am setting it here... so, since no client can alter this value, why is it here?

What should my value be?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Renman3000,

    I don't understand the problem here.

    You can set the "_gameVersion" (called "AppVersion") to any string you want.

    Two clients with different "AppVersion"s will not be able to see each other (for the same AppID).

    The idea is to have different versions for your game which is useful for many reasons:
    - dev/test/staging versions: alpha version, beta version, etc.
    - new version with breaking change, etc.