Major redesign: Using game ids and player ids in gui (associated with tree view items).
Player list of all network games is now dynamically updated in lobby (no polling, server sends events).
This commit is contained in:
1 parent
1b8616d079
commit
bd53403752
23 files changed
+421
-238
No files matched your search
@@ -93,6 +93,30 @@ ServerLobbyThread::CloseSessionDelayed(SessionWrapper session)
|
||||
m_closeSessionList.push_back(closeSessionData);
|
||||
}
|
||||
|
||||
void
|
||||
ServerLobbyThread::NotifyPlayerJoinedGame(unsigned gameId, unsigned playerId)
|
||||
{
|
||||
// Send notification to players in lobby.
|
||||
boost::shared_ptr<NetPacket> packet(new NetPacketGameListPlayerJoined);
|
||||
NetPacketGameListPlayerJoined::Data packetData;
|
||||
packetData.gameId = gameId;
|
||||
packetData.playerId = playerId;
|
||||
static_cast<NetPacketGameListPlayerJoined *>(packet.get())->SetData(packetData);
|
||||
m_sessionManager.SendToAllSessions(GetSender(), packet, SessionData::Established);
|
||||
}
|
||||
|
||||
void
|
||||
ServerLobbyThread::NotifyPlayerLeftGame(unsigned gameId, unsigned playerId)
|
||||
{
|
||||
// Send notification to players in lobby.
|
||||
boost::shared_ptr<NetPacket> packet(new NetPacketGameListPlayerLeft);
|
||||
NetPacketGameListPlayerLeft::Data packetData;
|
||||
packetData.gameId = gameId;
|
||||
packetData.playerId = playerId;
|
||||
static_cast<NetPacketGameListPlayerLeft *>(packet.get())->SetData(packetData);
|
||||
m_sessionManager.SendToAllSessions(GetSender(), packet, SessionData::Established);
|
||||
}
|
||||
|
||||
void
|
||||
ServerLobbyThread::RemoveGame(unsigned id)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user