2015-05-15 03:36:57 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <sstream>
|
2015-10-15 06:40:40 +02:00
|
|
|
#include <array>
|
|
|
|
#include "netmessages.h"
|
2015-05-15 03:36:57 +02:00
|
|
|
|
|
|
|
class bf_read;
|
2015-06-19 02:23:26 +02:00
|
|
|
|
2015-07-14 05:25:49 +02:00
|
|
|
namespace NetHandlers
|
|
|
|
{
|
|
|
|
using BitRead = bf_read;
|
|
|
|
}
|
2015-05-15 03:36:57 +02:00
|
|
|
|
2016-04-28 04:31:33 +02:00
|
|
|
struct SourceGameContext;
|
2015-05-15 03:36:57 +02:00
|
|
|
|
|
|
|
#if !defined(MAX_OSPATH)
|
|
|
|
#define MAX_OSPATH 260 // max length of a filesystem pathname
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define DECLARE_NET_HANDLERS(msgname) \
|
|
|
|
namespace NetHandlers \
|
|
|
|
{ \
|
2015-06-19 02:23:26 +02:00
|
|
|
bool msgname##_BitRead_Internal(BitRead& bitbuf, SourceGameContext& context, NetMsg::msgname* data); \
|
|
|
|
inline bool msgname##_BitRead(BitRead& bitbuf, SourceGameContext& context, void* data) \
|
2015-05-15 03:36:57 +02:00
|
|
|
{ \
|
2015-05-16 00:05:28 +02:00
|
|
|
return msgname##_BitRead_Internal(bitbuf, context, reinterpret_cast<NetMsg::msgname*>(data)); \
|
2015-05-15 03:36:57 +02:00
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2015-05-15 05:38:53 +02:00
|
|
|
namespace NetHandlers
|
|
|
|
{
|
2015-10-15 06:40:40 +02:00
|
|
|
using NetDataStructArray = std::array<void*, NetMsg::SVC_LASTMSG + 1>;
|
|
|
|
void CreateNetMsgStructs(NetDataStructArray& netDataStructs);
|
|
|
|
void DestroyNetMsgStructs(NetDataStructArray& netDataStructs);
|
2015-07-11 09:02:49 +02:00
|
|
|
|
2015-06-19 02:23:26 +02:00
|
|
|
bool NetMsg_BitRead(uint32_t type, BitRead& bitbuf, SourceGameContext& context, void* data);
|
2015-05-15 05:38:53 +02:00
|
|
|
}
|