6 Commits

Author SHA1 Message Date
mordentral
b7f8e33905 Locking 4.23
Former-commit-id: e3ac783bbfa80aa9cab3742017fc11ed9afa4a59
2019-12-09 10:25:06 -05:00
mordentral
3c4ba2af3b fixed deprecating function call
Former-commit-id: 3b0a2802808bce6cf442f233e5f041d8b0ea3505
2019-10-29 10:12:27 -04:00
mordentral
8744035160 Added world context to a bunch of relevant nodes.
Should likely add it to others in the future as well.


Former-commit-id: c41024927d6525c3c35ff609bdffdb2960b6e3ae
2019-10-29 09:52:28 -04:00
mordentral
71f16cadd2 fixed a compilation issue
Former-commit-id: 2a9d3410b912fa418c62e54561dfe0a60df50c33
2019-10-15 14:20:02 -04:00
mordentral
fdfc2d272f added an include to fix up potential Gengine issues
Former-commit-id: d3b5af9617865f37f3c207ec41e42d1ea107d0c3
2019-10-15 10:07:13 -04:00
mordentral
297848aed8 merging 4.23
Former-commit-id: 15eff386a29a783738c08a95ccced0bf750e7611
2019-09-04 16:22:01 -04:00
16 changed files with 41 additions and 34 deletions

View File

@@ -2,8 +2,8 @@
"FileVersion" : 3, "FileVersion" : 3,
"FriendlyName" : "Advanced Sessions", "FriendlyName" : "Advanced Sessions",
"Version" : 4.22, "Version" : 4.23,
"VersionName": "4.22", "VersionName": "4.23",
"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",

View File

@@ -2,6 +2,7 @@
#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"

View File

@@ -2,6 +2,7 @@
#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"
@@ -38,16 +39,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")
@@ -65,8 +66,8 @@ public:
static void GetSessionID_AsString(const FBlueprintSessionResult & SessionResult, FString& SessionID); static void GetSessionID_AsString(const FBlueprintSessionResult & SessionResult, FString& SessionID);
// Get a string copy of the current session ID // Get a string copy of the current session ID
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo") UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo", meta = (WorldContext = "WorldContextObject"))
static void GetCurrentSessionID_AsString(FString& SessionID); 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")

View File

@@ -1,6 +1,7 @@
// 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"

View File

@@ -2,6 +2,7 @@
#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"

View File

@@ -1,6 +1,7 @@
// 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"

View File

@@ -1,6 +1,7 @@
// 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"

View File

@@ -2,6 +2,7 @@
#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"

View File

@@ -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())
{ {

View File

@@ -1,6 +1,5 @@
// 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"
@@ -25,9 +24,10 @@ void UAdvancedSessionsLibrary::GetSessionID_AsString(const FBlueprintSessionResu
SessionID.Empty(); SessionID.Empty();
} }
void UAdvancedSessionsLibrary::GetCurrentSessionID_AsString(FString& SessionID) void UAdvancedSessionsLibrary::GetCurrentSessionID_AsString(UObject* WorldContextObject, FString& SessionID)
{ {
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(); UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
if (!SessionInterface.IsValid()) if (!SessionInterface.IsValid())
{ {
@@ -126,9 +126,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())
{ {
@@ -139,9 +140,10 @@ void UAdvancedSessionsLibrary::GetSessionState(EBPOnlineSessionState &SessionSta
SessionState = ((EBPOnlineSessionState)SessionInterface->GetSessionState(NAME_GameSession)); 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())
{ {
@@ -179,9 +181,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())
{ {

View File

@@ -1,5 +1,4 @@
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "CancelFindSessionsCallbackProxy.h" #include "CancelFindSessionsCallbackProxy.h"

View File

@@ -1,5 +1,4 @@
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "EndSessionCallbackProxy.h" #include "EndSessionCallbackProxy.h"

View File

@@ -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);

View File

@@ -1,5 +1,4 @@
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "FindSessionsCallbackProxyAdvanced.h" #include "FindSessionsCallbackProxyAdvanced.h"

View File

@@ -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())
{ {
@@ -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);

View File

@@ -2,8 +2,8 @@
"FileVersion" : 3, "FileVersion" : 3,
"FriendlyName" : "Advanced Steam Sessions", "FriendlyName" : "Advanced Steam Sessions",
"Version" : 4.22, "Version" : 4.23,
"VersionName": "4.22", "VersionName": "4.23",
"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",