/Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h
Returns the number of fully initialized local players, this will be 0 on dedicated servers. Indexes up to this can be used as PlayerIndex parameters for the following functions, and you are guaranteed to get a local player controller.
static int32 GetNumLocalPlayerControllers ( const [UObject](API\Runtime\CoreUObject\UObject\UObject) * WorldContextObject )