mirror of
https://github.com/glest/glest-source.git
synced 2025-09-01 04:01:47 +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:
@@ -77,8 +77,8 @@ public:
|
||||
bool isWritable(bool waitOnDelayedResponse);
|
||||
bool isConnected();
|
||||
|
||||
string getHostName() const;
|
||||
string getIp() const;
|
||||
static string getHostName();
|
||||
static string getIp();
|
||||
|
||||
protected:
|
||||
static void throwException(const string &str);
|
||||
|
@@ -81,8 +81,8 @@ public:
|
||||
bool isWritable(bool waitOnDelayedResponse);
|
||||
bool isConnected();
|
||||
|
||||
string getHostName() const;
|
||||
string getIp() const;
|
||||
static string getHostName();
|
||||
static string getIp();
|
||||
|
||||
protected:
|
||||
static void throwException(const string &str);
|
||||
|
@@ -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