Files @ r11049:6eb2c87ed64a
Branch filter:

Location: cpp/openttd-patchpack/source/src/network/core/address.cpp

peter1138
(svn r15389) -Feature: Add ability to select which base graphics set is used from the Game Options window. The change takes effect when the window is closed. This option can only be used from the intro menu, as reloading graphics during a game may cause issues.
/* $Id$ */

/** @file core/address.cpp Implementation of the address. */

#include "../../stdafx.h"

#ifdef ENABLE_NETWORK

#include "address.h"
#include "host.h"

const char *NetworkAddress::GetHostname() const
{
	if (this->hostname != NULL) return this->hostname;

	in_addr addr;
	addr.s_addr = this->ip;
	return inet_ntoa(addr);
}

uint32 NetworkAddress::GetIP()
{
	if (!this->resolved) {
		this->ip = NetworkResolveHost(this->hostname);
		this->resolved = true;
	}
	return this->ip;
}

#endif /* ENABLE_NETWORK */