generated from Persson-dev/Godot-Xmake
add blitz files
This commit is contained in:
49
include/blitz/protocol/PacketDeclare.h
Normal file
49
include/blitz/protocol/PacketDeclare.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* \file PacketDeclare.h
|
||||
* \brief Holds the definitions of the packets (but not their content)
|
||||
*/
|
||||
|
||||
namespace blitz {
|
||||
namespace protocol {
|
||||
|
||||
/**
|
||||
* \enum PacketSender
|
||||
* \brief Indicate who should send a packet
|
||||
*/
|
||||
enum class PacketSender {
|
||||
/** Sent by clients and server */
|
||||
Both,
|
||||
/** Sent by clients to the server */
|
||||
Client,
|
||||
/** Sent by server to the clients */
|
||||
Server,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \def DeclareAllPacket
|
||||
* \brief Avoids repetitive operations on packets
|
||||
*/
|
||||
#define DeclareAllPacket() \
|
||||
DeclarePacket(ChatMessage, Reliable, Both) \
|
||||
DeclarePacket(Disconnect, Reliable, Both) \
|
||||
DeclarePacket(KeepAlive, Reliable, Both) \
|
||||
DeclarePacket(LoggingSuccess, Reliable, Server) \
|
||||
DeclarePacket(PlayerDeath, Reliable, Server) \
|
||||
DeclarePacket(PlayerJoin, Reliable, Server) \
|
||||
DeclarePacket(PlayerLeave, Reliable, Server) \
|
||||
DeclarePacket(PlayerList, Reliable, Server) \
|
||||
DeclarePacket(PlayerLogin, Reliable, Client) \
|
||||
DeclarePacket(PlayerPositionAndRotation, Reliable, Both) \
|
||||
DeclarePacket(PlayerShoot, Reliable, Both) \
|
||||
DeclarePacket(PlayerStats, Reliable, Server) \
|
||||
DeclarePacket(ServerConfig, Reliable, Server) \
|
||||
DeclarePacket(ServerTps, Reliable, Server) \
|
||||
DeclarePacket(UpdateGameState, Reliable, Server) \
|
||||
DeclarePacket(UpdateHealth, Reliable, Client)
|
||||
|
||||
|
||||
} // namespace protocol
|
||||
} // namespace blitz
|
||||
Reference in New Issue
Block a user