OnCustomAuthenticationFailed never gets called on Unity client

I'm having an issue implementing Photon On Premis + Custom authentication.

The server runs fine (Basically the LoadBalancing application running, a few adjustments made but nothing major yet)
The client also runs fine, if you provide proper credentials "logging in", you get inside.

The problem comes if the credentials are incorrect, i get logged in the console:
Operation failed: OperationResponse 230: ReturnCode: 32755 (Login Failed). Parameters: {} Server: MasterServer
Custom Authentication failed (either due to user-input or configuration or AuthParameter string format). Calling: OnCustomAuthenticationFailed()

However, OnCustomAuthenticationFailed() does not seem to get called as the next line reads:
TPeer.Disconnect()

Which is inside NetworkingPeer.cs a few lines below the auth fail stuff,

The function i'm expecting to be called is (within the .cs that initiates the whole connection) :

public void OnCustomAuthenticationFailed(string debugMessage)
{
Debug.Log("We failed miserably, aboooooort!!");
}

I've tried having it as both public void, and public virtual void, neither get called.

And yes, other functions with callbacks DO work, such as "OnConnectedToMaster", "OnJoinedLobby", "OnJoinedRoom" etc etc, so, what gives?

Any and all ideas welcome

Comments

  • Ah, never mind, apparently (found this out by a fluke of extensive logging) the problem was that when logging in, i change scenes to a "loading" scene untill i either a) log in successfully and display the ingame world, or b) am unsuccessfull in logging in and supposed to load the login scene again, however, my control object containing my scripting was destroyed when loading the loading scene, hence my OnCustomAuthenticationFailed function wasnt there when PUN tried to call it anymore, so adding DontDestroyOnLoad(gameObject); in the start() and update() functions of the scripting gameobject solved everything.
Sign In or Register to comment.