Move teehistorian UUIDs into engine

This commit is contained in:
heinrich5991 2018-01-11 16:01:13 +01:00
parent 6c378b972b
commit 22080c840f
10 changed files with 13 additions and 11 deletions

View file

@ -614,6 +614,9 @@ set_glob(ENGINE_SHARED GLOB src/engine/shared
snapshot.cpp
snapshot.h
storage.cpp
teehistorian_ex.cpp
teehistorian_ex.h
teehistorian_ex_chunks.h
uuid_manager.cpp
uuid_manager.h
websockets.cpp
@ -636,9 +639,6 @@ set_glob(GAME_SHARED GLOB src/game
mapitems.h
teamscore.cpp
teamscore.h
teehistorian_ex.cpp
teehistorian_ex.h
teehistorian_ex_chunks.h
tuning.h
variables.h
version.h

View file

@ -107,7 +107,7 @@ if gen_network_header:
non_extended = [o for o in network.Objects if o.ex is None]
extended = [o for o in network.Objects if o.ex is not None]
for l in create_enum_table(["NETOBJTYPE_EX"]+[o.enum_name for o in non_extended], "NUM_NETOBJTYPES"): print(l)
for l in create_enum_table(["__NETOBJTYPE_UUID_HELPER=OFFSET_TEEHISTORIAN_UUID-1"]+[o.enum_name for o in extended], "OFFSET_NETMSGTYPE_UUID"): print(l)
for l in create_enum_table(["__NETOBJTYPE_UUID_HELPER=OFFSET_GAME_UUID-1"]+[o.enum_name for o in extended], "OFFSET_NETMSGTYPE_UUID"): print(l)
print("")
non_extended = [o for o in network.Messages if o.ex is None]
@ -343,7 +343,6 @@ if gen_network_source:
lines += ['void RegisterGameUuids(CUuidManager *pManager)']
lines += ['{']
lines += ['\tRegisterTeehistorianUuids(pManager);']
for item in network.Objects + network.Messages:
if item.ex is not None:

View file

@ -12,7 +12,7 @@ Powerups = ["HEALTH", "ARMOR", "WEAPON", "NINJA"]
RawHeader = '''
#include <engine/message.h>
#include <game/teehistorian_ex.h>
#include <engine/shared/teehistorian_ex.h>
enum
{

View file

@ -1,4 +1,5 @@
#include "protocol_ex.h"
#include "teehistorian_ex.h"
#include "uuid_manager.h"
#include <engine/uuid.h>
@ -7,6 +8,7 @@ static CUuidManager CreateGlobalUuidManager()
{
CUuidManager Manager;
RegisterUuids(&Manager);
RegisterTeehistorianUuids(&Manager);
RegisterGameUuids(&Manager);
return Manager;
}

View file

@ -14,7 +14,7 @@ enum
#define UUID(id, name) id,
#include "protocol_ex_msgs.h"
#undef UUID
OFFSET_GAME_UUID,
OFFSET_TEEHISTORIAN_UUID,
UNPACKMESSAGE_ERROR=0,
UNPACKMESSAGE_OK,

View file

@ -1,14 +1,14 @@
#ifndef GAME_TEEHISTORIAN_EX_H
#define GAME_TEEHISTORIAN_EX_H
#include <engine/shared/protocol_ex.h>
#include "protocol_ex.h"
enum
{
__TEEHISTORIAN_UUID_HELPER=OFFSET_GAME_UUID-1,
__TEEHISTORIAN_UUID_HELPER=OFFSET_TEEHISTORIAN_UUID-1,
#define UUID(id, name) id,
#include "teehistorian_ex_chunks.h"
#undef UUID
OFFSET_TEEHISTORIAN_UUID
OFFSET_GAME_UUID
};
void RegisterTeehistorianUuids(class CUuidManager *pManager);

View file

@ -9,7 +9,7 @@ static const CUuid TEEHISTORIAN_UUID = CalculateUuid(TEEHISTORIAN_NAME);
static const char TEEHISTORIAN_VERSION[] = "2";
#define UUID(id, name) static const CUuid UUID_ ## id = CalculateUuid(name);
#include <game/teehistorian_ex_chunks.h>
#include <engine/shared/teehistorian_ex_chunks.h>
#undef UUID
enum

View file

@ -39,6 +39,7 @@ protected:
#undef MACRO_CONFIG_INT
RegisterUuids(&m_UuidManager);
RegisterTeehistorianUuids(&m_UuidManager);
RegisterGameUuids(&m_UuidManager);
mem_zero(&m_GameInfo, sizeof(m_GameInfo));