summaryrefslogtreecommitdiff
path: root/src/proto2/any-user.hpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-05-20 14:36:33 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-05-20 15:27:53 -0700
commitf6324ada91d412e041592598245770835991cbc6 (patch)
treec0c2e5abb284db8146f7d18bcb7280cda0fa9c07 /src/proto2/any-user.hpp
parentb06dd5aaa0cf47b0b6f73ae858b2e2c267e60bbf (diff)
downloadtmwa-f6324ada91d412e041592598245770835991cbc6.tar.gz
tmwa-f6324ada91d412e041592598245770835991cbc6.tar.bz2
tmwa-f6324ada91d412e041592598245770835991cbc6.tar.xz
tmwa-f6324ada91d412e041592598245770835991cbc6.zip
Generate login/user protocol
Diffstat (limited to 'src/proto2/any-user.hpp')
-rw-r--r--src/proto2/any-user.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/proto2/any-user.hpp b/src/proto2/any-user.hpp
index ea2e20d..d704233 100644
--- a/src/proto2/any-user.hpp
+++ b/src/proto2/any-user.hpp
@@ -35,6 +35,7 @@ struct Packet_Fixed<0x7530>
// TODO remove this
uint16_t magic_packet_id = PACKET_ID;
};
+
template<>
struct Packet_Fixed<0x7531>
{
@@ -44,6 +45,7 @@ struct Packet_Fixed<0x7531>
uint16_t magic_packet_id = PACKET_ID;
Version version = {};
};
+
template<>
struct Packet_Fixed<0x7532>
{
@@ -53,6 +55,7 @@ struct Packet_Fixed<0x7532>
uint16_t magic_packet_id = PACKET_ID;
};
+
template<>
struct NetPacket_Fixed<0x7530>
{
@@ -60,6 +63,7 @@ struct NetPacket_Fixed<0x7530>
};
static_assert(offsetof(NetPacket_Fixed<0x7530>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7530>, magic_packet_id) == 0");
static_assert(sizeof(NetPacket_Fixed<0x7530>) == 2, "sizeof(NetPacket_Fixed<0x7530>) == 2");
+
template<>
struct NetPacket_Fixed<0x7531>
{
@@ -69,6 +73,7 @@ struct NetPacket_Fixed<0x7531>
static_assert(offsetof(NetPacket_Fixed<0x7531>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7531>, magic_packet_id) == 0");
static_assert(offsetof(NetPacket_Fixed<0x7531>, version) == 2, "offsetof(NetPacket_Fixed<0x7531>, version) == 2");
static_assert(sizeof(NetPacket_Fixed<0x7531>) == 10, "sizeof(NetPacket_Fixed<0x7531>) == 10");
+
template<>
struct NetPacket_Fixed<0x7532>
{
@@ -77,6 +82,7 @@ struct NetPacket_Fixed<0x7532>
static_assert(offsetof(NetPacket_Fixed<0x7532>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7532>, magic_packet_id) == 0");
static_assert(sizeof(NetPacket_Fixed<0x7532>) == 2, "sizeof(NetPacket_Fixed<0x7532>) == 2");
+
inline __attribute__((warn_unused_result))
bool native_to_network(NetPacket_Fixed<0x7530> *network, Packet_Fixed<0x7530> native)
{
@@ -91,6 +97,7 @@ bool network_to_native(Packet_Fixed<0x7530> *native, NetPacket_Fixed<0x7530> net
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
return rv;
}
+
inline __attribute__((warn_unused_result))
bool native_to_network(NetPacket_Fixed<0x7531> *network, Packet_Fixed<0x7531> native)
{
@@ -107,6 +114,7 @@ bool network_to_native(Packet_Fixed<0x7531> *native, NetPacket_Fixed<0x7531> net
rv &= network_to_native(&native->version, network.version);
return rv;
}
+
inline __attribute__((warn_unused_result))
bool native_to_network(NetPacket_Fixed<0x7532> *network, Packet_Fixed<0x7532> native)
{
@@ -122,4 +130,5 @@ bool network_to_native(Packet_Fixed<0x7532> *native, NetPacket_Fixed<0x7532> net
return rv;
}
+
#endif // TMWA_PROTO2_ANY_USER_HPP