mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-22 16:04:18 +00:00
fix multiple session results when searching both dedicated and lobbies
fix multiple session results when searching both dedicated and lobbies, its not a problem on steam but with lan and such it returns the same results as it doesn't care about presence.
This commit is contained in:
@@ -7,6 +7,18 @@
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "FindSessionsCallbackProxyAdvanced.generated.h"
|
||||
|
||||
|
||||
FORCEINLINE bool operator==(const FBlueprintSessionResult& A, const FBlueprintSessionResult& B)
|
||||
{
|
||||
return (A.OnlineResult.IsValid() == B.OnlineResult.IsValid() && (A.OnlineResult.GetSessionIdStr() == B.OnlineResult.GetSessionIdStr()));
|
||||
}
|
||||
|
||||
// Adding in a compare operator so that std functions will work with this struct
|
||||
//FORCEINLINE bool operator==(FBlueprintSessionResult& A, FBlueprintSessionResult& B) const
|
||||
//{
|
||||
//return (A.OnlineResult.IsValid() && B.OnlineResult.IsValid() && (A.OnlineResult.GetSessionIdStr() == B.OnlineResult.GetSessionIdStr()));
|
||||
//}
|
||||
|
||||
UCLASS(MinimalAPI)
|
||||
class UFindSessionsCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase
|
||||
{
|
||||
|
@@ -198,7 +198,7 @@ void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess)
|
||||
|
||||
FBlueprintSessionResult BPResult;
|
||||
BPResult.OnlineResult = Result;
|
||||
SessionSearchResults.Add(BPResult);
|
||||
SessionSearchResults.AddUnique(BPResult);
|
||||
}
|
||||
OnSuccess.Broadcast(SessionSearchResults);
|
||||
return;
|
||||
@@ -217,7 +217,7 @@ void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess)
|
||||
|
||||
FBlueprintSessionResult BPResult;
|
||||
BPResult.OnlineResult = Result;
|
||||
SessionSearchResults.Add(BPResult);
|
||||
SessionSearchResults.AddUnique(BPResult);
|
||||
}
|
||||
if (!bRunSecondSearch)
|
||||
{
|
||||
|
Reference in New Issue
Block a user