Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
#define WIN32_LEAN_AND_MEAN
|
|
#include <winsock2.h>
|
|
#include <iphlpapi.h>
|
|
|
|
#include <windows.h>
|
|
|
|
#define SelectEvent(dwError) WSAGETSELECTEVENT(dwError)
|
|
#define SelectError(dwError) WSAGETSELECTERROR(dwError)
|
|
|
|
#define SAFE_CLOSESOCK(p) { if (INVALID_SOCKET != (p)) { closesocket(p); (p) = INVALID_SOCKET; } }
|
|
|
|
namespace Socket
|
|
{
|
|
void InitWinsock(void);
|
|
void ReleaseWinsock(void);
|
|
|
|
SOCKADDR_IN MakeSockAddr(IN_ADDR Addr, int Port_In);
|
|
SOCKADDR_IN MakeSockAddr(char *IP_In, int Port_In);
|
|
|
|
bool CreateTCPSocket(SOCKET *Socket_Out, HWND hWnd_In, unsigned int Msg_In);
|
|
bool CreateUDPSocket(SOCKET *Socket_Out, SOCKADDR_IN Address_In, HWND hWnd_In, unsigned int Msg_In);
|
|
bool DeleteSocket(SOCKET *Socket_In, HWND hWnd_In);
|
|
|
|
bool GetNATAddress(SOCKET Socket_In, SOCKADDR_IN *Address_Out, bool AllowVirtual);
|
|
bool GetHostName(char *Name_Out, int Size);
|
|
bool GetHostIP(IN_ADDR &Addr, bool AllowVirtual);
|
|
bool GetHostIP(IN_ADDR &Addr, char *Domain);
|
|
|
|
bool IsWrongIP(IN_ADDR &Addr);
|
|
bool IsEmptyAddr(IN_ADDR &Addr);
|
|
|
|
bool Connect(SOCKET Socket_In, SOCKADDR_IN Address_In, WSABUF *WSABuf_In);
|
|
}; |