work on world

This commit is contained in:
2026-03-16 15:35:31 +02:00
parent c05bca6d27
commit 6d5141cf43
33 changed files with 416 additions and 100 deletions

View File

@@ -5,11 +5,11 @@
#include "stdint.h"
#include "tier0/network.h"
class CNetworkUInt32
class CNetworkProtocolUInt32
{
public:
CNetworkUInt32() : m_uValue(0) {}
CNetworkUInt32( uint32_t uValue ) : m_uValue(htonl(uValue)) {}
CNetworkProtocolUInt32() : m_uValue(0) {}
CNetworkProtocolUInt32( uint32_t uValue ) : m_uValue(htonl(uValue)) {}
operator uint32_t() const {
return htonl(m_uValue);
}
@@ -25,6 +25,7 @@ enum EMessageType: uint32_t
MESSAGE_ENTITY_DATA_SYNC,
k_EMessage_PlayerSetLocalEntity,
k_EMessage_ResetEntities,
};
struct PlayerJoined_t
@@ -36,39 +37,39 @@ struct PlayerJoined_t
struct PlayerJoinedCallback_t
{
EMessageType m_eType;
CNetworkUInt32 m_uPlayerIndex;
CNetworkProtocolUInt32 m_uPlayerIndex;
};
struct PlayerLeft_t
{
EMessageType m_eType;
CNetworkUInt32 m_uPlayerIndex;
CNetworkProtocolUInt32 m_uPlayerIndex;
};
struct EntityClass_t
{
EMessageType m_eType;
CNetworkUInt32 m_uIndex;
CNetworkProtocolUInt32 m_uIndex;
int8_t m_szEntityName[256];
};
struct EntityDataSync_t
{
EMessageType m_eType;
CNetworkUInt32 m_uIndex;
CNetworkUInt32 m_uCount;
CNetworkProtocolUInt32 m_uIndex;
CNetworkProtocolUInt32 m_uCount;
};
struct EntityDataSyncValue_t
{
CNetworkUInt32 m_uVariableIndex;
CNetworkUInt32 m_uVariableSize;
CNetworkProtocolUInt32 m_uVariableIndex;
CNetworkProtocolUInt32 m_uVariableSize;
};
struct SetLocalEntity_t
{
EMessageType m_eType;
CNetworkUInt32 m_uIndex;
CNetworkProtocolUInt32 m_uIndex;
};
union PlayerPacket_t