diff --git a/Content/Assets/NormieAsset/Test_anim.uasset b/Content/Assets/NormieAsset/Test_anim.uasset index 5fb8fda..22f59f0 100644 --- a/Content/Assets/NormieAsset/Test_anim.uasset +++ b/Content/Assets/NormieAsset/Test_anim.uasset Binary files differ diff --git a/Content/Levels/MainMenu_Level.umap b/Content/Levels/MainMenu_Level.umap index 757a21e..64ad8ae 100644 --- a/Content/Levels/MainMenu_Level.umap +++ b/Content/Levels/MainMenu_Level.umap Binary files differ diff --git a/Content/Levels/StartMap.umap b/Content/Levels/StartMap.umap index 3d59f43..5585139 100644 --- a/Content/Levels/StartMap.umap +++ b/Content/Levels/StartMap.umap Binary files differ diff --git a/Content/NunoContent/Menus/Widgets/MainMenu_Widget.uasset b/Content/NunoContent/Menus/Widgets/MainMenu_Widget.uasset index 96871b7..7340ced 100644 --- a/Content/NunoContent/Menus/Widgets/MainMenu_Widget.uasset +++ b/Content/NunoContent/Menus/Widgets/MainMenu_Widget.uasset Binary files differ diff --git a/Content/PlaneTest/Targets_BP.uasset b/Content/PlaneTest/Targets_BP.uasset index 1dffec1..6b26b72 100644 --- a/Content/PlaneTest/Targets_BP.uasset +++ b/Content/PlaneTest/Targets_BP.uasset Binary files differ diff --git a/Content/ScoreGameMode_BP.uasset b/Content/ScoreGameMode_BP.uasset index 231820c..a66c48b 100644 --- a/Content/ScoreGameMode_BP.uasset +++ b/Content/ScoreGameMode_BP.uasset Binary files differ diff --git a/Source/SkyFrontier/Private/MatchmakingJob.cpp b/Source/SkyFrontier/Private/MatchmakingJob.cpp index e3fbd1d..db36467 100644 --- a/Source/SkyFrontier/Private/MatchmakingJob.cpp +++ b/Source/SkyFrontier/Private/MatchmakingJob.cpp @@ -7,8 +7,9 @@ #pragma optimize("", off) -MatchmakingJob::MatchmakingJob(FString& stateToWriteInto) +MatchmakingJob::MatchmakingJob(FString& stateToWriteInto, FString LevelName) : currentState(stateToWriteInto) + , LevelToLoad(LevelName) {} bool MatchmakingJob::Init() @@ -45,7 +46,7 @@ if(!ConnectionSocket->Send(reinterpret_cast(TCHAR_TO_UTF8(serializedChar)), Size, Sent)) { // Some Error Message - JobCompletedEvent.Broadcast(false, ""); + JobCompletedEvent.Broadcast(false, "", ""); return 1; // Returns an exit code, you can use this to figure out where something failed or the type of failure } @@ -67,7 +68,7 @@ if(!ConnectionSocket->Recv(ReceiveBuffer, 128, BytesRead)) { // Some Error Use something like FScoket::GetLastError (I dont remember the exact syntax) ESocketError Return Type - JobCompletedEvent.Broadcast(false, ""); + JobCompletedEvent.Broadcast(false, "", ""); return 2; } // Reinterpret the bits back into a const char* and apply it to the FString @@ -89,12 +90,12 @@ if(!ConnectionSocket->Send(reinterpret_cast(TCHAR_TO_UTF8(serializedChar)), Size, Sent)) { // Some Error Message - JobCompletedEvent.Broadcast(false, ""); + JobCompletedEvent.Broadcast(false, "", ""); return 3; } #pragma endregion - JobCompletedEvent.Broadcast(true, FullMessage); + JobCompletedEvent.Broadcast(true, "Server IP", LevelToLoad); return 0; // return the error! None in this case! :D } diff --git a/Source/SkyFrontier/Private/MatchmakingSubsystem.cpp b/Source/SkyFrontier/Private/MatchmakingSubsystem.cpp index ac0ab95..1396c1d 100644 --- a/Source/SkyFrontier/Private/MatchmakingSubsystem.cpp +++ b/Source/SkyFrontier/Private/MatchmakingSubsystem.cpp @@ -11,17 +11,17 @@ Super::Initialize(Collection); } -void UMatchmakingSubsystem::RequestGame() +void UMatchmakingSubsystem::RequestGame(FString LevelName) { - FindMatchJob = new MatchmakingJob(CurrentState); + FindMatchJob = new MatchmakingJob(CurrentState, LevelName); FindMatchJob->JobCompletedEvent.AddUFunction(this, "OnMatchmakerThreadDone"); FRunnableThread::Create(FindMatchJob, TEXT("FindMatchJob")); } -void UMatchmakingSubsystem::OnMatchmakerThreadDone(bool CompletionState, FString ServerIP) +void UMatchmakingSubsystem::OnMatchmakerThreadDone(bool CompletionState, FString ServerIP, FString LevelName) { if(CompletionState) - MatchFoundEvent.Broadcast(ServerIP); + MatchFoundEvent.Broadcast(ServerIP, LevelName); else ServerToConnectTo = "Failed To Connect!"; } diff --git a/Source/SkyFrontier/Public/MatchmakingJob.h b/Source/SkyFrontier/Public/MatchmakingJob.h index 4977569..97a326b 100644 --- a/Source/SkyFrontier/Public/MatchmakingJob.h +++ b/Source/SkyFrontier/Public/MatchmakingJob.h @@ -5,7 +5,7 @@ #include "CoreMinimal.h" // Bool if it did it's job correctly and the ip:port to connect to. -DECLARE_MULTICAST_DELEGATE_TwoParams(FOnMatchMakerThreadCompleted, bool, FString); +DECLARE_MULTICAST_DELEGATE_ThreeParams(FOnMatchMakerThreadCompleted, bool, FString, FString); // Declaration Of All The Messages The Clients Are Allowed To Send AKA The Message ID's #define CLIENT_MESSAGE_REQUESTCONNECTION 1 @@ -17,7 +17,7 @@ // Dissalow default construction of this objects // Simple example, but you could control the copy/move contructors and copy/move operators too! MatchmakingJob(); - explicit MatchmakingJob(FString& stateToWriteInto); + explicit MatchmakingJob(FString& stateToWriteInto, FString LevelName); private: // Do your setup here, allocate memory, ect. @@ -37,6 +37,9 @@ // Reference To Strings That Exist In The Matchmaking System, Thread Writes Directly Into Them! FString& currentState; + // Level To Load + FString LevelToLoad; + // Pointer To Our Current Socket Object FSocket* ConnectionSocket; diff --git a/Source/SkyFrontier/Public/MatchmakingSubsystem.h b/Source/SkyFrontier/Public/MatchmakingSubsystem.h index 067e43d..749ea31 100644 --- a/Source/SkyFrontier/Public/MatchmakingSubsystem.h +++ b/Source/SkyFrontier/Public/MatchmakingSubsystem.h @@ -7,7 +7,7 @@ #include "Subsystems/GameInstanceSubsystem.h" #include "MatchmakingSubsystem.generated.h" -DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMatchFound, FString, ServerIP); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnMatchFound, FString, ServerIP, FString, LevelName); UCLASS() class SKYFRONTIER_API UMatchmakingSubsystem : public UGameInstanceSubsystem @@ -18,11 +18,11 @@ // Start Requesting A Game Launch the thread and the widget can poll the string value for an update till the threads done. UFUNCTION(BlueprintCallable) - void RequestGame(); + void RequestGame(FString LevelName); // Callback From The Thread When It's Done UFUNCTION() - void OnMatchmakerThreadDone(bool CompletionState, FString ServerIP); + void OnMatchmakerThreadDone(bool CompletionState, FString ServerIP, FString LevelName); // String the blueprint widget will look at UPROPERTY(BlueprintReadOnly)