steam relay networking

This commit is contained in:
2026-03-01 23:06:28 +02:00
parent 03c560c2b7
commit 468d765aa1
16 changed files with 628 additions and 101 deletions

View File

@@ -3,18 +3,45 @@
#define NETWORK_BASE_H
#include "tier1/interface.h"
enum EPacketArrival
{
PACKET_MAY_ARRIVE,
PACKET_MUST_ARRIVE
};
struct NetPacket_t
{
void *pData;
uint32_t uSize;
uint64_t m_uOwner;
EPacketArrival m_eArrival;
};
enum ENetCallbackType
{
NET_NONE = 0,
NET_TRYING_TO_CONNECT,
NET_CONNECTED,
NET_DISCONNECTED,
NET_SERVER_READY_TO_USE,
};
struct NetCallback_t
{
ENetCallbackType m_eType;
uint64_t m_ullUserID;
};
typedef uint32_t (*NetCallbackFn)( NetCallback_t *pUser );
abstract_class INetworkBase
{
public:
virtual ~INetworkBase() = default;
virtual void NetThink() = 0;
virtual void SetCallback( NetCallbackFn fnCallback ) = 0;
virtual uint32_t BHasUpdates() = 0;
virtual NetPacket_t RecievePacket() = 0;
@@ -22,9 +49,13 @@ public:
virtual void SendPacket( NetPacket_t stPacket ) = 0;
virtual bool BIsActive() = 0;
virtual uint64_t GetSteamID() = 0;
virtual const char *GetIP() = 0;
virtual uint16_t GetPort() = 0;
};
#define GAME_PORT
#endif