Files @ r10999:950d41f6cb97
Branch filter:

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

translators
(svn r15339) -Update: WebTranslator2 update to 2009-02-04 18:39:16
arabic_egypt - 1 fixed by khaloofah (1)
german - 1 changed by planetmaker (1)
hebrew - 668 fixed, 19 changed by 19izhar73 (687)
korean - 10 changed by leejaeuk5 (10)
serbian - 6 fixed, 4 changed by salejemaster (10)
/* $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 */