From 9b29df3a227d0489261acf72eda02912a5d8e698 Mon Sep 17 00:00:00 2001 From: PHILIP WHITE Date: Wed, 6 Dec 2023 04:31:22 +0000 Subject: [PATCH] Update Game Instance to Pass Max Players to Request --- CorruptedMemory/Content/Server/BP_ServerMenu.uasset | 4 ++-- CorruptedMemory/Source/CorruptedMemory/CMGameInstance.cpp | 4 ++-- CorruptedMemory/Source/CorruptedMemory/CMGameInstance.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CorruptedMemory/Content/Server/BP_ServerMenu.uasset b/CorruptedMemory/Content/Server/BP_ServerMenu.uasset index 1433d90..a2cae34 100644 --- a/CorruptedMemory/Content/Server/BP_ServerMenu.uasset +++ b/CorruptedMemory/Content/Server/BP_ServerMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2b6023209361bd81256608809d1f600f67957c3719fb717b3c95e59306b4ac04 -size 562037 +oid sha256:3ffff5311b038e01da6998ac24cc2be9f75382d7fc2da894dd6714dd47121ab2 +size 572731 diff --git a/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.cpp b/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.cpp index 56bd485..76ec0c1 100644 --- a/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.cpp +++ b/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.cpp @@ -35,7 +35,7 @@ void UCMGameInstance::Logout() Request->ProcessRequest(); } -void UCMGameInstance::CreateLobby() +void UCMGameInstance::CreateLobby(const int MaxPlayers) { const auto Request = FHttpModule::Get().CreateRequest(); Request->SetURL(LobbyAPI + "/create"); @@ -43,7 +43,7 @@ void UCMGameInstance::CreateLobby() Request->SetHeader("Authorization", "Bearer " + JwtToken); Request->SetHeader("Content-Type", "application/json"); Request->SetHeader("Accept", "application/json"); - Request->SetContentAsString("{\"maxPlayers\":\"4\"}"); + Request->SetContentAsString("{\"maxPlayers\":" + FString::FromInt(MaxPlayers) + "}"); Request->OnProcessRequestComplete().BindUObject(this, &UCMGameInstance::OnRequestToCreateLobbyComplete); Request->ProcessRequest(); } diff --git a/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.h b/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.h index 58fc84e..55acf24 100644 --- a/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.h +++ b/CorruptedMemory/Source/CorruptedMemory/CMGameInstance.h @@ -67,7 +67,7 @@ public: UFUNCTION(BlueprintCallable, Category = "Account") void Logout(); UFUNCTION(BlueprintCallable, Category = "Lobby") - void CreateLobby(); + void CreateLobby(const int MaxPlayers); UFUNCTION(BlueprintCallable, Category = "Lobby") void JoinLobby(); UFUNCTION(BlueprintCallable, Category = "Lobby")