diff --git a/Content/Assets/NormieAsset/Test_anim.uasset b/Content/Assets/NormieAsset/Test_anim.uasset index e8a8de8..9623b61 100644 --- a/Content/Assets/NormieAsset/Test_anim.uasset +++ b/Content/Assets/NormieAsset/Test_anim.uasset Binary files differ diff --git a/Content/Levels/Sergio_Level.umap b/Content/Levels/Sergio_Level.umap index f7ddda5..5db9bc9 100644 --- a/Content/Levels/Sergio_Level.umap +++ b/Content/Levels/Sergio_Level.umap Binary files differ diff --git a/Content/Matchmaking_Widget.uasset b/Content/Matchmaking_Widget.uasset index 7680607..2276959 100644 --- a/Content/Matchmaking_Widget.uasset +++ b/Content/Matchmaking_Widget.uasset Binary files differ diff --git a/Content/NewGameMode_BP.uasset b/Content/NewGameMode_BP.uasset index 45ce29f..5fc3d63 100644 --- a/Content/NewGameMode_BP.uasset +++ b/Content/NewGameMode_BP.uasset Binary files differ diff --git a/Source/SkyFrontier/Private/MyButton.cpp b/Source/SkyFrontier/Private/MyButton.cpp index a4ba9cc..ed16293 100644 --- a/Source/SkyFrontier/Private/MyButton.cpp +++ b/Source/SkyFrontier/Private/MyButton.cpp @@ -5,7 +5,7 @@ UMyButton::UMyButton() { -OnClicked.AddDynamic(this, &UMyButton::OnClick); + OnClicked.AddDynamic(this, &UMyButton::OnClick); } void UMyButton::SetSessionInfo(int sID, TCPClient *tclient) { diff --git a/Source/SkyFrontier/Private/MyButtonHost.cpp b/Source/SkyFrontier/Private/MyButtonHost.cpp new file mode 100644 index 0000000..f382b9d --- /dev/null +++ b/Source/SkyFrontier/Private/MyButtonHost.cpp @@ -0,0 +1,17 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "MyButtonHost.h" + +UMyButtonHost::UMyButtonHost() +{ + OnClicked.AddDynamic(this, &UMyButtonHost::OnClick); +} +void UMyButtonHost::SetSessionInfo(FString sname, TCPClient *tclient) +{ + sessionName = sname; tcpClient = tclient; +} +void UMyButtonHost::OnClick() +{ + tcpClient->CreateNewGameSession(sessionName); +} \ No newline at end of file diff --git a/Source/SkyFrontier/Private/TCPClient.cpp b/Source/SkyFrontier/Private/TCPClient.cpp index 82daf34..4edafa8 100644 --- a/Source/SkyFrontier/Private/TCPClient.cpp +++ b/Source/SkyFrontier/Private/TCPClient.cpp @@ -97,7 +97,8 @@ int32 size = FCString::Strlen(serializedChar); int32 sent = 0; bool successful = Socket->Send((uint8*) TCHAR_TO_UTF8(serializedChar), size, sent); - if (successful) UE_LOG(LogTemp, Log, TEXT("MESSAGE SENT!!!!")); + if (successful) + UE_LOG(LogTemp, Log, TEXT("MESSAGE SENT!!!!")); } void TCPClient::JoinGameSession(int sID) { @@ -106,5 +107,6 @@ int32 size = FCString::Strlen(serializedChar); int32 sent = 0; bool successful = Socket->Send((uint8*) TCHAR_TO_UTF8(serializedChar), size, sent); - if (successful) UE_LOG(LogTemp, Log, TEXT("MESSAGE SENT!!!!")); + if (successful) + UE_LOG(LogTemp, Log, TEXT("MESSAGE SENT!!!!")); } \ No newline at end of file diff --git a/Source/SkyFrontier/Public/MyButtonHost.h b/Source/SkyFrontier/Public/MyButtonHost.h new file mode 100644 index 0000000..c810c7b --- /dev/null +++ b/Source/SkyFrontier/Public/MyButtonHost.h @@ -0,0 +1,26 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "TCPClient.h" +#include "Components/Button.h" +#include "MyButtonHost.generated.h" + +/** + * + */ +UCLASS() +class SKYFRONTIER_API UMyButtonHost : public UButton +{ + GENERATED_BODY() +public: + UMyButtonHost(); + void SetSessionInfo(FString sname, TCPClient *tclient); +protected: FString sessionName; + TCPClient *tcpClient; + + UFUNCTION() + void OnClick(); + +}; \ No newline at end of file