Fixing some compiler warnings and single-threaded game issues. Note: The server currently crashes when trying to start a game.
This commit is contained in:
@@ -525,7 +525,7 @@ AvatarManager::RemoveOldAvatarCacheEntries()
|
|||||||
while (!timeMap.empty() && !m_cachedAvatars.empty())
|
while (!timeMap.empty() && !m_cachedAvatars.empty())
|
||||||
{
|
{
|
||||||
TimeAvatarMap::iterator i = timeMap.begin();
|
TimeAvatarMap::iterator i = timeMap.begin();
|
||||||
if (curTime - i->first < MAX_AVATAR_CACHE_AGE)
|
if (curTime - i->first < (int)MAX_AVATAR_CACHE_AGE)
|
||||||
break;
|
break;
|
||||||
AvatarMap::iterator pos = m_cachedAvatars.find(i->second);
|
AvatarMap::iterator pos = m_cachedAvatars.find(i->second);
|
||||||
if (pos != m_cachedAvatars.end())
|
if (pos != m_cachedAvatars.end())
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ void gameLobbyDialogImpl::updateGameItem(QTreeWidgetItem *item, unsigned gameId)
|
|||||||
item->setData(0, Qt::DisplayRole, QString::fromUtf8(info.name.c_str()));
|
item->setData(0, Qt::DisplayRole, QString::fromUtf8(info.name.c_str()));
|
||||||
|
|
||||||
QString playerStr;
|
QString playerStr;
|
||||||
playerStr.sprintf("%u/%u", info.players.size(), info.data.maxNumberOfPlayers);
|
playerStr.sprintf("%u/%u", (unsigned)info.players.size(), (unsigned)info.data.maxNumberOfPlayers);
|
||||||
item->setData(1, Qt::DisplayRole, playerStr);
|
item->setData(1, Qt::DisplayRole, playerStr);
|
||||||
|
|
||||||
if (info.mode == GAME_MODE_STARTED)
|
if (info.mode == GAME_MODE_STARTED)
|
||||||
|
|||||||
@@ -252,7 +252,8 @@ irc_event_numeric(irc_session_t * session, unsigned irc_event, const char * /*or
|
|||||||
}
|
}
|
||||||
|
|
||||||
IrcThread::IrcThread(const IrcThread &other)
|
IrcThread::IrcThread(const IrcThread &other)
|
||||||
: m_terminationTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::manual_start),
|
: Thread(),
|
||||||
|
m_terminationTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::manual_start),
|
||||||
m_lastConnectTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::manual_start)
|
m_lastConnectTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::manual_start)
|
||||||
{
|
{
|
||||||
m_callback = other.m_callback;
|
m_callback = other.m_callback;
|
||||||
|
|||||||
@@ -690,7 +690,7 @@ ServerGameStateHand::HandleNewSession(SessionWrapper session)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ServerGameStateHand::InternalProcessPacket(SessionWrapper session, boost::shared_ptr<NetPacket> packet)
|
ServerGameStateHand::InternalProcessPacket(SessionWrapper /*session*/, boost::shared_ptr<NetPacket> /*packet*/)
|
||||||
{
|
{
|
||||||
// TODO: maybe reject packet.
|
// TODO: maybe reject packet.
|
||||||
return MSG_SOCK_INTERNAL_PENDING;
|
return MSG_SOCK_INTERNAL_PENDING;
|
||||||
|
|||||||
@@ -198,6 +198,8 @@ ServerLobbyThread::MoveSessionToGame(ServerGameThread &game, SessionWrapper sess
|
|||||||
m_gameSessionManager.AddSession(session);
|
m_gameSessionManager.AddSession(session);
|
||||||
// Add session to the game.
|
// Add session to the game.
|
||||||
game.AddSession(session);
|
game.AddSession(session);
|
||||||
|
// Set the game id of the session.
|
||||||
|
session.sessionData->SetGameId(game.GetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -205,6 +207,7 @@ ServerLobbyThread::RemoveSessionFromGame(SessionWrapper session)
|
|||||||
{
|
{
|
||||||
// Just remove the session. Only for fatal errors.
|
// Just remove the session. Only for fatal errors.
|
||||||
CloseSession(session);
|
CloseSession(session);
|
||||||
|
session.sessionData->SetGameId(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1271,6 +1274,7 @@ ServerLobbyThread::HandleReAddedSession(SessionWrapper session)
|
|||||||
{
|
{
|
||||||
// Set state (back) to established.
|
// Set state (back) to established.
|
||||||
session.sessionData->SetState(SessionData::Established);
|
session.sessionData->SetState(SessionData::Established);
|
||||||
|
session.sessionData->SetGameId(0);
|
||||||
// Add session to lobby list.
|
// Add session to lobby list.
|
||||||
m_sessionManager.AddSession(session);
|
m_sessionManager.AddSession(session);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user