Client instantly disconnected from server when losing internet connection

Hello everyone,

I am working on a multiplayer Game and actually, everything is working fine. Server is hosted by a player.
I want to prevent the client disconnection when one of the players losing internet connection during 2-3seconds.
To do that, i have setting up the TimeoutConnection in my defaultengine.ini .
But when i simulate losing my connection (disconnecting the Ethernet during one moment) the client is instantly disconnected from the game.
How can i prevent short disconnection for unstable networks?

Thanks for your answer and sorry for my bad english!

1 Like

When you connect to the server using your client, you should set a reference to that connection on the client. When you disconnect, have a system set to automatically retry a connection to that referenced server.

That’s right, but i will lose all variables and the character will be destroyed no?
I was thinking timeout was the solution for me but in defaultengine.ini i have set:
ConnectionTimeout=200000.0
But when i remove my ethernet cable, the client always disconnect after 1-2seconds.
Any idea?

Thanks for your answer!

In my logfile i have:

[2019.10.26-09.52.55:776][284]LogNetSerialization: Error: FBitWriter overflowed! (WriteLen: -1, Remaining: 8110, Max: 8110)
[2019.10.26-09.52.55:776][284]LogNet: Warning: Closing connection. Can’t send function ‘Servhoverobjet’ on ‘PersonnagePrincipal_C /Game/Maps/MAP_Taverne.MAP_Taverne:PersistentLevel.PersonnagePrincipal_C_1’: Reliable buffer overflow. FieldCache->FieldNetIndex: 265 Max 318. Ch MaxPacket: 1024.
[2019.10.26-09.52.55:777][284]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 76561198295559396:7777, Name: SteamNetConnection_0, Driver: GameNetDriver SteamNetDriver_0, IsServer: NO, PC: PlayerController_1, Owner: PlayerController_1, UniqueId: Steam:Bob Mcbiblepop [0x110000105050874], Channels: 23, Time: 2019.10.26-09.52.55
[2019.10.26-09.52.55:777][284]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 76561198295559396:7777, Name: SteamNetConnection_0, Driver: GameNetDriver SteamNetDriver_0, IsServer: NO, PC: PlayerController_1, Owner: PlayerController_1, UniqueId: Steam:Bob Mcbiblepop [0x110000105050874]
[2019.10.26-09.52.55:791][285]LogNet: Warning: Network Failure: GameNetDriver[ConnectionLost]: Your connection to the host has been lost.
[2019.10.26-09.52.55:791][285]LogNet: NetworkFailure: ConnectionLost, Error: ‘Your connection to the host has been lost.’
[2019.10.26-09.52.55:808][286]LogNet: Browse: /Game/Maps/MenuPrincipal?closed
[2019.10.26-09.52.55:808][286]LogNet: Connection failed; returning to Entry
[2019.10.26-09.52.55:825][286]LogLoad: LoadMap: /Game/Maps/MenuPrincipal?closed
[2019.10.26-09.52.55:825][286]LogNet: World NetDriver shutdown SteamNetDriver_0 [GameNetDriver]
[2019.10.26-09.52.55:825][286]LogNet: DestroyNamedNetDriver SteamNetDriver_0 [GameNetDriver]
[2019.10.26-09.52.55:826][286]LogExit: GameNetDriver SteamNetDriver_0 shut down

In fact, I just don’t want to return to entry!

Utilize a save game system for keeping those stats while the player is within the game. For instance, each time they get a kill, write to the save game. When they disconnect you could utilize that save game for reconnecting and resetting the variables. Once the game ends, you could simply erase the save game for use in the next game.

On another note, if you are making a multiplayer game you should be using a database like mysql. With this, you would be able to achieve this type of system using your database.

Yes, that will solve the problem, but that’s a big thing i was thinking another solution will be available cause i have a little delay before client disconnect, i was thinking modify this delay will be possible!
In many games, during connection lost, a lag appear with a long delay (15-20sec before disconnecting).
But thank for your time and your answer :slight_smile: