Committing in a format that will work for direct download.

Added additional search settings to "FindSessionsAdvanced"

Forcing presence off with dedicated servers even if they have it ticked on.


Former-commit-id: dc9cae32716ecf50f6ab6be53c830e2e1ac54a6d
This commit is contained in:
mordentral
2016-10-19 09:43:19 -04:00
parent ff21bd13c0
commit 98f09b81f7
16 changed files with 92 additions and 6 deletions

View File

@@ -0,0 +1 @@
a76786bb53d1bc69ee7cdab9e4aa673802d31bf2

View File

@@ -0,0 +1 @@
21bebdf84ebf3baa91d180db157a1f2e0dfbc4c0

View File

@@ -0,0 +1 @@
4ace3e4516cc2a4e8f0b950cd9ceb22f25edfd00

View File

@@ -0,0 +1 @@
d2f96ab9defedded126a4780a18c04ff4d92b8bc

View File

@@ -0,0 +1 @@
aff3301f274803705d0ef3315be24a6b3be274cf

View File

@@ -0,0 +1 @@
e3d98226a589c3853040dbd109aec7be7dcc3742

View File

@@ -0,0 +1 @@
0f13228cdcdc42445bc1fe94748f423a786a21fe

Binary file not shown.

View File

@@ -0,0 +1 @@
a9c3ed5d5005d7bc7bc08b55f03238128b11d6f4

View File

@@ -0,0 +1,8 @@
{
"Changelist" : 3142249,
"BuildId" : "8ec6c032-25a1-4060-b513-5852f4db170c",
"Modules" :
{
"AdvancedSessions" : "UE4Editor-AdvancedSessions-Win64-DebugGame.dll"
}
}

View File

@@ -0,0 +1,8 @@
{
"Changelist" : 3142249,
"BuildId" : "049386af-3641-4a3d-b799-3557f9ac0157",
"Modules" :
{
"AdvancedSessions" : "UE4Editor-AdvancedSessions.dll"
}
}

View File

@@ -51,11 +51,11 @@ namespace EBPServerPresenceSearchType
enum Type
{
ClientServersOnly,
DedicatedServersOnly
DedicatedServersOnly,
AllServers
};
}
// Wanted this to be switchable in the editor
UENUM(BlueprintType)
namespace EBPOnlinePresenceState

View File

@@ -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<EBPServerPresenceSearchType::Type> ServerTypeToSearch, const TArray<FSessionsSearchSetting> &Filters);
static UFindSessionsCallbackProxyAdvanced* FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int32 MaxResults, bool bUseLAN, TEnumAsByte<EBPServerPresenceSearchType::Type> ServerTypeToSearch, const TArray<FSessionsSearchSetting> &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<FSessionsSearchSetting> 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;
};

View File

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

View File

@@ -14,7 +14,7 @@ UFindSessionsCallbackProxyAdvanced::UFindSessionsCallbackProxyAdvanced(const FOb
{
}
UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int MaxResults, bool bUseLAN, TEnumAsByte<EBPServerPresenceSearchType::Type> ServerTypeToSearch, const TArray<FSessionsSearchSetting> &Filters)
UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int MaxResults, bool bUseLAN, TEnumAsByte<EBPServerPresenceSearchType::Type> ServerTypeToSearch, const TArray<FSessionsSearchSetting> &Filters, bool bEmptyServersOnly, bool bNonEmptyServersOnly, bool bSecureServersOnly, int MinSlotsAvailable)
{
UFindSessionsCallbackProxyAdvanced* Proxy = NewObject<UFindSessionsCallbackProxyAdvanced>();
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;
}