more cleanup

This commit is contained in:
Anonymous275
2020-12-20 14:11:17 +02:00
parent 49dd577c36
commit 4b9742553a
33 changed files with 316 additions and 904 deletions

View File

@@ -1,3 +1,7 @@
// Copyright (c) 2020 Anonymous275.
// BeamMP Launcher code is not in the public domain and is not free software.
// One must be granted explicit permission by the copyright holder in order to modify or distribute any part of the source or binaries.
// Anything else is prohibited. Modified works may not be published and have be upstreamed to the official repository.
///
/// Created by Anonymous275 on 9/25/2020
///
@@ -5,19 +9,19 @@
#include <string>
#include <winsock.h>
#include "Logger.h"
#include "Security/Enc.h"
std::string GetAddr(const std::string&IP){
if(IP.find_first_not_of("0123456789.") == -1)return IP;
WSADATA wsaData;
hostent *host;
if(WSAStartup(514, &wsaData) != 0){
error(Sec("WSA Startup Failed!"));
error("WSA Startup Failed!");
WSACleanup();
return "";
}
host = gethostbyname(IP.c_str());
if(!host){
error(Sec("DNS lookup failed! on ") + IP);
error("DNS lookup failed! on " + IP);
WSACleanup();
return "DNS";
}