eternalcodes / EternalJK

Effort to maintain and improve OpenJK
GNU General Public License v2.0
60 stars 23 forks source link

Hostname banning #43

Open videoP opened 6 years ago

videoP commented 6 years ago

Lugormod had this, it let you ban by hostname so you can ban *.md.comcast.com to ban Maryland comcast IP's for example..

Also lets you more easily ban VPNs ?

videoP commented 4 years ago

example

`#ifdef _WIN32

include

include

include //For _beginthreadex

pragma comment(lib, "ws2_32.lib")

elif defined linux

include

include

include <sys/socket.h>

include <netinet/in.h>

include <arpa/inet.h>

endif

struct hostent remoteHost; struct in_addr addr; addr.s_addr = inet_addr(va("8.8.8.8")); if (addr.s_addr == INADDR_NONE) return ""; remoteHost = gethostbyaddr((char )&addr, 4, AF_INET); if (remoteHost) Com_Printf("Host is %s\n", remoteHost->h_name);`