mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
parse new SERVERNAME config variable
This commit is contained in:
parent
93534b268a
commit
c954361d3b
2 changed files with 5 additions and 0 deletions
|
@ -99,6 +99,8 @@ RelayConfigs::RelayConfigs( const char* cfile )
|
||||||
m_port = atoi( value );
|
m_port = atoi( value );
|
||||||
} else if ( 0 == strcmp( line, "NTHREADS" ) ) {
|
} else if ( 0 == strcmp( line, "NTHREADS" ) ) {
|
||||||
m_nWorkerThreads = atoi( value );
|
m_nWorkerThreads = atoi( value );
|
||||||
|
} else if ( 0 == strcmp( line, "SERVERNAME" ) ) {
|
||||||
|
m_serverName = value;
|
||||||
} else {
|
} else {
|
||||||
logf( "unknown key %s with value %s\n",
|
logf( "unknown key %s with value %s\n",
|
||||||
line, value );
|
line, value );
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#ifndef _CONFIGS_H_
|
#ifndef _CONFIGS_H_
|
||||||
#define _CONFIGS_H_
|
#define _CONFIGS_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include "xwrelay_priv.h"
|
#include "xwrelay_priv.h"
|
||||||
|
|
||||||
class RelayConfigs {
|
class RelayConfigs {
|
||||||
|
@ -36,6 +37,7 @@ class RelayConfigs {
|
||||||
int GetNWorkerThreads() { return m_nWorkerThreads; }
|
int GetNWorkerThreads() { return m_nWorkerThreads; }
|
||||||
time_t GetAllConnectedInterval() { return m_allConnInterval; }
|
time_t GetAllConnectedInterval() { return m_allConnInterval; }
|
||||||
time_t GetHeartbeatInterval() { return m_heartbeatInterval; }
|
time_t GetHeartbeatInterval() { return m_heartbeatInterval; }
|
||||||
|
const char* GetServerName() { return m_serverName.c_str(); }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -46,6 +48,7 @@ class RelayConfigs {
|
||||||
int m_ctrlport;
|
int m_ctrlport;
|
||||||
int m_port;
|
int m_port;
|
||||||
int m_nWorkerThreads;
|
int m_nWorkerThreads;
|
||||||
|
std::string m_serverName;
|
||||||
|
|
||||||
static RelayConfigs* instance;
|
static RelayConfigs* instance;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue