Newer
Older
SkyFrontier-Project-IADE-UE4-3D / Source / SkyFrontier / Private / MatchmakingSubsystem.cpp
@Genexuz Genexuz on 10 Jan 2023 700 bytes Cleanup
  1. #include "MatchmakingSubsystem.h"
  2. void UMatchmakingSubsystem::Initialize(FSubsystemCollectionBase& Collection)
  3. {
  4. // Force the intiialization of any other dependency you might have
  5. //Collection.InitializeDependency();
  6. Super::Initialize(Collection);
  7. }
  8. void UMatchmakingSubsystem::RequestGame()
  9. {
  10. FindMatchJob = new MatchmakingJob(CurrentState);
  11. FindMatchJob->JobCompletedEvent.AddUFunction(this, "OnMatchmakerThreadDone");
  12. FRunnableThread::Create(FindMatchJob, TEXT("FindMatchJob"));
  13. }
  14. void UMatchmakingSubsystem::OnMatchmakerThreadDone(bool CompletionState, FString ServerIP)
  15. {
  16. if(CompletionState)
  17. MatchFoundEvent.Broadcast(ServerIP);
  18. else ServerToConnectTo = "Failed To Connect!";
  19. }