- #include "MatchmakingSubsystem.h"
- void UMatchmakingSubsystem::Initialize(FSubsystemCollectionBase& Collection)
- {
-
-
- Super::Initialize(Collection);
- }
- void UMatchmakingSubsystem::RequestGame()
- {
- FindMatchJob = new MatchmakingJob(CurrentState);
- FindMatchJob->JobCompletedEvent.AddUFunction(this, "OnMatchmakerThreadDone");
-
- FRunnableThread::Create(FindMatchJob, TEXT("FindMatchJob"));
- }
- void UMatchmakingSubsystem::OnMatchmakerThreadDone(bool CompletionState, FString ServerIP)
- {
- if(CompletionState)
- MatchFoundEvent.Broadcast(ServerIP);
- else ServerToConnectTo = "Failed To Connect!";
- }