Updates to new netplayer code to default the value to the hostname and not crash if the property is missing from glest.ini. Also added new property to configurator

This commit is contained in:
Mark Vejvoda
2010-03-23 02:37:41 +00:00
parent 5b713bd785
commit 237b76e2f2
9 changed files with 39 additions and 33 deletions

View File

@@ -514,14 +514,14 @@ bool Socket::isConnected()
return true;
}
string Socket::getHostName() const {
string Socket::getHostName() {
const int strSize= 256;
char hostname[strSize];
gethostname(hostname, strSize);
return hostname;
}
string Socket::getIp() const{
string Socket::getIp() {
hostent* info= gethostbyname(getHostName().c_str());
unsigned char* address;

View File

@@ -625,14 +625,14 @@ bool Socket::isConnected(){
return true;
}
string Socket::getHostName() const{
string Socket::getHostName() {
const int strSize= 256;
char hostname[strSize];
gethostname(hostname, strSize);
return hostname;
}
string Socket::getIp() const{
string Socket::getIp() {
hostent* info= gethostbyname(getHostName().c_str());
unsigned char* address;