virtual IOnlineSubsystemPtr CreateSubsystem(FName InstanceName) { if (!GooglePlaySingleton.IsValid()) { GooglePlaySingleton = MakeShareable(new FOnlineSubsystemGooglePlay()); if (GooglePlaySingleton->IsEnabled()) { if(!GooglePlaySingleton->Init()) { UE_LOG(LogOnline, Warning, TEXT("FOnlineSubsystemGooglePlayModule failed to initialize!")); DestroySubsystem(); } } else { UE_LOG(LogOnline, Warning, TEXT("FOnlineSubsystemGooglePlayModule was disabled")); DestroySubsystem(); } return GooglePlaySingleton; } UE_LOG_ONLINE(Warning, TEXT("Can't create more than one instance of a Google Play online subsystem!")); return NULL; }
virtual IOnlineSubsystemPtr CreateSubsystem(FName InstanceName) { if (!SteamSingleton.IsValid()) { SteamSingleton = MakeShareable(new FOnlineSubsystemSteam(InstanceName)); if (SteamSingleton->IsEnabled()) { if(!SteamSingleton->Init()) { UE_LOG_ONLINE(Warning, TEXT("Steam API failed to initialize!")); DestroySubsystem(); } } else { UE_LOG_ONLINE(Warning, TEXT("Steam API disabled!")); DestroySubsystem(); } return SteamSingleton; } UE_LOG_ONLINE(Warning, TEXT("Can't create more than one instance of Steam online subsystem!")); return NULL; }
virtual ~FOnlineFactoryGooglePlay() { DestroySubsystem(); }
virtual ~FOnlineFactorySteam() { DestroySubsystem(); }