Adding backward compatibility for 0.6 clients. They cannot join games with > 7 players.

This commit is contained in:
lotodore
2009-04-11 12:32:54 +00:00
parent dae16675a4
commit 992dd4b618
5 changed files with 29 additions and 2 deletions
+15 -1
View File
@@ -22,7 +22,8 @@
SessionData::SessionData(SOCKET sockfd, SessionId id, boost::shared_ptr<SenderInterface> sender, SessionDataCallback &cb, boost::asio::io_service &ioService)
: m_id(id), m_state(SessionData::Init), m_readyFlag(false),
m_wantsLobbyMsg(true), m_activityTimeoutNoticeSent(false), m_callback(cb)
m_wantsLobbyMsg(true), m_activityTimeoutNoticeSent(false), m_callback(cb),
m_maxNumPlayers(0)
{
m_socket.reset(new boost::asio::ip::tcp::socket(
ioService, boost::asio::ip::tcp::v6(), sockfd));
@@ -173,3 +174,16 @@ SessionData::GetAutoDisconnectTimerElapsedSec() const
return m_autoDisconnectTimer.elapsed().total_seconds();
}
unsigned
SessionData::GetMaxNumPlayers() const
{
boost::mutex::scoped_lock lock(m_dataMutex);
return m_maxNumPlayers;
}
void
SessionData::SetMaxNumPlayers(unsigned numPlayers)
{
boost::mutex::scoped_lock lock(m_dataMutex);
m_maxNumPlayers = numPlayers;
}