Client freeze when host leaves

I recently completed the Steam MP section of the course, and have since been using this project as a template for my game project.

I have been able to work nicely on the project but there are two issues which I have failed to solve after much troubleshooting and testing:

  1. When the host of the game quits, all connected clients to the same game freeze.
  2. I am no longer able to package the project to share with people through

For the first issue, after looking over documentation, I assumed that maybe I needed to implement an OnSessionFailureDelegates method, which I did. But this did not solve the problem. I also ensured that the DestroySession method is called when the host quits, but this also did not solve the problem. Any ideas on how to resolve this issue?

For the second issue, I was able to solve all of the other build errors related to the ClassFinder code. The builder was able to compile those properly when I used the generated files instead of the regular ones. For example:
static ConstructorHelpers::FClassFinder MenuBPClass(TEXT("/Game/MenuSystem/WBP_MainMenu.WBP_MainMenu_C"));

But now I am stuck with the error: LINK : fatal error LNK1181: cannot open input file ‘libfbxsdk-md.lib’

This only happens on this project as I can package my other projects without issue.

Hope there are some ideas I can explore to solve the issue.


Figured out how to solve both problems.

For the package issue, it seems that “UMG_Editor” was included in the Project.uproject module dependencies. Simply removing it from there allowed me to package the build properly. This in combination with the mentioned generated class files (the ones that en in _C).

For the crash, I simply added an “OnNetworkFailure” delgate like so:

Engine->OnNetworkFailure().AddUObject(this, &UGameInstance::OnNetworkConnectionError);

And implemented the function UGameInstance::OnNetworkConnectionError() to simply call the LoadMainMenu() function. Now the clients are all brought back to the main menu when the hosting player kills the session.

I hope this helps if anyone finds problems with this like I did.


Privacy & Terms