diff --git a/Binaries/Win32/UE4-AdvancedSessions-Win32-DebugGame.lib.REMOVED.git-id b/Binaries/Win32/UE4-AdvancedSessions-Win32-DebugGame.lib.REMOVED.git-id new file mode 100644 index 0000000..163d32a --- /dev/null +++ b/Binaries/Win32/UE4-AdvancedSessions-Win32-DebugGame.lib.REMOVED.git-id @@ -0,0 +1 @@ +a76786bb53d1bc69ee7cdab9e4aa673802d31bf2 \ No newline at end of file diff --git a/Binaries/Win32/UE4-AdvancedSessions-Win32-Shipping.lib.REMOVED.git-id b/Binaries/Win32/UE4-AdvancedSessions-Win32-Shipping.lib.REMOVED.git-id new file mode 100644 index 0000000..b3807e2 --- /dev/null +++ b/Binaries/Win32/UE4-AdvancedSessions-Win32-Shipping.lib.REMOVED.git-id @@ -0,0 +1 @@ +21bebdf84ebf3baa91d180db157a1f2e0dfbc4c0 \ No newline at end of file diff --git a/Binaries/Win32/UE4-AdvancedSessions.lib.REMOVED.git-id b/Binaries/Win32/UE4-AdvancedSessions.lib.REMOVED.git-id new file mode 100644 index 0000000..9652fcb --- /dev/null +++ b/Binaries/Win32/UE4-AdvancedSessions.lib.REMOVED.git-id @@ -0,0 +1 @@ +4ace3e4516cc2a4e8f0b950cd9ceb22f25edfd00 \ No newline at end of file diff --git a/Binaries/Win64/UE4-AdvancedSessions-Win64-DebugGame.lib.REMOVED.git-id b/Binaries/Win64/UE4-AdvancedSessions-Win64-DebugGame.lib.REMOVED.git-id new file mode 100644 index 0000000..6d8ed93 --- /dev/null +++ b/Binaries/Win64/UE4-AdvancedSessions-Win64-DebugGame.lib.REMOVED.git-id @@ -0,0 +1 @@ +d2f96ab9defedded126a4780a18c04ff4d92b8bc \ No newline at end of file diff --git a/Binaries/Win64/UE4-AdvancedSessions-Win64-Shipping.lib.REMOVED.git-id b/Binaries/Win64/UE4-AdvancedSessions-Win64-Shipping.lib.REMOVED.git-id new file mode 100644 index 0000000..2b6587f --- /dev/null +++ b/Binaries/Win64/UE4-AdvancedSessions-Win64-Shipping.lib.REMOVED.git-id @@ -0,0 +1 @@ +aff3301f274803705d0ef3315be24a6b3be274cf \ No newline at end of file diff --git a/Binaries/Win64/UE4-AdvancedSessions.lib.REMOVED.git-id b/Binaries/Win64/UE4-AdvancedSessions.lib.REMOVED.git-id new file mode 100644 index 0000000..23ee66c --- /dev/null +++ b/Binaries/Win64/UE4-AdvancedSessions.lib.REMOVED.git-id @@ -0,0 +1 @@ +e3d98226a589c3853040dbd109aec7be7dcc3742 \ No newline at end of file diff --git a/Binaries/Win64/UE4Editor-AdvancedSessions-Win64-DebugGame.dll b/Binaries/Win64/UE4Editor-AdvancedSessions-Win64-DebugGame.dll new file mode 100644 index 0000000..0cac63c Binary files /dev/null and b/Binaries/Win64/UE4Editor-AdvancedSessions-Win64-DebugGame.dll differ diff --git a/Binaries/Win64/UE4Editor-AdvancedSessions-Win64-DebugGame.pdb.REMOVED.git-id b/Binaries/Win64/UE4Editor-AdvancedSessions-Win64-DebugGame.pdb.REMOVED.git-id new file mode 100644 index 0000000..cf16f13 --- /dev/null +++ b/Binaries/Win64/UE4Editor-AdvancedSessions-Win64-DebugGame.pdb.REMOVED.git-id @@ -0,0 +1 @@ +0f13228cdcdc42445bc1fe94748f423a786a21fe \ No newline at end of file diff --git a/Binaries/Win64/UE4Editor-AdvancedSessions.dll b/Binaries/Win64/UE4Editor-AdvancedSessions.dll new file mode 100644 index 0000000..ead71b0 Binary files /dev/null and b/Binaries/Win64/UE4Editor-AdvancedSessions.dll differ diff --git a/Binaries/Win64/UE4Editor-AdvancedSessions.pdb.REMOVED.git-id b/Binaries/Win64/UE4Editor-AdvancedSessions.pdb.REMOVED.git-id new file mode 100644 index 0000000..7f6d332 --- /dev/null +++ b/Binaries/Win64/UE4Editor-AdvancedSessions.pdb.REMOVED.git-id @@ -0,0 +1 @@ +a9c3ed5d5005d7bc7bc08b55f03238128b11d6f4 \ No newline at end of file diff --git a/Binaries/Win64/UE4Editor-Win64-DebugGame.modules b/Binaries/Win64/UE4Editor-Win64-DebugGame.modules new file mode 100644 index 0000000..b884360 --- /dev/null +++ b/Binaries/Win64/UE4Editor-Win64-DebugGame.modules @@ -0,0 +1,8 @@ +{ + "Changelist" : 3142249, + "BuildId" : "8ec6c032-25a1-4060-b513-5852f4db170c", + "Modules" : + { + "AdvancedSessions" : "UE4Editor-AdvancedSessions-Win64-DebugGame.dll" + } +} \ No newline at end of file diff --git a/Binaries/Win64/UE4Editor.modules b/Binaries/Win64/UE4Editor.modules new file mode 100644 index 0000000..acc1eda --- /dev/null +++ b/Binaries/Win64/UE4Editor.modules @@ -0,0 +1,8 @@ +{ + "Changelist" : 3142249, + "BuildId" : "049386af-3641-4a3d-b799-3557f9ac0157", + "Modules" : + { + "AdvancedSessions" : "UE4Editor-AdvancedSessions.dll" + } +} \ No newline at end of file diff --git a/Source/AdvancedSessions/Classes/BlueprintDataDefinitions.h b/Source/AdvancedSessions/Classes/BlueprintDataDefinitions.h index cce2392..97869bc 100644 --- a/Source/AdvancedSessions/Classes/BlueprintDataDefinitions.h +++ b/Source/AdvancedSessions/Classes/BlueprintDataDefinitions.h @@ -51,11 +51,11 @@ namespace EBPServerPresenceSearchType enum Type { ClientServersOnly, - DedicatedServersOnly + DedicatedServersOnly, + AllServers }; } - // Wanted this to be switchable in the editor UENUM(BlueprintType) namespace EBPOnlinePresenceState diff --git a/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h b/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h index cd167bc..55daee6 100644 --- a/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h +++ b/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h @@ -21,7 +21,7 @@ class UFindSessionsCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase // Searches for advertised sessions with the default online subsystem and includes an array of filters UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject", AutoCreateRefTerm="Filters"), Category = "Online|AdvancedSessions") - static UFindSessionsCallbackProxyAdvanced* FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int32 MaxResults, bool bUseLAN, TEnumAsByte ServerTypeToSearch, const TArray &Filters); + static UFindSessionsCallbackProxyAdvanced* FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int32 MaxResults, bool bUseLAN, TEnumAsByte ServerTypeToSearch, const TArray &Filters, bool bEmptyServersOnly = false, bool bNonEmptyServersOnly = false, bool bSecureServersOnly = false, int MinSlotsAvailable = 0); static bool CompareVariants(const FVariantData &A, const FVariantData &B, EOnlineComparisonOpRedux::Type Comparator); @@ -76,6 +76,18 @@ private: // Store extra settings TArray SearchSettings; + // Search for empty servers only + bool bEmptyServersOnly; + + // Search for non empty servers only + bool bNonEmptyServersOnly; + + // Search for secure servers only + bool bSecureServersOnly; + + // Min slots requires to search + int MinSlotsAvailable; + // The world context object in which this call is taking place UObject* WorldContextObject; }; diff --git a/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp b/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp index 4dbb574..4fde1db 100644 --- a/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp +++ b/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp @@ -53,9 +53,14 @@ void UCreateSessionCallbackProxyAdvanced::Activate() Settings.bShouldAdvertise = true; Settings.bAllowJoinInProgress = true; Settings.bIsLANMatch = bUseLAN; - Settings.bUsesPresence = bUsePresence; Settings.bAllowJoinViaPresence = true; Settings.bIsDedicated = bDedicatedServer; + + if (bDedicatedServer) + Settings.bUsesPresence = false; + else + Settings.bUsesPresence = bUsePresence; + Settings.bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly; Settings.bAntiCheatProtected = bAntiCheatProtected; Settings.bUsesStats = bUsesStats; diff --git a/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp b/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp index e4d78a9..f9b4a8e 100644 --- a/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp +++ b/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp @@ -14,7 +14,7 @@ UFindSessionsCallbackProxyAdvanced::UFindSessionsCallbackProxyAdvanced(const FOb { } -UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int MaxResults, bool bUseLAN, TEnumAsByte ServerTypeToSearch, const TArray &Filters) +UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int MaxResults, bool bUseLAN, TEnumAsByte ServerTypeToSearch, const TArray &Filters, bool bEmptyServersOnly, bool bNonEmptyServersOnly, bool bSecureServersOnly, int MinSlotsAvailable) { UFindSessionsCallbackProxyAdvanced* Proxy = NewObject(); Proxy->PlayerControllerWeakPtr = PlayerController; @@ -23,6 +23,10 @@ UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSess Proxy->WorldContextObject = WorldContextObject; Proxy->SearchSettings = Filters; Proxy->ServerSearchType = ServerTypeToSearch; + Proxy->bEmptyServersOnly = bEmptyServersOnly, + Proxy->bNonEmptyServersOnly = bNonEmptyServersOnly; + Proxy->bSecureServersOnly = bSecureServersOnly; + Proxy->MinSlotsAvailable = MinSlotsAvailable; return Proxy; } @@ -46,6 +50,37 @@ void UFindSessionsCallbackProxyAdvanced::Activate() // Create temp filter variable, because I had to re-define a blueprint version of this, it is required. FOnlineSearchSettingsEx tem; + /* // Search only for dedicated servers (value is true/false) +#define SEARCH_DEDICATED_ONLY FName(TEXT("DEDICATEDONLY")) + // Search for empty servers only (value is true/false) +#define SEARCH_EMPTY_SERVERS_ONLY FName(TEXT("EMPTYONLY")) + // Search for non empty servers only (value is true/false) +#define SEARCH_NONEMPTY_SERVERS_ONLY FName(TEXT("NONEMPTYONLY")) + // Search for secure servers only (value is true/false) +#define SEARCH_SECURE_SERVERS_ONLY FName(TEXT("SECUREONLY")) + // Search for presence sessions only (value is true/false) +#define SEARCH_PRESENCE FName(TEXT("PRESENCESEARCH")) + // Search for a match with min player availability (value is int) +#define SEARCH_MINSLOTSAVAILABLE FName(TEXT("MINSLOTSAVAILABLE")) + // Exclude all matches where any unique ids in a given array are present (value is string of the form "uniqueid1;uniqueid2;uniqueid3") +#define SEARCH_EXCLUDE_UNIQUEIDS FName(TEXT("EXCLUDEUNIQUEIDS")) + // User ID to search for session of +#define SEARCH_USER FName(TEXT("SEARCHUSER")) + // Keywords to match in session search +#define SEARCH_KEYWORDS FName(TEXT("SEARCHKEYWORDS"))*/ + + if(bEmptyServersOnly) + tem.Set(SEARCH_EMPTY_SERVERS_ONLY, true, EOnlineComparisonOp::Equals); + + if (bNonEmptyServersOnly) + tem.Set(SEARCH_NONEMPTY_SERVERS_ONLY, true, EOnlineComparisonOp::Equals); + + if (bSecureServersOnly) + tem.Set(SEARCH_SECURE_SERVERS_ONLY, true, EOnlineComparisonOp::Equals); + + if (MinSlotsAvailable != 0) + tem.Set(SEARCH_MINSLOTSAVAILABLE, MinSlotsAvailable, EOnlineComparisonOp::GreaterThanEquals); + switch (ServerSearchType) { @@ -56,8 +91,18 @@ void UFindSessionsCallbackProxyAdvanced::Activate() break; case EBPServerPresenceSearchType::DedicatedServersOnly: + { + tem.Set(SEARCH_DEDICATED_ONLY, true, EOnlineComparisonOp::Equals); + } + break; + + case EBPServerPresenceSearchType::AllServers: default: - break; + { + // tem.Set(SEARCH_DEDICATED_ONLY, false, EOnlineComparisonOp::Equals); + // tem.Set(SEARCH_PRESENCE, false, EOnlineComparisonOp::Equals); + } + break; }