mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-05 23:36:09 +00:00
works but linux build is broken and this is an old version of the source
This commit is contained in:
@@ -7,18 +7,27 @@
|
||||
///
|
||||
|
||||
#include <string>
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#elif defined(__linux__)
|
||||
#include "linuxfixes.h"
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#include "Logger.h"
|
||||
|
||||
std::string GetAddr(const std::string&IP){
|
||||
if(IP.find_first_not_of("0123456789.") == -1)return IP;
|
||||
WSADATA wsaData;
|
||||
hostent *host;
|
||||
#ifdef _WIN32
|
||||
WSADATA wsaData;
|
||||
if(WSAStartup(514, &wsaData) != 0){
|
||||
error("WSA Startup Failed!");
|
||||
WSACleanup();
|
||||
return "";
|
||||
}
|
||||
#endif
|
||||
|
||||
host = gethostbyname(IP.c_str());
|
||||
if(!host){
|
||||
error("DNS lookup failed! on " + IP);
|
||||
|
||||
Reference in New Issue
Block a user