diff options
Diffstat (limited to 'src/shared/net/proto.hh')
| -rw-r--r-- | src/shared/net/proto.hh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/shared/net/proto.hh b/src/shared/net/proto.hh new file mode 100644 index 0000000..93bb005 --- /dev/null +++ b/src/shared/net/proto.hh @@ -0,0 +1,28 @@ +#ifndef SHARED_NET_PROTO_HH_ +#define SHARED_NET_PROTO_HH_ + +#include "shared/math.hh" +#include "shared/player.hh" + +#undef Status // Protobuf doesn't like xlib apparently. +#include "shared/net/lib/protobuf/net.pb.h" + +// TODO packet struct parsing packet helper functions +namespace shared { +namespace net { + +shared::player get_player(const proto::player& packet) noexcept; + +void set_angles(proto::angles& proto_angles, + const shared::math::angles& angles) noexcept; +void set_coords(proto::coords& proto_coords, + const shared::math::coords& coords) noexcept; +void set_vec3(proto::vec3& proto_vec3, const glm::vec3& vec3) noexcept; +void set_ivec3(proto::ivec3& proto_ivec3, const glm::ivec3& ivec3) noexcept; +void set_player(proto::player& proto_player, + const shared::player& player) noexcept; + +} // namespace net +} // namespace shared + +#endif |
