Simulate client disconnect while PIE?

Howdy,

Not sure which section to post this in, but at any rate, I was wondering if there was any way to prevent the closing of one client closing all other clients and ending a PIE test.

Essentially, whenever I’m testing, if I try to close out of one client to simulate what happens when someone “quits” or an unexpected network disconnect, it closes all clients and ends PIE - much like pressing ESC on any of them or manually stopping PIE. Is it possible to stop this or should this not be happening?

4.5.1 if that’s of any worth.

-WM

This is a few months old, but no one answered, and this came up as my first google result on the issue…

You can use the disconnect command to make the user disconnect. This will not close their window, but they will leave the server, and load whichever the start level is, but in single player.

1 Like

saved me from packaging my game a million times over, thanks !

In 4.12.5 running “disconnect” on one client disconnects all clients.
Has anybody found another way to do this? It would immensely help us test & reproduce bugs.

Version 4.19.2 - “disconnect” works as expected.

“open 127.0.0.1:17777” to reconnect

The problem with this method on 4.22 is AGameModeBase::Logout will not be called in PIE mode

Thank you for posting that logout will not be called on gamemode, I’ve been stuck on this for hours.

I have a pretty decent solution for this. You can make a blueprint callable function in C++ that calls Logout on the game mode. One note: your not really logging out so you need a “bIsLoggingOut” to track once the player “starts logging out” so you can switch off that logic. Lets me test all my disconnect/reconnect logic easy enough though :slight_smile:

The onStartTurn event was just me forcing a logout when the player turn started. Suggest makign a “Force Logout” event and call it from wherever.