Skip to content

Commit

Permalink
Taking SVN revision from 591 to 596, also implemented synchronization…
Browse files Browse the repository at this point in the history
… to CONSOLE_Print.
  • Loading branch information
perennate committed Aug 8, 2012
1 parent 8c1ea71 commit 5da6eb7
Show file tree
Hide file tree
Showing 9 changed files with 277,119 additions and 180,318 deletions.
2 changes: 2 additions & 0 deletions ghost/bnet.cpp
Expand Up @@ -2200,6 +2200,8 @@ void CBNET :: QueueGameRefresh( unsigned char state, string gameName, string hos
{
uint32_t MapGameType = map->GetMapGameType( );
MapGameType |= MAPGAMETYPE_UNKNOWN0;
//Apply overwrite if not equal to 0
MapGameType = ( m_GHost->m_MapGameType != 0 ) ? MapGameType : m_GHost->m_MapGameType;

if( state == GAME_PRIVATE )
MapGameType |= MAPGAMETYPE_PRIVATEGAME;
Expand Down
8 changes: 8 additions & 0 deletions ghost/config.cpp
Expand Up @@ -94,6 +94,14 @@ int CConfig :: GetInt( string key, int x )
return atoi( m_CFG[key].c_str( ) );
}

uint32_t CConfig :: GetUInt( string key, uint32_t x )
{
if( m_CFG.find( key ) == m_CFG.end( ) )
return x;
else
return strtoul( m_CFG[key].c_str( ), NULL, 0 );
}

string CConfig :: GetString( string key, string x )
{
if( m_CFG.find( key ) == m_CFG.end( ) )
Expand Down
1 change: 1 addition & 0 deletions ghost/config.h
Expand Up @@ -37,6 +37,7 @@ class CConfig
void Read( string file );
bool Exists( string key );
int GetInt( string key, int x );
uint32_t GetUInt( string key, uint32_t x );
string GetString( string key, string x );
void Set( string key, string x );
};
Expand Down
7 changes: 6 additions & 1 deletion ghost/ghost.cpp
Expand Up @@ -107,6 +107,7 @@ string gLogFile;
uint32_t gLogMethod;
ofstream *gLog = NULL;
CGHost *gGHost = NULL;
boost::mutex PrintMutex;

uint32_t GetTime( )
{
Expand Down Expand Up @@ -170,6 +171,7 @@ void SignalCatcher( int s )

void CONSOLE_Print( string message )
{
boost::mutex::scoped_lock printLock( PrintMutex );
cout << message << endl;

// logging
Expand Down Expand Up @@ -208,6 +210,8 @@ void CONSOLE_Print( string message )
}
}
}

printLock.unlock( );
}

void DEBUG_Print( string message )
Expand Down Expand Up @@ -486,7 +490,7 @@ CGHost :: CGHost( CConfig *CFG )
m_Exiting = false;
m_ExitingNice = false;
m_Enabled = true;
m_Version = "17.1";
m_Version = "17.2";
m_HostCounter = 1;
m_AutoHostMaximumGames = CFG->GetInt( "autohost_maxgames", 0 );
m_AutoHostAutoStartPlayers = CFG->GetInt( "autohost_startplayers", 0 );
Expand Down Expand Up @@ -1326,6 +1330,7 @@ void CGHost :: SetConfigs( CConfig *CFG )
m_LocalAdminMessages = CFG->GetInt( "bot_localadminmessages", 1 ) == 0 ? false : true;
m_TCPNoDelay = CFG->GetInt( "tcp_nodelay", 0 ) == 0 ? false : true;
m_MatchMakingMethod = CFG->GetInt( "bot_matchmakingmethod", 1 );
m_MapGameType = CFG->GetUInt( "bot_mapgametype", 0 );
}

void CGHost :: ExtractScripts( )
Expand Down
1 change: 1 addition & 0 deletions ghost/ghost.h
Expand Up @@ -144,6 +144,7 @@ class CGHost
uint32_t m_ReplayBuildNumber; // config value: replay build number (for saving replays)
bool m_TCPNoDelay; // config value: use Nagle's algorithm or not
uint32_t m_MatchMakingMethod; // config value: the matchmaking method
uint32_t m_MapGameType; // config value: the MapGameType overwrite (aka: refresh hack)
vector<GProxyReconnector *> m_PendingReconnects;
boost::mutex m_ReconnectMutex;

Expand Down

0 comments on commit 5da6eb7

Please sign in to comment.