AActor::UseShortConnectTimeout
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtualconst
Description
Tells the net driver whether the owning connection should switch from the initial long connect timeout to the shorter gameplay timeout value. Override to return true once your actor has finished its initial handshake or loading phase.
Caveats & Gotchas
- • This is only consulted for the net-owning actor of a connection (typically the PlayerController). Returning true on non-owning actors has no effect.
- • The two timeout values are controlled by InitialConnectTimeout and ConnectionTimeout on the UNetDriver — not constants in this class. Returning true triggers the switch to the shorter ConnectionTimeout.
- • If you override this to return true too early, the server may drop clients that are still loading the map. Return true only after the client is fully in-game.
Signature
virtual bool UseShortConnectTimeout() const { return false; } Return Type
bool Example
Switch to short timeout after player finishes loading C++
bool AMyPlayerController::UseShortConnectTimeout() const
{
// Only use the short timeout once the player has fully loaded in
return bHasFinishedLoading;
} See Also
Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?