mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-27 18:34:07 +00:00
Compare commits
3 Commits
4.23_Locke
...
4.21_Locke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c156a6f45 | ||
|
|
54026b637d | ||
|
|
892bee272d |
@@ -2,8 +2,8 @@
|
|||||||
"FileVersion" : 3,
|
"FileVersion" : 3,
|
||||||
|
|
||||||
"FriendlyName" : "Advanced Sessions",
|
"FriendlyName" : "Advanced Sessions",
|
||||||
"Version" : 4.23,
|
"Version" : 4.21,
|
||||||
"VersionName": "4.23",
|
"VersionName": "4.21",
|
||||||
"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",
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
@@ -39,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", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo")
|
||||||
static void GetSessionState(UObject* WorldContextObject, EBPOnlineSessionState &SessionState);
|
static void GetSessionState(EBPOnlineSessionState &SessionState);
|
||||||
|
|
||||||
// Get the current session settings
|
// Get the current session settings
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "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);
|
static void GetSessionSettings(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", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo")
|
||||||
static void IsPlayerInSession(UObject* WorldContextObject, const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession);
|
static void IsPlayerInSession(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")
|
||||||
@@ -61,14 +60,6 @@ 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);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "Interfaces/OnlineSessionInterface.h"
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "CancelFindSessionsCallbackProxy.generated.h"
|
#include "CancelFindSessionsCallbackProxy.generated.h"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "CreateSessionCallbackProxyAdvanced.generated.h"
|
#include "CreateSessionCallbackProxyAdvanced.generated.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "Interfaces/OnlineSessionInterface.h"
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "EndSessionCallbackProxy.generated.h"
|
#include "EndSessionCallbackProxy.generated.h"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "Interfaces/OnlineSessionInterface.h"
|
||||||
#include "FindSessionsCallbackProxy.h"
|
#include "FindSessionsCallbackProxy.h"
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "UpdateSessionCallbackProxyAdvanced.generated.h"
|
#include "UpdateSessionCallbackProxyAdvanced.generated.h"
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ void UAdvancedExternalUILibrary::ShowInviteUI(APlayerController *PlayerControlle
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExternalUIInterface->ShowInviteUI(Player->GetControllerId(), NAME_GameSession);
|
ExternalUIInterface->ShowInviteUI(Player->GetControllerId(), GameSessionName);
|
||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ UAdvancedFriendsGameInstance::UAdvancedFriendsGameInstance(const FObjectInitiali
|
|||||||
|
|
||||||
void UAdvancedFriendsGameInstance::Shutdown()
|
void UAdvancedFriendsGameInstance::Shutdown()
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -39,7 +39,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
|||||||
|
|
||||||
if (bEnableTalkingStatusDelegate)
|
if (bEnableTalkingStatusDelegate)
|
||||||
{
|
{
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(GetWorld());
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
|
|
||||||
if (VoiceInterface.IsValid())
|
if (VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -52,7 +52,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(GetWorld());
|
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
||||||
|
|
||||||
if (IdentityInterface.IsValid())
|
if (IdentityInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -69,7 +69,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
|||||||
|
|
||||||
void UAdvancedFriendsGameInstance::Init()
|
void UAdvancedFriendsGameInstance::Init()
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());//OnlineSub->GetSessionInterface();
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();//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(GetWorld());
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
|
|
||||||
if (VoiceInterface.IsValid())
|
if (VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -103,7 +103,7 @@ void UAdvancedFriendsGameInstance::Init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(GetWorld());
|
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
||||||
|
|
||||||
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(), NAME_GameSession, List))
|
if (SessionInterface->SendSessionInviteToFriends(Player->GetControllerId(), GameSessionName, 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(), NAME_GameSession, *FriendUniqueNetId.GetUniqueNetId()))
|
if (SessionInterface->SendSessionInviteToFriend(Player->GetControllerId(), GameSessionName, *FriendUniqueNetId.GetUniqueNetId()))
|
||||||
{
|
{
|
||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
#include "AdvancedSessionsLibrary.h"
|
#include "AdvancedSessionsLibrary.h"
|
||||||
|
|
||||||
#include "GameFramework/PlayerState.h"
|
#include "GameFramework/PlayerState.h"
|
||||||
#include "GameFramework/GameStateBase.h"
|
#include "GameFramework/GameStateBase.h"
|
||||||
|
|
||||||
@@ -11,46 +12,6 @@ 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();
|
||||||
@@ -126,10 +87,9 @@ void UAdvancedSessionsLibrary::GetExtraSettings(FBlueprintSessionResult SessionR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetSessionState(UObject* WorldContextObject, EBPOnlineSessionState &SessionState)
|
void UAdvancedSessionsLibrary::GetSessionState(EBPOnlineSessionState &SessionState)
|
||||||
{
|
{
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -137,13 +97,12 @@ void UAdvancedSessionsLibrary::GetSessionState(UObject* WorldContextObject, EBPO
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SessionState = ((EBPOnlineSessionState)SessionInterface->GetSessionState(NAME_GameSession));
|
SessionState = ((EBPOnlineSessionState)SessionInterface->GetSessionState(GameSessionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
void UAdvancedSessionsLibrary::GetSessionSettings(int32 &NumConnections, int32 &NumPrivateConnections, bool &bIsLAN, bool &bIsDedicated, bool &bAllowInvites, bool &bAllowJoinInProgress, bool &bIsAnticheatEnabled, int32 &BuildUniqueID, TArray<FSessionPropertyKeyPair> &ExtraSettings, EBlueprintResultSwitch &Result)
|
||||||
{
|
{
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -152,7 +111,7 @@ void UAdvancedSessionsLibrary::GetSessionSettings(UObject* WorldContextObject, i
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOnlineSessionSettings* settings = SessionInterface->GetSessionSettings(NAME_GameSession);
|
FOnlineSessionSettings* settings = SessionInterface->GetSessionSettings(GameSessionName);
|
||||||
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!"));
|
||||||
@@ -181,10 +140,9 @@ void UAdvancedSessionsLibrary::GetSessionSettings(UObject* WorldContextObject, i
|
|||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::IsPlayerInSession(UObject* WorldContextObject, const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession)
|
void UAdvancedSessionsLibrary::IsPlayerInSession(const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession)
|
||||||
{
|
{
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -193,7 +151,7 @@ void UAdvancedSessionsLibrary::IsPlayerInSession(UObject* WorldContextObject, co
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bIsInSession = SessionInterface->IsPlayerInSession(NAME_GameSession, *PlayerToCheck.GetUniqueNetId());
|
bIsInSession = SessionInterface->IsPlayerInSession(GameSessionName, *PlayerToCheck.GetUniqueNetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
FSessionsSearchSetting UAdvancedSessionsLibrary::MakeLiteralSessionSearchProperty(FSessionPropertyKeyPair SessionSearchProperty, EOnlineComparisonOpRedux ComparisonOp)
|
FSessionsSearchSetting UAdvancedSessionsLibrary::MakeLiteralSessionSearchProperty(FSessionPropertyKeyPair SessionSearchProperty, EOnlineComparisonOpRedux ComparisonOp)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
|
|
||||||
#include "CancelFindSessionsCallbackProxy.h"
|
#include "CancelFindSessionsCallbackProxy.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
|||||||
{
|
{
|
||||||
if (PlayerControllerWeakPtr.IsValid() && Helper.UserID.IsValid())
|
if (PlayerControllerWeakPtr.IsValid() && Helper.UserID.IsValid())
|
||||||
{
|
{
|
||||||
Sessions->CreateSession(*Helper.UserID, NAME_GameSession, Settings);
|
Sessions->CreateSession(*Helper.UserID, GameSessionName, Settings);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -95,7 +95,7 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Sessions->CreateSession(0, NAME_GameSession, Settings);
|
Sessions->CreateSession(0, GameSessionName, 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(NAME_GameSession);
|
Sessions->StartSession(GameSessionName);
|
||||||
|
|
||||||
// OnStartCompleted will get called, nothing more to do now
|
// OnStartCompleted will get called, nothing more to do now
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
|
|
||||||
#include "EndSessionCallbackProxy.h"
|
#include "EndSessionCallbackProxy.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -29,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(NAME_GameSession);
|
FNamedOnlineSession* Session = Sessions->GetNamedSession(GameSessionName);
|
||||||
if (Session &&
|
if (Session &&
|
||||||
Session->SessionState == EOnlineSessionState::InProgress)
|
Session->SessionState == EOnlineSessionState::InProgress)
|
||||||
{
|
{
|
||||||
DelegateHandle = Sessions->AddOnEndSessionCompleteDelegate_Handle(Delegate);
|
DelegateHandle = Sessions->AddOnEndSessionCompleteDelegate_Handle(Delegate);
|
||||||
Sessions->EndSession(NAME_GameSession);
|
Sessions->EndSession(GameSessionName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ void UFindFriendSessionCallbackProxy::Activate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||||
|
|
||||||
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(GetWorld());
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||||
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle);
|
Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
|
|
||||||
#include "FindSessionsCallbackProxyAdvanced.h"
|
#include "FindSessionsCallbackProxyAdvanced.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::Update
|
|||||||
void UUpdateSessionCallbackProxyAdvanced::Activate()
|
void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||||
{
|
{
|
||||||
|
|
||||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||||
|
|
||||||
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(NAME_GameSession);
|
//FNamedOnlineSession * curSession = Sessions->GetNamedSession(GameSessionName);
|
||||||
FOnlineSessionSettings* Settings = Sessions->GetSessionSettings(NAME_GameSession);
|
FOnlineSessionSettings* Settings = Sessions->GetSessionSettings(GameSessionName);
|
||||||
|
|
||||||
if (!Settings)
|
if (!Settings)
|
||||||
{
|
{
|
||||||
@@ -85,7 +85,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Sessions->UpdateSession(NAME_GameSession, *Settings, bRefreshOnlineData);
|
Sessions->UpdateSession(GameSessionName, *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(GetWorld());
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||||
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.23,
|
"Version" : 4.21,
|
||||||
"VersionName": "4.23",
|
"VersionName": "4.21",
|
||||||
"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",
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
#include "steam/isteamugc.h"
|
|
||||||
#include "steam/isteamremotestorage.h"
|
|
||||||
#endif
|
#endif
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "Interfaces/OnlineSessionInterface.h"
|
||||||
|
|
||||||
@@ -26,16 +24,16 @@
|
|||||||
#pragma push_macro("ARRAY_COUNT")
|
#pragma push_macro("ARRAY_COUNT")
|
||||||
#undef ARRAY_COUNT
|
#undef ARRAY_COUNT
|
||||||
|
|
||||||
#if USING_CODE_ANALYSIS
|
#if USING_CODE_ANALYSIS
|
||||||
MSVC_PRAGMA(warning(push))
|
MSVC_PRAGMA(warning(push))
|
||||||
MSVC_PRAGMA(warning(disable : ALL_CODE_ANALYSIS_WARNINGS))
|
MSVC_PRAGMA(warning(disable : ALL_CODE_ANALYSIS_WARNINGS))
|
||||||
#endif // USING_CODE_ANALYSIS
|
#endif // USING_CODE_ANALYSIS
|
||||||
|
|
||||||
#include <steam/steam_api.h>
|
#include <steam/steam_api.h>
|
||||||
|
|
||||||
#if USING_CODE_ANALYSIS
|
#if USING_CODE_ANALYSIS
|
||||||
MSVC_PRAGMA(warning(pop))
|
MSVC_PRAGMA(warning(pop))
|
||||||
#endif // USING_CODE_ANALYSIS
|
#endif // USING_CODE_ANALYSIS
|
||||||
|
|
||||||
|
|
||||||
#pragma pop_macro("ARRAY_COUNT")
|
#pragma pop_macro("ARRAY_COUNT")
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#include "AdvancedSteamFriendsLibrary.h"
|
#include "AdvancedSteamFriendsLibrary.h"
|
||||||
#include "OnlineSubSystemHeader.h"
|
#include "OnlineSubSystemHeader.h"
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
#include "steam/isteamfriends.h"
|
|
||||||
#endif
|
#endif
|
||||||
//#include "OnlineSubsystemSteamTypes.h"
|
//#include "OnlineSubsystemSteamTypes.h"
|
||||||
|
|
||||||
@@ -30,13 +29,13 @@ USteamRequestGroupOfficersCallbackProxy* USteamRequestGroupOfficersCallbackProxy
|
|||||||
}
|
}
|
||||||
|
|
||||||
void USteamRequestGroupOfficersCallbackProxy::Activate()
|
void USteamRequestGroupOfficersCallbackProxy::Activate()
|
||||||
{
|
{
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes());
|
uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes());
|
||||||
SteamAPICall_t hSteamAPICall = SteamFriends()->RequestClanOfficerList(id);
|
SteamAPICall_t hSteamAPICall = SteamFriends()->RequestClanOfficerList(id);
|
||||||
|
|
||||||
m_callResultGroupOfficerRequestDetails.Set(hSteamAPICall, this, &USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails);
|
m_callResultGroupOfficerRequestDetails.Set(hSteamAPICall, this, &USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -46,76 +45,76 @@ void USteamRequestGroupOfficersCallbackProxy::Activate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#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;
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
{
|
{
|
||||||
SteamSubsystem->ExecuteNextTick([this]()
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
{
|
{
|
||||||
TArray<FBPSteamGroupOfficer> FailureArray;
|
TArray<FBPSteamGroupOfficer> FailureArray;
|
||||||
OnFailure.Broadcast(FailureArray);
|
OnFailure.Broadcast(FailureArray);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//OnFailure.Broadcast(OfficerArray);
|
//OnFailure.Broadcast(OfficerArray);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes());
|
uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes());
|
||||||
|
|
||||||
FBPSteamGroupOfficer Officer;
|
FBPSteamGroupOfficer Officer;
|
||||||
CSteamID ClanOwner = SteamFriends()->GetClanOwner(id);
|
CSteamID ClanOwner = SteamFriends()->GetClanOwner(id);
|
||||||
|
|
||||||
Officer.bIsOwner = true;
|
Officer.bIsOwner = true;
|
||||||
|
|
||||||
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam2(ClanOwner));
|
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam2(ClanOwner));
|
||||||
Officer.OfficerUniqueNetID.SetUniqueNetId(ValueID);
|
Officer.OfficerUniqueNetID.SetUniqueNetId(ValueID);
|
||||||
OfficerArray.Add(Officer);
|
OfficerArray.Add(Officer);
|
||||||
|
|
||||||
for (int i = 0; i < pResult->m_cOfficers; i++)
|
for (int i = 0; i < pResult->m_cOfficers; i++)
|
||||||
{
|
{
|
||||||
CSteamID OfficerSteamID = SteamFriends()->GetClanOfficerByIndex(id, i);
|
CSteamID OfficerSteamID = SteamFriends()->GetClanOfficerByIndex(id, i);
|
||||||
|
|
||||||
Officer.bIsOwner = false;
|
Officer.bIsOwner = false;
|
||||||
|
|
||||||
TSharedPtr<const FUniqueNetId> newValueID(new const FUniqueNetIdSteam2(OfficerSteamID));
|
TSharedPtr<const FUniqueNetId> newValueID(new const FUniqueNetIdSteam2(OfficerSteamID));
|
||||||
Officer.OfficerUniqueNetID.SetUniqueNetId(newValueID);
|
Officer.OfficerUniqueNetID.SetUniqueNetId(newValueID);
|
||||||
|
|
||||||
OfficerArray.Add(Officer);
|
OfficerArray.Add(Officer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
{
|
{
|
||||||
SteamSubsystem->ExecuteNextTick([OfficerArray, this]()
|
SteamSubsystem->ExecuteNextTick([OfficerArray, this]()
|
||||||
{
|
{
|
||||||
OnSuccess.Broadcast(OfficerArray);
|
OnSuccess.Broadcast(OfficerArray);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//OnSuccess.Broadcast(OfficerArray);
|
//OnSuccess.Broadcast(OfficerArray);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
{
|
{
|
||||||
SteamSubsystem->ExecuteNextTick([this]()
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
{
|
{
|
||||||
TArray<FBPSteamGroupOfficer> FailureArray;
|
TArray<FBPSteamGroupOfficer> FailureArray;
|
||||||
OnFailure.Broadcast(FailureArray);
|
OnFailure.Broadcast(FailureArray);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should never hit this anyway
|
// Should never hit this anyway
|
||||||
//OnFailure.Broadcast(OfficerArray);
|
//OnFailure.Broadcast(OfficerArray);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
#include "SteamWSRequestUGCDetailsCallbackProxy.h"
|
#include "SteamWSRequestUGCDetailsCallbackProxy.h"
|
||||||
#include "OnlineSubSystemHeader.h"
|
#include "OnlineSubSystemHeader.h"
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
#include "steam/isteamugc.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
@@ -24,13 +23,13 @@ USteamWSRequestUGCDetailsCallbackProxy* USteamWSRequestUGCDetailsCallbackProxy::
|
|||||||
}
|
}
|
||||||
|
|
||||||
void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
||||||
{
|
{
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
// #TODO: Support arrays instead in the future?
|
// #TODO: Support arrays instead in the future?
|
||||||
UGCQueryHandle_t hQueryHandle = SteamUGC()->CreateQueryUGCDetailsRequest((PublishedFileId_t *)&WorkShopID.SteamWorkshopID, 1);
|
UGCQueryHandle_t hQueryHandle = SteamUGC()->CreateQueryUGCDetailsRequest((PublishedFileId_t *)&WorkShopID.SteamWorkshopID, 1);
|
||||||
// #TODO: add search settings here by calling into the handle?
|
// #TODO: add search settings here by calling into the handle?
|
||||||
SteamAPICall_t hSteamAPICall = SteamUGC()->SendQueryUGCRequest(hQueryHandle);
|
SteamAPICall_t hSteamAPICall = SteamUGC()->SendQueryUGCRequest(hQueryHandle);
|
||||||
|
|
||||||
// Need to release the query
|
// Need to release the query
|
||||||
@@ -50,52 +49,52 @@ void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure)
|
void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure)
|
||||||
{
|
{
|
||||||
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)
|
||||||
{
|
{
|
||||||
if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
{
|
{
|
||||||
SteamSubsystem->ExecuteNextTick([this]()
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
{
|
{
|
||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
SteamUGCDetails_t Details;
|
SteamUGCDetails_t Details;
|
||||||
if (SteamUGC()->GetQueryUGCResult(pResult->m_handle, 0, &Details))
|
if (SteamUGC()->GetQueryUGCResult(pResult->m_handle, 0, &Details))
|
||||||
{
|
{
|
||||||
if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
{
|
{
|
||||||
SteamSubsystem->ExecuteNextTick([Details, this]()
|
SteamSubsystem->ExecuteNextTick([Details, this]()
|
||||||
{
|
{
|
||||||
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
//OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
{
|
{
|
||||||
SteamSubsystem->ExecuteNextTick([this]()
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
{
|
{
|
||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not needed, should never hit here
|
// Not needed, should never hit here
|
||||||
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user