mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-12-11 16:43:03 +00:00
Compare commits
4 Commits
4.26-Locke
...
4.24_Locke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
707c055f49 | ||
|
|
aee6c013d6 | ||
|
|
064c1a989d | ||
|
|
6b315302e2 |
@@ -2,8 +2,8 @@
|
|||||||
"FileVersion" : 3,
|
"FileVersion" : 3,
|
||||||
|
|
||||||
"FriendlyName" : "Advanced Sessions",
|
"FriendlyName" : "Advanced Sessions",
|
||||||
"Version" : 4.26,
|
"Version" : 4.24,
|
||||||
"VersionName": "4.26",
|
"VersionName": "4.24",
|
||||||
"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",
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include "Engine/GameInstance.h"
|
#include "Engine/GameInstance.h"
|
||||||
#include "GameFramework/GameModeBase.h"
|
#include "GameFramework/GameModeBase.h"
|
||||||
#include "GameFramework/GameSession.h"
|
#include "GameFramework/GameSession.h"
|
||||||
#include "GameFramework/PlayerState.h"
|
|
||||||
|
|
||||||
//#include "UObjectIterator.h"
|
//#include "UObjectIterator.h"
|
||||||
|
|
||||||
|
|||||||
@@ -200,17 +200,6 @@ public:
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adding in a compare operator so that std functions will work with this struct
|
|
||||||
FORCEINLINE bool operator==(const FBPUniqueNetId& Other) const
|
|
||||||
{
|
|
||||||
return (IsValid() && Other.IsValid() && (*GetUniqueNetId() == *Other.GetUniqueNetId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
FORCEINLINE bool operator!=(const FBPUniqueNetId& Other) const
|
|
||||||
{
|
|
||||||
return !(IsValid() && Other.IsValid() && (*GetUniqueNetId() == *Other.GetUniqueNetId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
FBPUniqueNetId()
|
FBPUniqueNetId()
|
||||||
{
|
{
|
||||||
bUseDirectPointer = false;
|
bUseDirectPointer = false;
|
||||||
@@ -351,7 +340,7 @@ public:
|
|||||||
//return const_cast<FUniqueNetId*>(UniqueNetIdPtr);
|
//return const_cast<FUniqueNetId*>(UniqueNetIdPtr);
|
||||||
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
||||||
{
|
{
|
||||||
UserID = PlayerState->GetUniqueId().GetUniqueNetId();
|
UserID = PlayerState->UniqueId.GetUniqueNetId();
|
||||||
if (!UserID.IsValid())
|
if (!UserID.IsValid())
|
||||||
{
|
{
|
||||||
FFrame::KismetExecutionMessage(*FString::Printf(TEXT("%s - Cannot map local player to unique net ID"), FunctionContext), ELogVerbosity::Warning);
|
FFrame::KismetExecutionMessage(*FString::Printf(TEXT("%s - Cannot map local player to unique net ID"), FunctionContext), ELogVerbosity::Warning);
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ void UAdvancedFriendsGameInstance::OnSessionInviteReceivedMaster(const FUniqueNe
|
|||||||
int32 LocalPlayer = 0;
|
int32 LocalPlayer = 0;
|
||||||
for (int i = 0; i < PlayerList.Num(); i++)
|
for (int i = 0; i < PlayerList.Num(); i++)
|
||||||
{
|
{
|
||||||
if (*PlayerList[i]->PlayerState->GetUniqueId().GetUniqueNetId() == PersonInvited)
|
if (*PlayerList[i]->PlayerState->UniqueId.GetUniqueNetId() == PersonInvited)
|
||||||
{
|
{
|
||||||
LocalPlayer = i;
|
LocalPlayer = i;
|
||||||
Player = PlayerList[i];
|
Player = PlayerList[i];
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ void UAdvancedSessionsLibrary::GetUniqueNetID(APlayerController *PlayerControlle
|
|||||||
|
|
||||||
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
||||||
{
|
{
|
||||||
UniqueNetId.SetUniqueNetId(PlayerState->GetUniqueId().GetUniqueNetId());
|
UniqueNetId.SetUniqueNetId(PlayerState->UniqueId.GetUniqueNetId());
|
||||||
if (!UniqueNetId.IsValid())
|
if (!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetUniqueNetIdFromController couldn't get the player uniquenetid!"));
|
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetUniqueNetIdFromController couldn't get the player uniquenetid!"));
|
||||||
@@ -459,7 +459,7 @@ void UAdvancedSessionsLibrary::GetUniqueNetIDFromPlayerState(APlayerState *Playe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UniqueNetId.SetUniqueNetId(PlayerState->GetUniqueId().GetUniqueNetId());
|
UniqueNetId.SetUniqueNetId(PlayerState->UniqueId.GetUniqueNetId());
|
||||||
if (!UniqueNetId.IsValid())
|
if (!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetUniqueNetIdFromPlayerState couldn't get the player uniquenetid!"));
|
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetUniqueNetIdFromPlayerState couldn't get the player uniquenetid!"));
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
|||||||
Settings.bShouldAdvertise = true;
|
Settings.bShouldAdvertise = true;
|
||||||
Settings.bAllowJoinInProgress = true;
|
Settings.bAllowJoinInProgress = true;
|
||||||
Settings.bIsLANMatch = bUseLAN;
|
Settings.bIsLANMatch = bUseLAN;
|
||||||
Settings.bAllowJoinViaPresence = bAllowJoinViaPresence;
|
Settings.bAllowJoinViaPresence = true;
|
||||||
Settings.bIsDedicated = bDedicatedServer;
|
Settings.bIsDedicated = bDedicatedServer;
|
||||||
|
|
||||||
if (bDedicatedServer)
|
if (bDedicatedServer)
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"FileVersion" : 3,
|
"FileVersion" : 3,
|
||||||
|
|
||||||
"FriendlyName" : "Advanced Steam Sessions",
|
"FriendlyName" : "Advanced Steam Sessions",
|
||||||
"Version" : 4.26,
|
"Version" : 4.24,
|
||||||
"VersionName": "4.26",
|
"VersionName": "4.24",
|
||||||
"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",
|
||||||
|
|||||||
@@ -305,19 +305,6 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
UENUM(Blueprintable)
|
|
||||||
enum class EBPTextFilteringContext : uint8
|
|
||||||
{
|
|
||||||
/*Unknown context.*/
|
|
||||||
FContext_Unknown = 0,
|
|
||||||
/*Game content, only legally required filtering is performed.*/
|
|
||||||
FContext_GameContent = 1,
|
|
||||||
/*Char from another player.*/
|
|
||||||
FContext_Chat = 2,
|
|
||||||
/*Character or item name.*/
|
|
||||||
FContext_Name = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class UAdvancedSteamFriendsLibrary : public UBlueprintFunctionLibrary
|
class UAdvancedSteamFriendsLibrary : public UBlueprintFunctionLibrary
|
||||||
{
|
{
|
||||||
@@ -338,10 +325,6 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
||||||
static bool OpenSteamUserOverlay(const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType);
|
static bool OpenSteamUserOverlay(const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType);
|
||||||
|
|
||||||
// Returns if the steam overlay is currently active (this can return false during initial overlay hooking)
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedFriends|SteamAPI")
|
|
||||||
static bool IsOverlayEnabled();
|
|
||||||
|
|
||||||
// Gets the level of a friends steam account, STEAM ONLY, Returns -1 if the steam level is not known, might need RequestSteamFriendInfo called first.
|
// Gets the level of a friends steam account, STEAM ONLY, Returns -1 if the steam level is not known, might need RequestSteamFriendInfo called first.
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
||||||
static int32 GetFriendSteamLevel(const FBPUniqueNetId UniqueNetId);
|
static int32 GetFriendSteamLevel(const FBPUniqueNetId UniqueNetId);
|
||||||
@@ -367,21 +350,4 @@ public:
|
|||||||
// Get a full list of steam groups
|
// Get a full list of steam groups
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|SteamAPI|SteamGroups")
|
UFUNCTION(BlueprintCallable, Category = "Online|SteamAPI|SteamGroups")
|
||||||
static void GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups);
|
static void GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups);
|
||||||
|
|
||||||
// Initializes text filtering (pre-loading dictonaries)
|
|
||||||
// Returns if it succeeded, false if filtering is unavailable for the games language
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|SteamAPI|TextFiltering")
|
|
||||||
static bool InitTextFiltering();
|
|
||||||
|
|
||||||
// Attempts to filter a string with the given filtering context
|
|
||||||
// Returns true if the text has been filtered, false if it hasn't (no filtering required or operation failed)
|
|
||||||
// If false it will still output the original text
|
|
||||||
// Textsource is the steam id that is the source of the text (player name / chat)
|
|
||||||
// Requires that InitTextFiltering be called first!!
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|SteamAPI|TextFiltering")
|
|
||||||
static bool FilterText(FString TextToFilter, EBPTextFilteringContext Context, const FBPUniqueNetId TextSourceID, FString& FilteredText);
|
|
||||||
|
|
||||||
// Returns if steam is running in big picture mode
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|SteamAPI")
|
|
||||||
static bool IsSteamInBigPictureMode();
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -255,19 +255,6 @@ bool UAdvancedSteamFriendsLibrary::OpenSteamUserOverlay(const FBPUniqueNetId Uni
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::IsOverlayEnabled()
|
|
||||||
{
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
if (SteamAPI_Init())
|
|
||||||
{
|
|
||||||
return SteamUtils()->IsOverlayEnabled();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("OpenSteamUserOverlay Couldn't init steamAPI!"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueNetId UniqueNetId, EBlueprintAsyncResultSwitch &Result, SteamAvatarSize AvatarSize)
|
UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueNetId UniqueNetId, EBlueprintAsyncResultSwitch &Result, SteamAvatarSize AvatarSize)
|
||||||
{
|
{
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
@@ -364,65 +351,3 @@ UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueN
|
|||||||
Result = EBlueprintAsyncResultSwitch::OnFailure;
|
Result = EBlueprintAsyncResultSwitch::OnFailure;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::InitTextFiltering()
|
|
||||||
{
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
|
||||||
{
|
|
||||||
return SteamUtils()->InitFilterText();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::FilterText(FString TextToFilter, EBPTextFilteringContext Context, const FBPUniqueNetId TextSourceID, FString& FilteredText)
|
|
||||||
{
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
|
||||||
{
|
|
||||||
uint32 BufferLen = TextToFilter.Len() + 10; // Docs say 1 byte excess min, going with 10
|
|
||||||
char* OutText = new char[BufferLen];
|
|
||||||
|
|
||||||
uint64 id = 0;
|
|
||||||
|
|
||||||
if (TextSourceID.IsValid())
|
|
||||||
{
|
|
||||||
id = *((uint64*)TextSourceID.UniqueNetId->GetBytes());
|
|
||||||
}
|
|
||||||
|
|
||||||
int FilterCount = SteamUtils()->FilterText(OutText, BufferLen, TCHAR_TO_ANSI(*TextToFilter), Context == EBPTextFilteringContext::FContext_GameContent);
|
|
||||||
|
|
||||||
if (FilterCount > 0)
|
|
||||||
{
|
|
||||||
FilteredText = FString(UTF8_TO_TCHAR(OutText));
|
|
||||||
delete[] OutText;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete[] OutText;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FilteredText = TextToFilter;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::IsSteamInBigPictureMode()
|
|
||||||
{
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
|
||||||
{
|
|
||||||
return SteamUtils()->IsSteamInBigPictureMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
**KantanDocGen Automatic Documentation ([KantanDocGen](http://kantandev.com/free/kantan-doc-gen))**
|
**KantanDocGen Automatic Documentation ([KantanDocGen](http://kantandev.com/free/kantan-doc-gen))**
|
||||||
|
|
||||||
**[AdvancedSessions](https://vreue4.com/generated-node-documentation?section=advanced-sessions-plugin)**
|
**[AdvancedSessions](https://mordentral.bitbucket.io/AdvancedSessions/Advanced)**
|
||||||
|
|
||||||
**[AdvancedSteamSessions](https://vreue4.com/generated-node-documentation?section=advanced-steam-sessions-plugin)**
|
**[AdvancedSteamSessions](https://mordentral.bitbucket.io/AdvancedSteamSessions/Advanced)**
|
||||||
|
|||||||
Reference in New Issue
Block a user