mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 20:16:10 +08:00
Added original SDK code for Alien Swarm.
This commit is contained in:
52
public/inetwork.h
Normal file
52
public/inetwork.h
Normal file
@ -0,0 +1,52 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef INETWORK_H
|
||||
#define INETWORK_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
class IConnectionlessPacketHandler;
|
||||
|
||||
abstract_class INetwork
|
||||
{
|
||||
public:
|
||||
virtual ~INetwork( void ) {};
|
||||
|
||||
virtual void Init( void ) = 0;
|
||||
virtual void Config (bool multiplayer);
|
||||
virtual void IsMultiplayer( void ) = 0; // true = full MP mode, false = loopback SP mode
|
||||
virtual void IsEnabled( void ) = 0;
|
||||
|
||||
// shuts down Network, closes all UPD/TCP channels
|
||||
virtual void Shutdown( void ) = 0;
|
||||
|
||||
// must be called each system frame to do any asynchronouse TCP stuff
|
||||
virtual void RunFrame( double time ) = 0;
|
||||
|
||||
virtual void ProcessSocket( netsrc_t sock, IConnectionlessPacketHandler * handler ) = 0;
|
||||
|
||||
virtual void OutOfBandPrintf(netsrc_t sock, netadr_t &adr, const char *format, ...) = 0;
|
||||
virtual void SendConnectionless(netsrc_t sock, netadr_t &adr, unsigned char * data, int length ) = 0;
|
||||
|
||||
virtual void LogBadPacket(netpacket_t * packet) = 0;
|
||||
|
||||
// Address conversion
|
||||
virtual bool StringToAdr ( const char *s, netadr_t *a) = 0;
|
||||
|
||||
// Convert from host to network byte ordering
|
||||
virtual unsigned short HostToNetShort( unsigned short us_in );
|
||||
|
||||
// and vice versa
|
||||
virtual unsigned short NetToHostShort( unsigned short us_in );
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // INETWORK_H
|
Reference in New Issue
Block a user