Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Network Error force loads Entry map for client when server shuts down

This seems to have been an issue for some time now without being resolved. If a listen server disconnects, the connected client in the session will get a Network Error event and is then loaded into Entry, regardless if that Network Error event is connected to a Open Level or console command (open mapname) these will be ignored and the client will end up on the Entry map.

I can't find any way of fixing this and it is a problem. Any advice is appreciated!

Product Version: UE 4.17
more ▼

asked Sep 23 '17 at 04:27 AM in Bug Reports

avatar image

375 22 37 58

avatar image Nantuk Oct 16 '18 at 01:55 PM

Did you ever find a solution to this?

avatar image MADHOUSE Oct 30 '18 at 08:13 PM

Not really, I did some hacky fix by setting a bool when the network error occurs, and if that bool is set when the entry map loads, it instantly loads the menu map, error messages etc. It works tho.

avatar image Nantuk Oct 31 '18 at 01:59 PM

yeah, I actually did similar, not happy about it though. I have it that on network error, I quickly load the main menu (from the entry map Splash screen), and show an error message. Not so pretty.

avatar image lun Nov 21 '18 at 09:15 AM

guys, seems like this is the only solution, even if we don't like it. i checked ShooterGame example, and they do the same, after disconnect they change GameState to ErrorMessage, and game opens default level, then this game state value is applied

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

While I'm sure there's better ways, this seemed to do the trick for me.

 void HandleNetworkFailure(UWorld* World, UNetDriver* NetDriver, ENetworkFailure::Type FailureType, const FString& ErrorString);

HandleNetworkFailure is found in the UnrealEngine.h file and can be overridden - this has other interesting stuff like OnTravelFailure.

 void UMyGameInstance::HandleNetworkFailure(UWorld* World, UNetDriver* NetDriver, ENetworkFailure::Type FailureType, const FString& ErrorString) {
     if (FailureType == ENetworkFailure::FailureReceived || FailureType == ENetworkFailure::ConnectionLost) {
         APlayerController* PlayerController = GetFirstLocalPlayerController();
         if (!ensure(PlayerController != nullptr)) return;
         PlayerController->ClientTravel("/Game/Maps/MainMenu", ETravelType::TRAVEL_Absolute);

The function can be implemented as shown above. Running multiple instances via commandline with log reveiled the FailureType to be FailureReceived and ConnectionLost so do a check - eventually it'll be caught and you can do a client travel to the main menu.

     GetEngine()->OnNetworkFailure().AddUObject(this, &UMyGameInstance::HandleNetworkFailure);

Lastly, add a delegate with the function to the OnNetworkFailure event in the Init function of your GameInstance, or where you prefer, and it should be working.

more ▼

answered Jan 29 '19 at 08:52 PM

avatar image


(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question