Newer
Older
SkyFrontier-Project-IADE-UE4-3D / Source / SkyFrontier / Public / MatchmakingSubsystem.h
@Genexuz Genexuz on 10 Jan 2023 1 KB Cleanup
  1. #pragma once
  2. #include "CoreMinimal.h"
  3. #include "MatchmakingJob.h"
  4. #include "Subsystems/GameInstanceSubsystem.h"
  5. #include "MatchmakingSubsystem.generated.h"
  6. DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMatchFound, FString, ServerIP);
  7. UCLASS()
  8. class SKYFRONTIER_API UMatchmakingSubsystem : public UGameInstanceSubsystem
  9. {
  10. GENERATED_BODY()
  11. public:
  12. virtual void Initialize(FSubsystemCollectionBase& Collection) override;
  13. // Start Requesting A Game Launch the thread and the widget can poll the string value for an update till the threads done.
  14. UFUNCTION(BlueprintCallable)
  15. void RequestGame();
  16. // Callback From The Thread When It's Done
  17. UFUNCTION()
  18. void OnMatchmakerThreadDone(bool CompletionState, FString ServerIP);
  19. // String the blueprint widget will look at
  20. UPROPERTY(BlueprintReadOnly)
  21. FString CurrentState;
  22. UPROPERTY(BlueprintReadOnly)
  23. FString ServerToConnectTo;
  24. // Actual Threaded Job
  25. MatchmakingJob* FindMatchJob;
  26. // Event To Let Someone Else Handle The Level Loading Stuff
  27. UPROPERTY(BlueprintAssignable)
  28. FOnMatchFound MatchFoundEvent;
  29. };