mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-27 10:24:19 +00:00
Compare commits
11 Commits
4.21_Locke
...
4.22_Locke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95044826af | ||
|
|
b043ad1cf0 | ||
|
|
4c4de8e536 | ||
|
|
60d1d272a5 | ||
|
|
c3f889c9c5 | ||
|
|
2e93c6095a | ||
|
|
6007506189 | ||
|
|
0952d9b18a | ||
|
|
438d0a69ba | ||
|
|
85e9b54fab | ||
|
|
ba28fccfe0 |
@@ -2,8 +2,8 @@
|
|||||||
"FileVersion" : 3,
|
"FileVersion" : 3,
|
||||||
|
|
||||||
"FriendlyName" : "Advanced Sessions",
|
"FriendlyName" : "Advanced Sessions",
|
||||||
"Version" : 4.21,
|
"Version" : 4.22,
|
||||||
"VersionName": "4.21",
|
"VersionName": "4.22",
|
||||||
"Description" : "Adds new blueprint functions to handle more advanced session operations.",
|
"Description" : "Adds new blueprint functions to handle more advanced session operations.",
|
||||||
"Category" : "Advanced Sessions Plugin",
|
"Category" : "Advanced Sessions Plugin",
|
||||||
"CreatedBy" : "Joshua Statzer",
|
"CreatedBy" : "Joshua Statzer",
|
||||||
|
|||||||
@@ -38,16 +38,16 @@ public:
|
|||||||
static void GetExtraSettings(FBlueprintSessionResult SessionResult, TArray<FSessionPropertyKeyPair> & ExtraSettings);
|
static void GetExtraSettings(FBlueprintSessionResult SessionResult, TArray<FSessionPropertyKeyPair> & ExtraSettings);
|
||||||
|
|
||||||
// Get the current session state
|
// Get the current session state
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo")
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (WorldContext = "WorldContextObject"))
|
||||||
static void GetSessionState(EBPOnlineSessionState &SessionState);
|
static void GetSessionState(UObject* WorldContextObject, EBPOnlineSessionState &SessionState);
|
||||||
|
|
||||||
// Get the current session settings
|
// Get the current session settings
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "Result"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
||||||
static void GetSessionSettings(int32 &NumConnections, int32 &NumPrivateConnections, bool &bIsLAN, bool &bIsDedicated, bool &bAllowInvites, bool &bAllowJoinInProgress, bool &bIsAnticheatEnabled, int32 &BuildUniqueID, TArray<FSessionPropertyKeyPair> &ExtraSettings, EBlueprintResultSwitch &Result);
|
static void GetSessionSettings(UObject* WorldContextObject, int32 &NumConnections, int32 &NumPrivateConnections, bool &bIsLAN, bool &bIsDedicated, bool &bAllowInvites, bool &bAllowJoinInProgress, bool &bIsAnticheatEnabled, int32 &BuildUniqueID, TArray<FSessionPropertyKeyPair> &ExtraSettings, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
// Check if someone is in the current session
|
// Check if someone is in the current session
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo")
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (WorldContext = "WorldContextObject"))
|
||||||
static void IsPlayerInSession(const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession);
|
static void IsPlayerInSession(UObject* WorldContextObject, const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession);
|
||||||
|
|
||||||
// Make a literal session search parameter
|
// Make a literal session search parameter
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo|Literals")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo|Literals")
|
||||||
@@ -60,6 +60,14 @@ public:
|
|||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
||||||
static bool IsValidSession(const FBlueprintSessionResult & SessionResult);
|
static bool IsValidSession(const FBlueprintSessionResult & SessionResult);
|
||||||
|
|
||||||
|
// Get a string copy of a session ID
|
||||||
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
||||||
|
static void GetSessionID_AsString(const FBlueprintSessionResult & SessionResult, FString& SessionID);
|
||||||
|
|
||||||
|
// Get a string copy of the current session ID
|
||||||
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo", meta = (WorldContext = "WorldContextObject"))
|
||||||
|
static void GetCurrentSessionID_AsString(UObject* WorldContextObject, FString& SessionID);
|
||||||
|
|
||||||
// Get the Unique Current Build ID
|
// Get the Unique Current Build ID
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
||||||
static void GetCurrentUniqueBuildID(int32 &UniqueBuildId);
|
static void GetCurrentUniqueBuildID(int32 &UniqueBuildId);
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ void UAdvancedExternalUILibrary::ShowInviteUI(APlayerController *PlayerControlle
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExternalUIInterface->ShowInviteUI(Player->GetControllerId(), GameSessionName);
|
ExternalUIInterface->ShowInviteUI(Player->GetControllerId(), NAME_GameSession);
|
||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ UAdvancedFriendsGameInstance::UAdvancedFriendsGameInstance(const FObjectInitiali
|
|||||||
|
|
||||||
void UAdvancedFriendsGameInstance::Shutdown()
|
void UAdvancedFriendsGameInstance::Shutdown()
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -39,7 +39,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
|||||||
|
|
||||||
if (bEnableTalkingStatusDelegate)
|
if (bEnableTalkingStatusDelegate)
|
||||||
{
|
{
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(GetWorld());
|
||||||
|
|
||||||
if (VoiceInterface.IsValid())
|
if (VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -52,7 +52,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(GetWorld());
|
||||||
|
|
||||||
if (IdentityInterface.IsValid())
|
if (IdentityInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -69,7 +69,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
|||||||
|
|
||||||
void UAdvancedFriendsGameInstance::Init()
|
void UAdvancedFriendsGameInstance::Init()
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();//OnlineSub->GetSessionInterface();
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());//OnlineSub->GetSessionInterface();
|
||||||
|
|
||||||
if (SessionInterface.IsValid())
|
if (SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -90,7 +90,7 @@ void UAdvancedFriendsGameInstance::Init()
|
|||||||
// Beginning work on the voice interface
|
// Beginning work on the voice interface
|
||||||
if (bEnableTalkingStatusDelegate)
|
if (bEnableTalkingStatusDelegate)
|
||||||
{
|
{
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(GetWorld());
|
||||||
|
|
||||||
if (VoiceInterface.IsValid())
|
if (VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -103,7 +103,7 @@ void UAdvancedFriendsGameInstance::Init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(GetWorld());
|
||||||
|
|
||||||
if (IdentityInterface.IsValid())
|
if (IdentityInterface.IsValid())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ void UAdvancedFriendsLibrary::SendSessionInviteToFriends(APlayerController *Play
|
|||||||
List.Add(val);
|
List.Add(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SessionInterface->SendSessionInviteToFriends(Player->GetControllerId(), GameSessionName, List))
|
if (SessionInterface->SendSessionInviteToFriends(Player->GetControllerId(), NAME_GameSession, List))
|
||||||
{
|
{
|
||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
return;
|
return;
|
||||||
@@ -94,7 +94,7 @@ void UAdvancedFriendsLibrary::SendSessionInviteToFriend(APlayerController *Playe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SessionInterface->SendSessionInviteToFriend(Player->GetControllerId(), GameSessionName, *FriendUniqueNetId.GetUniqueNetId()))
|
if (SessionInterface->SendSessionInviteToFriend(Player->GetControllerId(), NAME_GameSession, *FriendUniqueNetId.GetUniqueNetId()))
|
||||||
{
|
{
|
||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -12,6 +12,46 @@ bool UAdvancedSessionsLibrary::IsValidSession(const FBlueprintSessionResult & Se
|
|||||||
return SessionResult.OnlineResult.IsValid();
|
return SessionResult.OnlineResult.IsValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UAdvancedSessionsLibrary::GetSessionID_AsString(const FBlueprintSessionResult & SessionResult, FString& SessionID)
|
||||||
|
{
|
||||||
|
const TSharedPtr<class FOnlineSessionInfo> SessionInfo = SessionResult.OnlineResult.Session.SessionInfo;
|
||||||
|
if (SessionInfo.IsValid() && SessionInfo->IsValid() && SessionInfo->GetSessionId().IsValid())
|
||||||
|
{
|
||||||
|
SessionID = SessionInfo->GetSessionId().ToString();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Zero the string out if we didn't have a valid one, in case this is called in c++
|
||||||
|
SessionID.Empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UAdvancedSessionsLibrary::GetCurrentSessionID_AsString(UObject* WorldContextObject, FString& SessionID)
|
||||||
|
{
|
||||||
|
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
||||||
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
||||||
|
|
||||||
|
if (!SessionInterface.IsValid())
|
||||||
|
{
|
||||||
|
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetCurrentSessionID_AsString couldn't get the session interface!"));
|
||||||
|
SessionID.Empty();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const FNamedOnlineSession* Session = SessionInterface->GetNamedSession(NAME_GameSession);
|
||||||
|
if (Session != nullptr)
|
||||||
|
{
|
||||||
|
const TSharedPtr<class FOnlineSessionInfo> SessionInfo = Session->SessionInfo;
|
||||||
|
if (SessionInfo.IsValid() && SessionInfo->IsValid() && SessionInfo->GetSessionId().IsValid())
|
||||||
|
{
|
||||||
|
SessionID = SessionInfo->GetSessionId().ToString();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Zero the string out if we didn't have a valid one, in case this is called in c++
|
||||||
|
SessionID.Empty();
|
||||||
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetCurrentUniqueBuildID(int32 &UniqueBuildId)
|
void UAdvancedSessionsLibrary::GetCurrentUniqueBuildID(int32 &UniqueBuildId)
|
||||||
{
|
{
|
||||||
UniqueBuildId = GetBuildUniqueId();
|
UniqueBuildId = GetBuildUniqueId();
|
||||||
@@ -87,9 +127,10 @@ void UAdvancedSessionsLibrary::GetExtraSettings(FBlueprintSessionResult SessionR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetSessionState(EBPOnlineSessionState &SessionState)
|
void UAdvancedSessionsLibrary::GetSessionState(UObject* WorldContextObject, EBPOnlineSessionState &SessionState)
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
||||||
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -97,12 +138,13 @@ void UAdvancedSessionsLibrary::GetSessionState(EBPOnlineSessionState &SessionSta
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SessionState = ((EBPOnlineSessionState)SessionInterface->GetSessionState(GameSessionName));
|
SessionState = ((EBPOnlineSessionState)SessionInterface->GetSessionState(NAME_GameSession));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetSessionSettings(int32 &NumConnections, int32 &NumPrivateConnections, bool &bIsLAN, bool &bIsDedicated, bool &bAllowInvites, bool &bAllowJoinInProgress, bool &bIsAnticheatEnabled, int32 &BuildUniqueID, TArray<FSessionPropertyKeyPair> &ExtraSettings, EBlueprintResultSwitch &Result)
|
void UAdvancedSessionsLibrary::GetSessionSettings(UObject* WorldContextObject, int32 &NumConnections, int32 &NumPrivateConnections, bool &bIsLAN, bool &bIsDedicated, bool &bAllowInvites, bool &bAllowJoinInProgress, bool &bIsAnticheatEnabled, int32 &BuildUniqueID, TArray<FSessionPropertyKeyPair> &ExtraSettings, EBlueprintResultSwitch &Result)
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
||||||
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -111,7 +153,7 @@ void UAdvancedSessionsLibrary::GetSessionSettings(int32 &NumConnections, int32 &
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOnlineSessionSettings* settings = SessionInterface->GetSessionSettings(GameSessionName);
|
FOnlineSessionSettings* settings = SessionInterface->GetSessionSettings(NAME_GameSession);
|
||||||
if (!settings)
|
if (!settings)
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetSessionSettings couldn't get the session settings!"));
|
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetSessionSettings couldn't get the session settings!"));
|
||||||
@@ -140,9 +182,10 @@ void UAdvancedSessionsLibrary::GetSessionSettings(int32 &NumConnections, int32 &
|
|||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::IsPlayerInSession(const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession)
|
void UAdvancedSessionsLibrary::IsPlayerInSession(UObject* WorldContextObject, const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession)
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
||||||
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -151,7 +194,7 @@ void UAdvancedSessionsLibrary::IsPlayerInSession(const FBPUniqueNetId &PlayerToC
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bIsInSession = SessionInterface->IsPlayerInSession(GameSessionName, *PlayerToCheck.GetUniqueNetId());
|
bIsInSession = SessionInterface->IsPlayerInSession(NAME_GameSession, *PlayerToCheck.GetUniqueNetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
FSessionsSearchSetting UAdvancedSessionsLibrary::MakeLiteralSessionSearchProperty(FSessionPropertyKeyPair SessionSearchProperty, EOnlineComparisonOpRedux ComparisonOp)
|
FSessionsSearchSetting UAdvancedSessionsLibrary::MakeLiteralSessionSearchProperty(FSessionPropertyKeyPair SessionSearchProperty, EOnlineComparisonOpRedux ComparisonOp)
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
|||||||
{
|
{
|
||||||
if (PlayerControllerWeakPtr.IsValid() && Helper.UserID.IsValid())
|
if (PlayerControllerWeakPtr.IsValid() && Helper.UserID.IsValid())
|
||||||
{
|
{
|
||||||
Sessions->CreateSession(*Helper.UserID, GameSessionName, Settings);
|
Sessions->CreateSession(*Helper.UserID, NAME_GameSession, Settings);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -95,7 +95,7 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Sessions->CreateSession(0, GameSessionName, Settings);
|
Sessions->CreateSession(0, NAME_GameSession, Settings);
|
||||||
|
|
||||||
// OnCreateCompleted will get called, nothing more to do now
|
// OnCreateCompleted will get called, nothing more to do now
|
||||||
return;
|
return;
|
||||||
@@ -125,7 +125,7 @@ void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, b
|
|||||||
if (bWasSuccessful)
|
if (bWasSuccessful)
|
||||||
{
|
{
|
||||||
StartCompleteDelegateHandle = Sessions->AddOnStartSessionCompleteDelegate_Handle(StartCompleteDelegate);
|
StartCompleteDelegateHandle = Sessions->AddOnStartSessionCompleteDelegate_Handle(StartCompleteDelegate);
|
||||||
Sessions->StartSession(GameSessionName);
|
Sessions->StartSession(NAME_GameSession);
|
||||||
|
|
||||||
// OnStartCompleted will get called, nothing more to do now
|
// OnStartCompleted will get called, nothing more to do now
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ void UEndSessionCallbackProxy::Activate()
|
|||||||
auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
FNamedOnlineSession* Session = Sessions->GetNamedSession(GameSessionName);
|
FNamedOnlineSession* Session = Sessions->GetNamedSession(NAME_GameSession);
|
||||||
if (Session &&
|
if (Session &&
|
||||||
Session->SessionState == EOnlineSessionState::InProgress)
|
Session->SessionState == EOnlineSessionState::InProgress)
|
||||||
{
|
{
|
||||||
DelegateHandle = Sessions->AddOnEndSessionCompleteDelegate_Handle(Delegate);
|
DelegateHandle = Sessions->AddOnEndSessionCompleteDelegate_Handle(Delegate);
|
||||||
Sessions->EndSession(GameSessionName);
|
Sessions->EndSession(NAME_GameSession);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ void UFindFriendSessionCallbackProxy::Activate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||||
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
@@ -71,7 +71,7 @@ void UFindFriendSessionCallbackProxy::Activate()
|
|||||||
|
|
||||||
void UFindFriendSessionCallbackProxy::OnFindFriendSessionCompleted(int32 LocalPlayer, bool bWasSuccessful, const TArray<FOnlineSessionSearchResult>& SessionInfo)
|
void UFindFriendSessionCallbackProxy::OnFindFriendSessionCompleted(int32 LocalPlayer, bool bWasSuccessful, const TArray<FOnlineSessionSearchResult>& SessionInfo)
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||||
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle);
|
Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::Update
|
|||||||
void UUpdateSessionCallbackProxyAdvanced::Activate()
|
void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||||
{
|
{
|
||||||
|
|
||||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||||
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
@@ -42,8 +42,8 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This gets the actual session itself
|
// This gets the actual session itself
|
||||||
//FNamedOnlineSession * curSession = Sessions->GetNamedSession(GameSessionName);
|
//FNamedOnlineSession * curSession = Sessions->GetNamedSession(NAME_GameSession);
|
||||||
FOnlineSessionSettings* Settings = Sessions->GetSessionSettings(GameSessionName);
|
FOnlineSessionSettings* Settings = Sessions->GetSessionSettings(NAME_GameSession);
|
||||||
|
|
||||||
if (!Settings)
|
if (!Settings)
|
||||||
{
|
{
|
||||||
@@ -85,7 +85,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Sessions->UpdateSession(GameSessionName, *Settings, bRefreshOnlineData);
|
Sessions->UpdateSession(NAME_GameSession, *Settings, bRefreshOnlineData);
|
||||||
|
|
||||||
// OnUpdateCompleted will get called, nothing more to do now
|
// OnUpdateCompleted will get called, nothing more to do now
|
||||||
return;
|
return;
|
||||||
@@ -101,7 +101,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
|||||||
|
|
||||||
void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, bool bWasSuccessful)
|
void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, bool bWasSuccessful)
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
Sessions->ClearOnUpdateSessionCompleteDelegate_Handle(OnUpdateSessionCompleteDelegateHandle);
|
Sessions->ClearOnUpdateSessionCompleteDelegate_Handle(OnUpdateSessionCompleteDelegateHandle);
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"FileVersion" : 3,
|
"FileVersion" : 3,
|
||||||
|
|
||||||
"FriendlyName" : "Advanced Steam Sessions",
|
"FriendlyName" : "Advanced Steam Sessions",
|
||||||
"Version" : 4.21,
|
"Version" : 4.22,
|
||||||
"VersionName": "4.21",
|
"VersionName": "4.22",
|
||||||
"Description" : "Adds new blueprint functions to handle more advanced session operations in Steam. REQUIRES ADVANCED SESSIONS",
|
"Description" : "Adds new blueprint functions to handle more advanced session operations in Steam. REQUIRES ADVANCED SESSIONS",
|
||||||
"Category" : "Advanced Sessions Plugin",
|
"Category" : "Advanced Sessions Plugin",
|
||||||
"CreatedBy" : "Joshua Statzer",
|
"CreatedBy" : "Joshua Statzer",
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
#include "steam/isteamugc.h"
|
||||||
|
#include "steam/isteamremotestorage.h"
|
||||||
|
#endif
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "Interfaces/OnlineSessionInterface.h"
|
||||||
|
|
||||||
// @todo Steam: Steam headers trigger secure-C-runtime warnings in Visual C++. Rather than mess with _CRT_SECURE_NO_WARNINGS, we'll just
|
// @todo Steam: Steam headers trigger secure-C-runtime warnings in Visual C++. Rather than mess with _CRT_SECURE_NO_WARNINGS, we'll just
|
||||||
@@ -203,6 +207,7 @@ struct FBPSteamWorkshopItemDetails
|
|||||||
GENERATED_USTRUCT_BODY()
|
GENERATED_USTRUCT_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FBPSteamWorkshopItemDetails()
|
FBPSteamWorkshopItemDetails()
|
||||||
{
|
{
|
||||||
ResultOfRequest = FBPSteamResult::k_EResultOK;
|
ResultOfRequest = FBPSteamResult::k_EResultOK;
|
||||||
@@ -217,6 +222,7 @@ public:
|
|||||||
bTagsTruncated = false;
|
bTagsTruncated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
FBPSteamWorkshopItemDetails(SteamUGCDetails_t &hUGCDetails)
|
FBPSteamWorkshopItemDetails(SteamUGCDetails_t &hUGCDetails)
|
||||||
{
|
{
|
||||||
ResultOfRequest = (FBPSteamResult)hUGCDetails.m_eResult;
|
ResultOfRequest = (FBPSteamResult)hUGCDetails.m_eResult;
|
||||||
@@ -254,6 +260,7 @@ public:
|
|||||||
|
|
||||||
CreatorSteamID = FString::Printf(TEXT("%llu"), hUGCDetails.m_ulSteamIDOwner);
|
CreatorSteamID = FString::Printf(TEXT("%llu"), hUGCDetails.m_ulSteamIDOwner);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Result of obtaining the details
|
// Result of obtaining the details
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|AdvancedSteamWorkshop")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|AdvancedSteamWorkshop")
|
||||||
|
|||||||
@@ -203,8 +203,8 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::GetLocalSteamIDFromSteam()
|
|||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
FUniqueNetIdSteam2 SteamID(SteamUser()->GetSteamID());
|
TSharedPtr<const FUniqueNetId> SteamID(new const FUniqueNetIdSteam2(SteamUser()->GetSteamID()));
|
||||||
netId.SetUniqueNetId(&SteamID);
|
netId.SetUniqueNetId(SteamID);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
#include "UObject/CoreOnline.h"
|
#include "UObject/CoreOnline.h"
|
||||||
#include "AdvancedSteamFriendsLibrary.h"
|
#include "AdvancedSteamFriendsLibrary.h"
|
||||||
#include "OnlineSubSystemHeader.h"
|
#include "OnlineSubSystemHeader.h"
|
||||||
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
#include "steam/isteamfriends.h"
|
||||||
|
#endif
|
||||||
//#include "OnlineSubsystemSteamTypes.h"
|
//#include "OnlineSubsystemSteamTypes.h"
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
@@ -42,12 +45,11 @@ void USteamRequestGroupOfficersCallbackProxy::Activate()
|
|||||||
OnFailure.Broadcast(EmptyArray);
|
OnFailure.Broadcast(EmptyArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanOfficerListResponse_t *pResult, bool bIOFailure)
|
void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanOfficerListResponse_t *pResult, bool bIOFailure)
|
||||||
{
|
{
|
||||||
TArray<FBPSteamGroupOfficer> OfficerArray;
|
TArray<FBPSteamGroupOfficer> OfficerArray;
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
|
|
||||||
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||||
|
|
||||||
if (bIOFailure || !pResult || !pResult->m_bSuccess)
|
if (bIOFailure || !pResult || !pResult->m_bSuccess)
|
||||||
@@ -111,9 +113,9 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Should never hit this anyway
|
// Should never hit this anyway
|
||||||
//OnFailure.Broadcast(OfficerArray);
|
//OnFailure.Broadcast(OfficerArray);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
#include "SteamWSRequestUGCDetailsCallbackProxy.h"
|
#include "SteamWSRequestUGCDetailsCallbackProxy.h"
|
||||||
#include "OnlineSubSystemHeader.h"
|
#include "OnlineSubSystemHeader.h"
|
||||||
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
#include "steam/isteamugc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// UEndSessionCallbackProxy
|
// UEndSessionCallbackProxy
|
||||||
@@ -46,10 +49,9 @@ void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
|||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure)
|
void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure)
|
||||||
{
|
{
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
|
|
||||||
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||||
|
|
||||||
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
|
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
|
||||||
@@ -91,9 +93,9 @@ void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQuer
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Not needed, should never hit here
|
// Not needed, should never hit here
|
||||||
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user