Game list in Lobby is now shown and updated even after joining or creating a game. Game updates will be sent by the server at all times (even during the game).

This commit is contained in:
lotodore
2007-09-29 14:05:41 +00:00
parent 390837f332
commit 3c88ba8bbe
19 changed files with 407 additions and 197 deletions
+49
View File
@@ -30,3 +30,52 @@ SessionData::~SessionData()
CLOSESOCKET(m_sockfd);
}
unsigned
SessionData::GetId() const
{
// const value - no mutex needed.
return m_id;
}
SessionData::State
SessionData::GetState() const
{
boost::mutex::scoped_lock lock(m_dataMutex);
return m_state;
}
void
SessionData::SetState(SessionData::State state)
{
boost::mutex::scoped_lock lock(m_dataMutex);
m_state = state;
}
SOCKET
SessionData::GetSocket() const
{
// value never modified - no mutex needed.
return m_sockfd;
}
const std::string &
SessionData::GetClientAddr() const
{
boost::mutex::scoped_lock lock(m_dataMutex);
return m_clientAddr;
}
void
SessionData::SetClientAddr(const std::string &addr)
{
boost::mutex::scoped_lock lock(m_dataMutex);
m_clientAddr = addr;
}
ReceiveBuffer &
SessionData::GetReceiveBuffer()
{
// mutex protection, if needed, within buffer.
return m_receiveBuffer;
}