mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 13:23:59 +02:00
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:
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user