View Single Post
komashchenko
BANNED
Join Date: Nov 2013
Old 11-01-2016 , 11:53   Re: [CS:GO] PTaH - V1.0.1
Reply With Quote #7

1.0.1
  • Added hook ServerConsolePrint
  • Fixed PTaH_GetEconItemViewFromWeapon for Windows (Thank you GoD-Tony)
  • PTaH_GetHostByName substituted for PTaH_GetAddrInfo

Quote:
Originally Posted by shavit View Post
something like this i guess:
Code:
public void OnPluginStart()
{
	// uses the system's dns resolver
	PTaH_GetHostByName("google.com", OnDNSLookup_Success, OnDNSLookup_Failure);
	
	// custom dns resolver
	PTaH_GetHostByName_Custom("google.com", OnDNSLookup_Success, OnDNSLookup_Failure, "8.8.4.4");
}

public void OnDNSLookup_Success(int ipaddress[4])
{
	PrintToServer("IP: %d.%d.%d.%d", ipaddress >>> 24 & 255, ipaddress >>> 16 & 255, ipaddress >>> 8 & 255, ipaddress & 255);
}

public void OnDNSLookup_Failure(const char[] reason)
{
	PrintToServer("Lookup failed! Reason: %s", reason);
}
I could not make a feature for custom dns, but slightly increased functionality
komashchenko is offline