Authentication Token Issues

Hello,
Our company uses the Photon On-Premise server.

I recently rebuilt using the batch script: "C:\Photon Server\build\deploy.prompter.bat"
After I did this I went to run my game and I keep getting the following errors:

Error 1:
NETWORK: Operation failed: OperationResponse 230: ReturnCode: 32767 (Authentication token is missing). Parameters: {} Server: GameServer => Translation: Other Error.

UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1623)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.TPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
Error 2:
The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account.
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1655)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.TPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
Error 3(just debugging the cause from the OnFailedToConnectToPhoton() callback):
The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account.
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1655)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.TPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
I'm not entirely sure what to make of this.
it was working previously, and I hadn't changed anything in the source, I just was curious what the batch was for, (convenience I figured) and the Auth token is assigned in two separate locations:

    internal virtual void OnConnectedToMaster()
    {
        print("NETWORK: Successful: Connected to Master.\n");
        print("NETWORK: Joining Random Room...\n");
        Debug.LogWarning("REMINDER: Create Proper Auth Values.\n");
        PhotonNetwork.AuthValues = new AuthenticationValues(DateTime.Now.ToLongTimeString());
        PhotonNetwork.JoinLobby();
        //PhotonNetwork.JoinRandomRoom();
    }
and as another check:

    internal virtual void OnJoinedLobby()
    {
        print("NETWORK: Successful: Client connected and gets a room-list - Room-list is stored in PhotonNetwork.GetRoomList()\n");
        print("NETWORK: Joining Random Room...\n");

        if (!string.IsNullOrEmpty(PhotonNetwork.AuthValues.Token))
            PhotonNetwork.JoinRandomRoom();
        else
        {
            PhotonNetwork.AuthValues = new AuthenticationValues();
            Debug.LogError("Null or Empty Photon Auth Token\n");
            PhotonNetwork.JoinRandomRoom();
        }
    }
But when debugging this, the AuthValues are empty, even after assigning it, both times.
Like I said, this used to work, and now it's not... What are your thoughts?

Comments

  • I really don't know what more to say,
    What information can I provide to help?
    I assign the authvalues in the OnConnectedToMaster() callback, yet they are not being set and causing the errors:

    Operation failed: OperationResponse 230: ReturnCode: 32767 (Authentication token is missing). Parameters: {} Server: GameServer

    &

    The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account.

    I'll emphasis, this is a On-Premise server I'm hosting, and I haven't changed any settings, I just built from "C:\Photon Server\build\build.prompter.bat"

    Do I even need to define the appID anywhere in the source code if it is not the cloud?
  • Also, one of my last posts randomly disappeared after making a slight edit, if an admin sees this post, can you look into what happened?
  • Also, it seems this only occurs if I try to join the Lobby after connecting to the Master,
    If I just say PhotonNetwork.JoinRandomRoom() after connecting to the Master, apparently it doesn't give me any issues.
  • hi, @DDeathlonger

    I'm not big PUN master, but I assume that you still connect to cloud. you should update your connection settings to use OnPremise server.
    I've moved your previous question to PUN forum. Guys there will help you for sure.

    best,
    ilya
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited August 2018
    Hi @DDeathlonger,

    Thank you for choosing Photon!

    I have merged the two forum threads you started into one (this).

    You are using Photon in some weird way.
    Unless your custom logic requires this, authentication values should be set before initial connection only.
    Once connected you no longer need to alter those.

    No need to join the lobby to join a random room.
    Join lobbies only to get the list of rooms when applicable.
    If you need to join the default lobby, just enable AutoJoinLobby.

    So I suggest changing your code as follows:
    internal virtual void OnConnectedToMaster()
        {
            print("NETWORK: Successful: Connected to Master.\n");
            print("NETWORK: Joining Random Room...\n");
            PhotonNetwork.JoinRandomRoom();
        }
    
       internal virtual void OnJoinedLobby()
        {
            print("NETWORK: Successful: Client connected and gets a room-list - Room-list is stored in PhotonNetwork.GetRoomList()\n");
            print("NETWORK: Joining Random Room...\n");
            // you probably don't need this, call PhotonNetwork.GetRoomList() inside OnReceivedRoomListUpdate() to get list of rooms
        }
  • DDeathlonger
    edited August 2018
    @chvetsov
    I did update it in the setting files from the editor, and thank you for moving my post to somewhere where it gets noticed.

    @JohnTube
    thank you for the response, it certainly has shined some more light on the way it works.

    I'll certainly try setting the AuthValues before connecting.

    I actually am going to be building an MMO, and I'm aware that the load balancing is not best for this, you have a MMO Demo, but there is not really enough support on how the MMO Demo is different for me to feel comfortable trying to use it.

    Thus I figured rooms would be hosted BY the servers (Admins) and used in a similar manner as WoW uses Realms..? Point being, I actually do not want to connect to a room randomly. I want to connect to the lobby, then choose a room.

    The Authentication errors occur when I connect to the lobby manually. Using join random room is the only way I don't get the error. It's worth stating that I do have PhotonNetwork.autoJoinLobby = false from Start

    If you know a place other than the documentation that has more in depth guide of how to actually configure server source settings such that I can build the MMO servers manually to fit our project, that would also be greatly appreciated.
  • @JohnTube
    I've altered my code to apply the AuthValues before connecting, and then join lobby manually, then join a random room (for development, aka temporary) from within that lobby and all works again.
    Weird that it used to work when I applied auth values after joining the lobby and now it doesnt.. or maybe I only thought that and I am mistaken after changing it during debugging so much.
    Either way, thank you.

    Again, before you close it, if you have any pointers for how to configure the server itself, please let me know, if not, I'll just open another thread specifically for that and see if anyone else does.

    Again, thank you for your help good sir.