Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MasterTestProjekt
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
MasterTestProjekt
Commits
3d6c86e1
Commit
3d6c86e1
authored
Oct 16, 2017
by
wester
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://git.breab.org:2223/kai/MasterTestProjekt
parents
31d00b45
f09ab485
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
3 additions
and
130 deletions
+3
-130
MasterTestProject.Build.cs
Source/MasterTestProject/MasterTestProject.Build.cs
+1
-1
MyGameInstance.h
Source/MasterTestProject/MyGameInstance.h
+0
-2
RabbitMQConnection.cpp
Source/MasterTestProject/RabbitMQConnection.cpp
+0
-86
RabbitMQConnection.h
Source/MasterTestProject/RabbitMQConnection.h
+0
-34
VRPawnCode.cpp
Source/MasterTestProject/VRPawnCode.cpp
+0
-4
VRPawnCode.h
Source/MasterTestProject/VRPawnCode.h
+1
-2
assimp
assimp
+1
-1
No files found.
Source/MasterTestProject/MasterTestProject.Build.cs
View file @
3d6c86e1
...
...
@@ -27,7 +27,7 @@ public class MasterTestProject : ModuleRules
PrivateDependencyModuleNames
.
AddRange
(
new
string
[]
{
});
LoadAssimp
(
Target
);
LoadAMQP
(
Target
);
//
LoadAMQP(Target);
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
...
...
Source/MasterTestProject/MyGameInstance.h
View file @
3d6c86e1
...
...
@@ -4,7 +4,6 @@
#include "CoreMinimal.h"
#include "Engine/GameInstance.h"
#include "RabbitMQConnection.h"
#include "MyGameInstance.generated.h"
/**
...
...
@@ -16,7 +15,6 @@ class MASTERTESTPROJECT_API UMyGameInstance : public UGameInstance
GENERATED_BODY
()
public
:
URabbitMQConnection
*
connection
=
nullptr
;
...
...
Source/MasterTestProject/RabbitMQConnection.cpp
deleted
100644 → 0
View file @
31d00b45
// Fill out your copyright notice in the Description page of Project Settings.
#include "MasterTestProject.h"
#include "RabbitMQConnection.h"
URabbitMQConnection
::
URabbitMQConnection
(
const
FObjectInitializer
&
ObjectInitializer
)
:
Super
(
ObjectInitializer
)
{
char
const
*
hostname
=
"10.1.7.49"
;
int
port
=
5672
;
conn
=
amqp_new_connection
();
socket
=
amqp_tcp_socket_new
(
conn
);
if
(
!
socket
)
{
UE_LOG
(
TILES
,
Error
,
TEXT
(
"No RabbitMQ Socket"
));
}
int
status
=
amqp_socket_open
(
socket
,
hostname
,
port
);
if
(
status
)
{
UE_LOG
(
TILES
,
Error
,
TEXT
(
"Cann not Open Socket"
));
}
amqp_rpc_reply_t
returncode
=
amqp_login
(
conn
,
"/"
,
0
,
131072
,
0
,
AMQP_SASL_METHOD_PLAIN
,
"guest"
,
"guest"
);
if
(
AMQP_RESPONSE_NORMAL
!=
returncode
.
reply_type
)
{
UE_LOG
(
TILES
,
Error
,
TEXT
(
"Unable to Login"
));
}
amqp_channel_open
(
conn
,
1
);
returncode
=
amqp_get_rpc_reply
(
conn
);
if
(
AMQP_RESPONSE_NORMAL
!=
returncode
.
reply_type
)
{
UE_LOG
(
TILES
,
Error
,
TEXT
(
"Opening channel error"
));
}
success
=
true
;
}
URabbitMQConnection
::~
URabbitMQConnection
()
{
if
(
!
success
)
{
return
;
}
amqp_rpc_reply_t
returncode
=
amqp_channel_close
(
conn
,
1
,
AMQP_REPLY_SUCCESS
);
if
(
AMQP_RESPONSE_NORMAL
!=
returncode
.
reply_type
)
{
UE_LOG
(
TILES
,
Error
,
TEXT
(
"Closing channel error"
));
}
returncode
=
amqp_connection_close
(
conn
,
AMQP_REPLY_SUCCESS
);
if
(
AMQP_RESPONSE_NORMAL
!=
returncode
.
reply_type
)
{
UE_LOG
(
TILES
,
Error
,
TEXT
(
"Closing connection error"
));
}
int
errorcode
=
amqp_destroy_connection
(
conn
);
if
(
errorcode
!=
0
)
{
UE_LOG
(
TILES
,
Error
,
TEXT
(
"Ending AMQP error"
));
}
}
bool
URabbitMQConnection
::
publishMessage
(
char
const
*
Message
)
{
if
(
!
success
){
UE_LOG
(
TILES
,
Warning
,
TEXT
(
"Cant send Messsage, no Connection"
));
return
false
;
}
char
const
*
exchange
=
""
;
char
const
*
routingkey
=
"to_hololense"
;
// char const *messagebody = "{\"timestamp\":15.600000381469727,\"start\":{\"x\":0.0,\"y\":0.0,\"z\":0.0},\"end\":{\"x\":1.0,\"y\":5.0,\"z\":16.0}}";
amqp_basic_properties_t
props
;
props
.
_flags
=
AMQP_BASIC_CONTENT_TYPE_FLAG
|
AMQP_BASIC_DELIVERY_MODE_FLAG
;
props
.
content_type
=
amqp_cstring_bytes
(
"text/plain"
);
props
.
delivery_mode
=
2
;
/* persistent delivery mode */
int
errorcode
=
amqp_basic_publish
(
conn
,
1
,
amqp_cstring_bytes
(
exchange
),
amqp_cstring_bytes
(
routingkey
),
0
,
0
,
&
props
,
amqp_cstring_bytes
(
Message
));
if
(
errorcode
!=
0
)
{
UE_LOG
(
TILES
,
Error
,
TEXT
(
"Publishing error"
));
}
//UE_LOG(TILES, Warning, TEXT("Published Message %s"), Message);
return
true
;
}
Source/MasterTestProject/RabbitMQConnection.h
deleted
100644 → 0
View file @
31d00b45
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include <amqp_tcp_socket.h>
#include <amqp.h>
#include <amqp_framing.h>
#include "RabbitMQConnection.generated.h"
/**
*
*/
UCLASS
()
class
MASTERTESTPROJECT_API
URabbitMQConnection
:
public
UObject
{
GENERATED_BODY
()
public
:
bool
success
=
false
;
amqp_socket_t
*
socket
=
NULL
;
amqp_connection_state_t
conn
;
URabbitMQConnection
(
const
FObjectInitializer
&
ObjectInitializer
);
~
URabbitMQConnection
();
bool
publishMessage
(
char
const
*
Message
);
protected
:
};
Source/MasterTestProject/VRPawnCode.cpp
View file @
3d6c86e1
...
...
@@ -24,10 +24,6 @@ void AVRPawnCode::BeginPlay()
UMyGameInstance
*
gameinstance
=
Cast
<
UMyGameInstance
>
(
GetGameInstance
());
if
(
gameinstance
!=
nullptr
&&
!
gameinstance
->
connection
)
{
gameinstance
->
connection
=
NewObject
<
URabbitMQConnection
>
();
}
char
const
*
messagebody
=
"{
\"
timestamp
\"
:15.600000381469727,
\"
start
\"
:{
\"
x
\"
:0.0,
\"
y
\"
:0.0,
\"
z
\"
:0.0},
\"
end
\"
:{
\"
x
\"
:1.0,
\"
y
\"
:5.0,
\"
z
\"
:16.0}}"
;
}
...
...
Source/MasterTestProject/VRPawnCode.h
View file @
3d6c86e1
...
...
@@ -4,7 +4,6 @@
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "RabbitMQConnection.h"
#include "UDPSender.h"
#include "VRPawnCode.generated.h"
...
...
@@ -33,7 +32,7 @@ public:
// Called to bind functionality to input
virtual
void
SetupPlayerInputComponent
(
class
UInputComponent
*
PlayerInputComponent
)
override
;
UFUNCTION
(
BlueprintCallable
,
Category
=
"
RabbitMQ
"
)
UFUNCTION
(
BlueprintCallable
,
Category
=
"
UDP
"
)
void
PublishMessage
(
FVector
start
,
FVector
end
,
AUDPSender
*
socket
);
...
...
assimp
@
123d06ca
Subproject commit 1
ab85f16ff687c214ebe61a1f598b3de60fe2487
Subproject commit 1
23d06ca1c7ceb632883afc15adac9d613ecd0f6
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment