https://www.unrealengine.com/marketplace/ja/slug/objectdeliverer
ObjectDeliverer is a data transmission / reception library for Unreal Engine (C ++, Blueprint).
It has the following features.
- Communication protocol, data division rule, serialization method can be switched by part replacement.
- Available for both C ++ and Blueprint
The master branch is buildable with UE5 5.0 or later; UE4 requires some modifications to build.
The following protocols can be used with built-in. You can also add your own protocol.
- TCP/IP Server(Connectable to multiple clients)
- TCP/IP Client
- UDP(Sender)
- UDP(Receiver)
- Shared Memory(Windows Only)
- LogFile Writer
- LogFile Reader
The following rules are available for built-in split rules of transmitted and received data.
- Byte Array
- UTF-8 string
- Object(Json)
- Please clone this repository
- Please copy the Plugins directory to the project folder
- Please activate ObjectDeliverer from Plugins after launching editor
- Create an ObjectDelivererManager
- Create a DeliveryBox(If you wish to send and receive data other than binary)
- Set the send / receive protocol and PacketRule, then start the ObjectDelivererManager
void UMyClass::Start()
{
auto deliverer = UObjectDelivererManager::CreateObjectDelivererManager();
// bind connected event
deliverer->Connected.AddDynamic(this, &UMyClass::OnConnect);
// bind disconnected event
deliverer->Disconnected.AddDynamic(this, &UMyClass::OnDisConnect);
// bind receive event
deliverer->ReceiveData.AddDynamic(this, &UMyClass::OnReceive);
// start deliverer
// + protocol : TCP/IP Server
// + Data division rule : Header(BodySize) + Body
// + Serialization method : Byte Array
deliverer->Start(UProtocolFactory::CreateProtocolTcpIpServer(9099),
UPacketRuleFactory::CreatePacketRuleSizeBody());
}
void UMyClass::OnConnect(UObjectDelivererProtocol* ClientSocket)
{
// send data
TArray<uint8> buffer;
deliverer->Send(buffer);
}
void UMyClass::OnDisConnect(UObjectDelivererProtocol* ClientSocket)
{
// closed
UE_LOG(LogTemp, Log, TEXT("closed"));
}
void UMyClass::OnReceive(UObjectDelivererProtocol* ClientSocket, const TArray<uint8>& Buffer)
{
// received data buffer
}
Look at the Wiki https://github.com/ayumax/ObjectDeliverer/wiki