Implementing ticket #2 - optionally remove players from games after it was finished. This breaks protocol compatibility with 0.8. Config file option is NetAutoLeaveGameAfterFinish.

This commit is contained in:
lotodore
2011-02-06 13:17:07 +00:00
parent 851528f290
commit e823b7b788
73 changed files with 318 additions and 242 deletions
+6 -3
View File
@@ -231,13 +231,14 @@ ClientThread::SendPrivateChatMessage(unsigned targetPlayerId, const std::string
}
void
ClientThread::SendJoinFirstGame(const std::string &password)
ClientThread::SendJoinFirstGame(const std::string &password, bool autoLeave)
{
// Warning: This function is called in the context of the GUI thread.
// Create a network packet to request joining a game.
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
packet->GetMsg()->present = PokerTHMessage_PR_joinGameRequestMessage;
JoinGameRequestMessage_t *netJoinGame = &packet->GetMsg()->choice.joinGameRequestMessage;
netJoinGame->autoLeave = autoLeave;
if (!password.empty())
{
netJoinGame->password = OCTET_STRING_new_fromBuf(
@@ -253,13 +254,14 @@ ClientThread::SendJoinFirstGame(const std::string &password)
}
void
ClientThread::SendJoinGame(unsigned gameId, const std::string &password)
ClientThread::SendJoinGame(unsigned gameId, const std::string &password, bool autoLeave)
{
// Warning: This function is called in the context of the GUI thread.
// Create a network packet to request joining a game.
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
packet->GetMsg()->present = PokerTHMessage_PR_joinGameRequestMessage;
JoinGameRequestMessage_t *netJoinGame = &packet->GetMsg()->choice.joinGameRequestMessage;
netJoinGame->autoLeave = autoLeave;
if (!password.empty())
{
netJoinGame->password = OCTET_STRING_new_fromBuf(
@@ -275,13 +277,14 @@ ClientThread::SendJoinGame(unsigned gameId, const std::string &password)
}
void
ClientThread::SendCreateGame(const GameData &gameData, const std::string &name, const std::string &password)
ClientThread::SendCreateGame(const GameData &gameData, const std::string &name, const std::string &password, bool autoLeave)
{
// Warning: This function is called in the context of the GUI thread.
// Create a network packet to request creating a new game.
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
packet->GetMsg()->present = PokerTHMessage_PR_joinGameRequestMessage;
JoinGameRequestMessage_t *netJoinGame = &packet->GetMsg()->choice.joinGameRequestMessage;
netJoinGame->autoLeave = autoLeave;
if (!password.empty())
{
netJoinGame->password = OCTET_STRING_new_fromBuf(