Closed bwagstaff closed 1 year ago
I am not quite sure I understand how your added condition helps. Are you saying that the PlayFabSubsystem can be initialized from another networking library?
I believe he's suggesting the following. Changing from:
To:
if (static_cast<FPlayFabSocketSubsystem*>(ISocketSubsystem::Get(PLAYFAB_SOCKET_SUBSYSTEM)) == nullptr)
{
UE_LOG_ONLINE(Log, TEXT("Initializing PlayFabPartSocketSubsystem"));
CreatePlayFabSocketSubsystem();
}
IMO the original condition doesn't make sense, since this line https://github.com/PlayFab/PlayFabMultiplayerUnreal/blob/7e146a22a4adf81301a89f367756dc0b7c347a4e/Source/Private/OnlineSubsystemPlayFab.cpp#L107
actually returns the PlayFabSDK plugin which has no sockets subsystem at all. Maybe it had at some point in the past, but it doesn't work now.
When multiple networking libraries are used in a solution, this initialization is a race condition. If other socket subsytems are initialized, the playfab socket subsystem will not initialize. As a local fix we're adding the condition:
static_cast<FPlayFabSocketSubsystem*>(ISocketSubsystem::Get(PLAYFAB_SOCKET_SUBSYSTEM)) == nullptr
https://github.com/PlayFab/PlayFabMultiplayerUnreal/blob/7e146a22a4adf81301a89f367756dc0b7c347a4e/Source/Private/OnlineSubsystemPlayFab.cpp#L108