From e9a5414de57d768b3c7d4a90aba8b87faf3e94e2 Mon Sep 17 00:00:00 2001 From: Douglas B <33129984+KryptoniteKS@users.noreply.github.com> Date: Tue, 29 Oct 2024 21:48:23 -0400 Subject: [PATCH 1/2] Update SIK_JoinLobby_AsyncFunction.h Remove the Steam Result enum from the delegate, as the callback does not actually have a Steam Result enum --- .../Functions/Matchmaking/SIK_JoinLobby_AsyncFunction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SteamIntegrationKit/Functions/Matchmaking/SIK_JoinLobby_AsyncFunction.h b/Source/SteamIntegrationKit/Functions/Matchmaking/SIK_JoinLobby_AsyncFunction.h index bac57d4..2f67868 100644 --- a/Source/SteamIntegrationKit/Functions/Matchmaking/SIK_JoinLobby_AsyncFunction.h +++ b/Source/SteamIntegrationKit/Functions/Matchmaking/SIK_JoinLobby_AsyncFunction.h @@ -18,7 +18,7 @@ THIRD_PARTY_INCLUDES_END #include "Kismet/BlueprintAsyncActionBase.h" #include "SIK_JoinLobby_AsyncFunction.generated.h" -DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnJoinLobby, TEnumAsByte, Result, bool, bLocked, TEnumAsByte, ChatRoomEnterResponse); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnJoinLobby, bool, bLocked, TEnumAsByte, ChatRoomEnterResponse); UCLASS() class STEAMINTEGRATIONKIT_API USIK_JoinLobby_AsyncFunction : public UBlueprintAsyncActionBase { From d179200f250b2c74c2db2ae03c52ae02780edc88 Mon Sep 17 00:00:00 2001 From: Douglas B <33129984+KryptoniteKS@users.noreply.github.com> Date: Tue, 29 Oct 2024 21:56:01 -0400 Subject: [PATCH 2/2] Update SIK_JoinLobby_AsyncFunction.cpp Removed the Steam Result enum from the broadcasting of the delegate; we were casting from EChatRoomEnterResponse to EResult, which would give unintended consequences. Also removed the use of ESIK_ChatRoomEnterResponse::None, as the Steam API would return ChatRoomEnterResponseError in the event an error occurred. This "None" could cause issues if a user tried to cast back to an EChatRoomEnterResponse. --- .../Matchmaking/SIK_JoinLobby_AsyncFunction.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/SteamIntegrationKit/Functions/Matchmaking/SIK_JoinLobby_AsyncFunction.cpp b/Source/SteamIntegrationKit/Functions/Matchmaking/SIK_JoinLobby_AsyncFunction.cpp index 0bfde50..942d47a 100644 --- a/Source/SteamIntegrationKit/Functions/Matchmaking/SIK_JoinLobby_AsyncFunction.cpp +++ b/Source/SteamIntegrationKit/Functions/Matchmaking/SIK_JoinLobby_AsyncFunction.cpp @@ -19,19 +19,18 @@ void USIK_JoinLobby_AsyncFunction::OnLobbyEnter(LobbyEnter_t* LobbyEnter, bool b { if(bIOFailure) { - OnFailure.Broadcast(ESIK_Result::ResultFail, false, ESIK_ChatRoomEnterResponse::None); + OnFailure.Broadcast(false, ESIK_ChatRoomEnterResponse::ChatRoomEnterResponseError); } else { TEnumAsByte ChatRoomEnterResponse = static_cast(Param.m_EChatRoomEnterResponse); - TEnumAsByte Result = static_cast(Param.m_EChatRoomEnterResponse); if(Param.m_EChatRoomEnterResponse == k_EChatRoomEnterResponseSuccess) { - OnSuccess.Broadcast(Result, Param.m_bLocked, ChatRoomEnterResponse); + OnSuccess.Broadcast(Param.m_bLocked, ChatRoomEnterResponse); } else { - OnFailure.Broadcast(ESIK_Result::ResultFail, false, ChatRoomEnterResponse); + OnFailure.Broadcast(false, ChatRoomEnterResponse); } } }); @@ -45,7 +44,7 @@ void USIK_JoinLobby_AsyncFunction::Activate() Super::Activate(); if(!SteamMatchmaking()) { - OnFailure.Broadcast(ESIK_Result::ResultFail, false, ESIK_ChatRoomEnterResponse::None); + OnFailure.Broadcast(false, ESIK_ChatRoomEnterResponse::ChatRoomEnterResponseError); SetReadyToDestroy(); MarkAsGarbage(); return; @@ -53,7 +52,7 @@ void USIK_JoinLobby_AsyncFunction::Activate() CallbackHandle = SteamMatchmaking()->JoinLobby(Var_LobbyId.GetSteamID()); if(CallbackHandle == k_uAPICallInvalid) { - OnFailure.Broadcast(ESIK_Result::ResultFail, false, ESIK_ChatRoomEnterResponse::None); + OnFailure.Broadcast(false, ESIK_ChatRoomEnterResponse::ChatRoomEnterResponseError); SetReadyToDestroy(); MarkAsGarbage(); return;