Created
June 28, 2021 23:32
-
-
Save JElbourne/b6c894c1457c10ccae9dfa14acea2a07 to your computer and use it in GitHub Desktop.
YourGameInstance.h - For Video: https://youtu.be/jc0COamYRm4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "CoreMinimal.h" | |
#include "OnlineSubsystem.h" | |
#include "OnlineSessionSettings.h" | |
#include "Interfaces/OnlineSessionInterface.h" | |
#include "Engine/GameInstance.h" | |
#include "CreteGameInstance.generated.h" | |
/** | |
* | |
*/ | |
UCLASS() | |
class MULTIPLAYERTEST_API UCreteGameInstance : public UGameInstance | |
{ | |
GENERATED_BODY() | |
public: | |
UCreteGameInstance(); | |
protected: | |
TSharedPtr<FOnlineSessionSearch> SessionSearch; | |
IOnlineSessionPtr SessionInterface; | |
virtual void Init() override; | |
virtual void OnCreateSessionComplete(FName SessionName, bool Succeeded); | |
virtual void OnFindSessionComplete(bool Succeeded); | |
virtual void OnJoinSessionComplete(FName SessionName, EOnJoinSessionCompleteResult::Type Result); | |
UFUNCTION(BlueprintCallable) | |
void CreateServer(); | |
UFUNCTION(BlueprintCallable) | |
void JoinServer(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment