unreliable packets
All checks were successful
Linux arm64 / Build (pull_request) Successful in 1m37s

This commit is contained in:
2024-08-20 19:27:20 +02:00
parent f557d0dd2d
commit 03b6e577ea
5 changed files with 144 additions and 15 deletions

View File

@@ -0,0 +1,39 @@
#include <blitz/protocol/PacketSender.h>
#include <blitz/godot/NetworkInterface.h>
#include <blitz/protocol/PacketSerializer.h>
namespace blitz {
namespace protocol {
///////////////////////
/* PacketBroadcaster */
///////////////////////
#define DeclarePacket(PacketName, Reliability, ...) \
void PacketBroadcaster::Visit(const protocol::packets::PacketName& a_Packet) { \
m_NetworkInterface.rpc("RecievePacketData" #Reliability, protocol::PacketSerializer::Serialize(a_Packet)); \
}
DeclareAllPacket()
#undef DeclarePacket
//////////////////
/* PacketSender */
//////////////////
#define DeclarePacket(PacketName, Reliability, ...) \
void PacketSender::Visit(const protocol::packets::PacketName& a_Packet) { \
m_NetworkInterface.rpc_id(m_PeerId, "RecievePacketData" #Reliability, protocol::PacketSerializer::Serialize(a_Packet)); \
}
DeclareAllPacket()
#undef DeclarePacket
} // namespace protocol
} // namespace blitz