Client notification by UMG on server disconnection
At the moment I am involved in creating a multiplayer networked game and when the server disconnects, the clients simply get booted to the default map (the main menu in my case). What I'm trying to do is bring up a UMG widget that notifies the user that there has been a network error and only takes it to the menu after they have clicked the ok button or pressed a key. I've tried using the Event NetworkError in the Game Instance but it doesn't seem to even print anything from the failure type when I put a print string node there. Does anyone have any idea how I could achieve this in Blueprints or C++?
So several months later I've gone back to attempt this again. I tried George Li's answer but that didn't work for me, I also couldn't find that function in the game instance to override even though the code compiled fine and there was no error.
I attempted once again to use the Event Network Error in the Game Instance Blueprint and for some reason now it worked. I had to add a "Do Once" node because the Network Error would be spammed (from testing with a Print String) but other than that it worked fine, I used the 'failure type' for a switch and then created my ui and added it to the viewport and it allowed me to focus a button with the controller which i use for user input to go back to the main menu. I would've liked to achieve this in code but the blueprints work for me so I am leaving it at that for now.
answered Oct 19 '16 at 09:48 AM
virtual void HandleNetworkFailure(UWorld *World, UNetDriver *NetDriver, ENetworkFailure::Type FailureType, const FString& ErrorString);
answered Sep 30 '16 at 06:51 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here