Skip to content

Commit 5da6eb7

Browse files
committed
Taking SVN revision from 591 to 596, also implemented synchronization to CONSOLE_Print.
1 parent 8c1ea71 commit 5da6eb7

File tree

9 files changed

+277119
-180318
lines changed

9 files changed

+277119
-180318
lines changed

ghost/bnet.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -2200,6 +2200,8 @@ void CBNET :: QueueGameRefresh( unsigned char state, string gameName, string hos
22002200
{
22012201
uint32_t MapGameType = map->GetMapGameType( );
22022202
MapGameType |= MAPGAMETYPE_UNKNOWN0;
2203+
//Apply overwrite if not equal to 0
2204+
MapGameType = ( m_GHost->m_MapGameType != 0 ) ? MapGameType : m_GHost->m_MapGameType;
22032205

22042206
if( state == GAME_PRIVATE )
22052207
MapGameType |= MAPGAMETYPE_PRIVATEGAME;

ghost/config.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ int CConfig :: GetInt( string key, int x )
9494
return atoi( m_CFG[key].c_str( ) );
9595
}
9696

97+
uint32_t CConfig :: GetUInt( string key, uint32_t x )
98+
{
99+
if( m_CFG.find( key ) == m_CFG.end( ) )
100+
return x;
101+
else
102+
return strtoul( m_CFG[key].c_str( ), NULL, 0 );
103+
}
104+
97105
string CConfig :: GetString( string key, string x )
98106
{
99107
if( m_CFG.find( key ) == m_CFG.end( ) )

ghost/config.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class CConfig
3737
void Read( string file );
3838
bool Exists( string key );
3939
int GetInt( string key, int x );
40+
uint32_t GetUInt( string key, uint32_t x );
4041
string GetString( string key, string x );
4142
void Set( string key, string x );
4243
};

ghost/ghost.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ string gLogFile;
107107
uint32_t gLogMethod;
108108
ofstream *gLog = NULL;
109109
CGHost *gGHost = NULL;
110+
boost::mutex PrintMutex;
110111

111112
uint32_t GetTime( )
112113
{
@@ -170,6 +171,7 @@ void SignalCatcher( int s )
170171

171172
void CONSOLE_Print( string message )
172173
{
174+
boost::mutex::scoped_lock printLock( PrintMutex );
173175
cout << message << endl;
174176

175177
// logging
@@ -208,6 +210,8 @@ void CONSOLE_Print( string message )
208210
}
209211
}
210212
}
213+
214+
printLock.unlock( );
211215
}
212216

213217
void DEBUG_Print( string message )
@@ -486,7 +490,7 @@ CGHost :: CGHost( CConfig *CFG )
486490
m_Exiting = false;
487491
m_ExitingNice = false;
488492
m_Enabled = true;
489-
m_Version = "17.1";
493+
m_Version = "17.2";
490494
m_HostCounter = 1;
491495
m_AutoHostMaximumGames = CFG->GetInt( "autohost_maxgames", 0 );
492496
m_AutoHostAutoStartPlayers = CFG->GetInt( "autohost_startplayers", 0 );
@@ -1326,6 +1330,7 @@ void CGHost :: SetConfigs( CConfig *CFG )
13261330
m_LocalAdminMessages = CFG->GetInt( "bot_localadminmessages", 1 ) == 0 ? false : true;
13271331
m_TCPNoDelay = CFG->GetInt( "tcp_nodelay", 0 ) == 0 ? false : true;
13281332
m_MatchMakingMethod = CFG->GetInt( "bot_matchmakingmethod", 1 );
1333+
m_MapGameType = CFG->GetUInt( "bot_mapgametype", 0 );
13291334
}
13301335

13311336
void CGHost :: ExtractScripts( )

ghost/ghost.h

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class CGHost
144144
uint32_t m_ReplayBuildNumber; // config value: replay build number (for saving replays)
145145
bool m_TCPNoDelay; // config value: use Nagle's algorithm or not
146146
uint32_t m_MatchMakingMethod; // config value: the matchmaking method
147+
uint32_t m_MapGameType; // config value: the MapGameType overwrite (aka: refresh hack)
147148
vector<GProxyReconnector *> m_PendingReconnects;
148149
boost::mutex m_ReconnectMutex;
149150

0 commit comments

Comments
 (0)