generated from Persson-dev/Godot-Xmake
unreliable packets
All checks were successful
Linux arm64 / Build (pull_request) Successful in 1m37s
All checks were successful
Linux arm64 / Build (pull_request) Successful in 1m37s
This commit is contained in:
39
src/blitz/protocol/PacketSender.cpp
Normal file
39
src/blitz/protocol/PacketSender.cpp
Normal 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
|
||||
Reference in New Issue
Block a user