summaryrefslogtreecommitdiff
path: root/public/inetwork.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/inetwork.h
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'public/inetwork.h')
-rw-r--r--public/inetwork.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/public/inetwork.h b/public/inetwork.h
new file mode 100644
index 0000000..5014e15
--- /dev/null
+++ b/public/inetwork.h
@@ -0,0 +1,52 @@
+//========= Copyright 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, PRINTF_FORMAT_STRING 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