Download

OnlineSubsystems client failed to join reason?

Currently I don’t report to joining clients the reason why they were refused connection (for instance if they have passed the wrong password or the game is full).

The reason logs to the clients log file, but I’m unsure where to capture this data in the client-side code, so i can notify them correctly.

Any ideas which delegate I need to assign?

I think you will want to look into the
AccessControl file, in function prelogin. If i remember right that runs client side.

We also add this stuff to our DefaultGame.ini config file. If you haven’t got that in your ini file add it in.

[Engine.AccessControl]
bAuthenticateClients=true ;Whether or not game servers should authenticate joining clients (clients are blocked from joining at PreLogin, until auth completes, or kicked if it fails)
bAuthenticateServer=true ;Whether or not clients should authenticate the game server (happens after client auth completes)
bAuthenticateListenHost=true ;Whether or not players hosting a listen server should be authenticated with their own server
MaxAuthRetryCount=50 ;The maximum number of times to retry authentication for a player
AuthRetryDelay=1.05 ;The delay between auth retry attempts

Thanks for your input @gamepainters. I just added some logging and tested it out. It doesn’t seem PreLogin() runs for clients (that I can tell). It states that AccessControl is a helper class for GameInfo, which i don’t think is available for clients. If you have any other ideas, i’d be keen to hear. I’m not able to find much documentation on this, and since much of the functionality leads to a native function, it’s hard to trace it down. Cheers

Update: So I just spent some time digging and managed to find NotifyConnectionError() in GameViewPortClient.uc which does receive the error on the client side when trying to join a server.

Not entirely sure if this is the “correct” place for me to hook-in, but it certainly should get me up and running. Cheers