Commit 4caa3f1c by wester

UDPSender.cpp

parent 92bf458f
No preview for this file type
......@@ -20,7 +20,9 @@ public class MasterTestProject : ModuleRules
public MasterTestProject(ReadOnlyTargetRules Target) : base (Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ImageWrapper", "RawMesh", "HTTP", "Json", "JsonUtilities", "ProceduralMeshComponent", "RHI", "RenderCore" });
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ImageWrapper",
"RawMesh", "JsonUtilities", "ProceduralMeshComponent", "RHI", "RenderCore",
"HTTP", "Json","Sockets", "Networking" });
PrivateDependencyModuleNames.AddRange(new string[] { });
......
......@@ -45,12 +45,15 @@ void AVRPawnCode::SetupPlayerInputComponent(UInputComponent* PlayerInputComponen
}
void AVRPawnCode::PublishMessage(FVector start, FVector end)
void AVRPawnCode::PublishMessage(FVector start, FVector end, AUDPSender *socket)
{
UMyGameInstance *gameinstance = Cast<UMyGameInstance>(GetGameInstance());
//FPlatformTime::Seconds();
FString Message = FString::Printf(TEXT("{\"timestamp\":%d,\"start\":{\"x\":%f,\"y\":%f,\"z\":%f},\"end\":{\"x\":%f,\"y\":%f,\"z\":%f}}"), 0.0f, start.X, start.Y, start.Z, end.X, end.Y, end.Z);
UE_LOG(TILES, Warning, TEXT("Published Message %s"), *Message);
gameinstance->connection->publishMessage(TCHAR_TO_ANSI(*Message));
socket->SendString(Message);
//UE_LOG(TILES, Warning, TEXT("Published Message %s"), *Message);
//gameinstance->connection->publishMessage(TCHAR_TO_UTF8(*Message));
}
......@@ -5,6 +5,7 @@
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "RabbitMQConnection.h"
#include "UDPSender.h"
#include "VRPawnCode.generated.h"
UCLASS()
......@@ -29,7 +30,7 @@ public:
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UFUNCTION(BlueprintCallable, Category = "RabbitMQ")
void PublishMessage(FVector start, FVector end);
void PublishMessage(FVector start, FVector end, AUDPSender *socket);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment