mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-23 00:14:24 +00:00
Merge branch '4.27-Port'
This commit is contained in:
@@ -264,10 +264,18 @@ public:
|
|||||||
EBPOnlinePresenceState PresenceState;
|
EBPOnlinePresenceState PresenceState;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
FString StatusString;
|
FString StatusString;
|
||||||
|
|
||||||
|
FBPFriendPresenceInfo()
|
||||||
|
{
|
||||||
|
bIsOnline = false;
|
||||||
|
bIsPlaying = false;
|
||||||
|
bIsPlayingThisGame = false;
|
||||||
|
bIsJoinable = false;
|
||||||
|
bHasVoiceSupport = false;
|
||||||
|
PresenceState = EBPOnlinePresenceState::Offline;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
USTRUCT(BlueprintType)
|
USTRUCT(BlueprintType)
|
||||||
struct FBPFriendInfo
|
struct FBPFriendInfo
|
||||||
{
|
{
|
||||||
@@ -287,8 +295,15 @@ public:
|
|||||||
bool bIsPlayingSameGame;
|
bool bIsPlayingSameGame;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
FBPFriendPresenceInfo PresenceInfo;
|
FBPFriendPresenceInfo PresenceInfo;
|
||||||
|
|
||||||
|
FBPFriendInfo()
|
||||||
|
{
|
||||||
|
OnlineState = EBPOnlinePresenceState::Offline;
|
||||||
|
bIsPlayingSameGame = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** The types of comparison operations for a given search query */
|
/** The types of comparison operations for a given search query */
|
||||||
// Used to compare session properties
|
// Used to compare session properties
|
||||||
UENUM(BlueprintType)
|
UENUM(BlueprintType)
|
||||||
|
@@ -24,10 +24,11 @@ class UCreateSessionCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase
|
|||||||
* @param PublicConnections When doing a 'listen' server, this must be >=2 (ListenServer itself counts as a connection)
|
* @param PublicConnections When doing a 'listen' server, this must be >=2 (ListenServer itself counts as a connection)
|
||||||
* @param bUseLAN When you want to play LAN, the level to play on must be loaded with option 'bIsLanMatch'
|
* @param bUseLAN When you want to play LAN, the level to play on must be loaded with option 'bIsLanMatch'
|
||||||
* @param bUsePresence Must be true for a 'listen' server (Map must be loaded with option 'listen'), false for a 'dedicated' server.
|
* @param bUsePresence Must be true for a 'listen' server (Map must be loaded with option 'listen'), false for a 'dedicated' server.
|
||||||
|
* @param bUseLobbiesIfAvailable Used to flag the subsystem to use a lobby api instead of general hosting if the API supports it.
|
||||||
* @param bShouldAdvertise Set to true when the OnlineSubsystem should list your server when someone is searching for servers. Otherwise the server is hidden and only join via invite is possible.
|
* @param bShouldAdvertise Set to true when the OnlineSubsystem should list your server when someone is searching for servers. Otherwise the server is hidden and only join via invite is possible.
|
||||||
*/
|
*/
|
||||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject",AutoCreateRefTerm="ExtraSettings"), Category = "Online|AdvancedSessions")
|
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject",AutoCreateRefTerm="ExtraSettings"), Category = "Online|AdvancedSessions")
|
||||||
static UCreateSessionCallbackProxyAdvanced* CreateAdvancedSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, class APlayerController* PlayerController = NULL, int32 PublicConnections = 100, int32 PrivateConnections = 0, bool bUseLAN = false, bool bAllowInvites = true, bool bIsDedicatedServer = false, bool bUsePresence = true, bool bAllowJoinViaPresence = true, bool bAllowJoinViaPresenceFriendsOnly = false, bool bAntiCheatProtected = false, bool bUsesStats = false, bool bShouldAdvertise = true);
|
static UCreateSessionCallbackProxyAdvanced* CreateAdvancedSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, class APlayerController* PlayerController = NULL, int32 PublicConnections = 100, int32 PrivateConnections = 0, bool bUseLAN = false, bool bAllowInvites = true, bool bIsDedicatedServer = false, bool bUsePresence = true, bool bUseLobbiesIfAvailable = false, bool bAllowJoinViaPresence = true, bool bAllowJoinViaPresenceFriendsOnly = false, bool bAntiCheatProtected = false, bool bUsesStats = false, bool bShouldAdvertise = true);
|
||||||
|
|
||||||
// UOnlineBlueprintCallProxyBase interface
|
// UOnlineBlueprintCallProxyBase interface
|
||||||
virtual void Activate() override;
|
virtual void Activate() override;
|
||||||
@@ -71,6 +72,9 @@ private:
|
|||||||
// Whether to use the presence option
|
// Whether to use the presence option
|
||||||
bool bUsePresence;
|
bool bUsePresence;
|
||||||
|
|
||||||
|
// Whether to prefer the use of lobbies for hosting if the api supports them
|
||||||
|
bool bUseLobbiesIfAvailable;
|
||||||
|
|
||||||
// Whether to allow joining via presence
|
// Whether to allow joining via presence
|
||||||
bool bAllowJoinViaPresence;
|
bool bAllowJoinViaPresence;
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ UCreateSessionCallbackProxyAdvanced::UCreateSessionCallbackProxyAdvanced(const F
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
UCreateSessionCallbackProxyAdvanced* UCreateSessionCallbackProxyAdvanced::CreateAdvancedSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, class APlayerController* PlayerController, int32 PublicConnections, int32 PrivateConnections, bool bUseLAN, bool bAllowInvites, bool bIsDedicatedServer, bool bUsePresence, bool bAllowJoinViaPresence, bool bAllowJoinViaPresenceFriendsOnly, bool bAntiCheatProtected, bool bUsesStats, bool bShouldAdvertise)
|
UCreateSessionCallbackProxyAdvanced* UCreateSessionCallbackProxyAdvanced::CreateAdvancedSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, class APlayerController* PlayerController, int32 PublicConnections, int32 PrivateConnections, bool bUseLAN, bool bAllowInvites, bool bIsDedicatedServer, bool bUsePresence, bool bUseLobbiesIfAvailable, bool bAllowJoinViaPresence, bool bAllowJoinViaPresenceFriendsOnly, bool bAntiCheatProtected, bool bUsesStats, bool bShouldAdvertise)
|
||||||
{
|
{
|
||||||
UCreateSessionCallbackProxyAdvanced* Proxy = NewObject<UCreateSessionCallbackProxyAdvanced>();
|
UCreateSessionCallbackProxyAdvanced* Proxy = NewObject<UCreateSessionCallbackProxyAdvanced>();
|
||||||
Proxy->PlayerControllerWeakPtr = PlayerController;
|
Proxy->PlayerControllerWeakPtr = PlayerController;
|
||||||
@@ -25,6 +25,7 @@ UCreateSessionCallbackProxyAdvanced* UCreateSessionCallbackProxyAdvanced::Create
|
|||||||
Proxy->ExtraSettings = ExtraSettings;
|
Proxy->ExtraSettings = ExtraSettings;
|
||||||
Proxy->bDedicatedServer = bIsDedicatedServer;
|
Proxy->bDedicatedServer = bIsDedicatedServer;
|
||||||
Proxy->bUsePresence = bUsePresence;
|
Proxy->bUsePresence = bUsePresence;
|
||||||
|
Proxy->bUseLobbiesIfAvailable = bUseLobbiesIfAvailable;
|
||||||
Proxy->bAllowJoinViaPresence = bAllowJoinViaPresence;
|
Proxy->bAllowJoinViaPresence = bAllowJoinViaPresence;
|
||||||
Proxy->bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly;
|
Proxy->bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly;
|
||||||
Proxy->bAntiCheatProtected = bAntiCheatProtected;
|
Proxy->bAntiCheatProtected = bAntiCheatProtected;
|
||||||
@@ -57,9 +58,15 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
|||||||
Settings.bIsDedicated = bDedicatedServer;
|
Settings.bIsDedicated = bDedicatedServer;
|
||||||
|
|
||||||
if (bDedicatedServer)
|
if (bDedicatedServer)
|
||||||
|
{
|
||||||
Settings.bUsesPresence = false;
|
Settings.bUsesPresence = false;
|
||||||
|
Settings.bUseLobbiesIfAvailable = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Settings.bUsesPresence = bUsePresence;
|
Settings.bUsesPresence = bUsePresence;
|
||||||
|
Settings.bUseLobbiesIfAvailable = bUseLobbiesIfAvailable;
|
||||||
|
}
|
||||||
|
|
||||||
Settings.bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly;
|
Settings.bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly;
|
||||||
Settings.bAntiCheatProtected = bAntiCheatProtected;
|
Settings.bAntiCheatProtected = bAntiCheatProtected;
|
||||||
|
Reference in New Issue
Block a user