m-j-e-s-s-e avatar image
m-j-e-s-s-e asked

[UE51.] Having trouble getting OnPostLogin to register


Specifications: Engine: UnrealEngine 5.1 Plugins: - AdvancedSessions - AdvancedSessionsSteam - GSDK - PlayFab Plugin

I've been having some trouble after connecting my clients successfully upon a successful matchmaking ticket.

To clarify, I can successfully connect a client to the server, and have the map show up and load.

To keep things simple, I'm attempting to just do a basic handshake after a connection. The client sends their PlayFabId, and a few other parameters, to the server. The server would then validate the parameters and add that client to a list of connected players, etc...

However, the problem I'm facing now is that OnPostLogin doesn't appear to be getting called when a client connects to the server. I have validated that I can in fact update the players based on the GetInitialPlayers API call by setting up a timer on server init to just update the current players to that. Since I want to support replacement players in a server with matchmaking, I need to track the current players, not the initial. Hence me trying to use OnPostLogin to track this information.

I have some theories:

  1. The way I'm connecting to the server is bypassing this check somehow? To connect to the client, I run a console command using the event graph when the matchmaking process is completed, here's the command: open {IP}:{Port}.

  2. One of the Session plugins I've included can be interrupting the flow of OnPostLogin. This can be tested simply by removing the plugins, and I will do so. But I've got OnPostLogin working with these plugins before attempting to integrate with PlayFab. This wasn't my first guess.

  3. My client build isn't set up correctly. Not sure why this would be the case, but I notice that OnPostLogin happens even on my clients when they are just at the home page, and not necessarily connected to a server, but when they connect to the server, nothing happens.

I feel like I'm missing something obvious. I've been reading documentation/examples for days now and am still struggling to connect the dots here.

I understand that there's probably a number of things that could go wrong here, so it may be hard to point out the exact point at which things have gone wrong. Does this sound like it should work based on the information I've given so far? Have others had success here?

Thanks for your time.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

m-j-e-s-s-e avatar image
m-j-e-s-s-e answered

I figured this out.

The default game mode was being inherited in the default map that unreal generated, not the game mode I had created. Note that I did update this in the project settings, but that didn't update the map. Hence the confusion.

Also, I don't think the client was ready to do the handshake in time, resulting in no message being sent. I added a small delay and was able to validate a simple function.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Simon Cui avatar image Simon Cui commented ·

Glad to hear you figure it out. Please feel free to ask if you have further questions.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.