Idle Client Timeout Functionality

Added the functionality client side to log users out of servers if they
are idle for more than 1 hour without joining either a game or room.
Sending a message (room/game/private) or performing a game action.
This commit is contained in:
woogerboy21 2016-10-09 13:55:07 -04:00
parent e4127fead3
commit 7af2f3f057
15 changed files with 70 additions and 3 deletions

View file

@ -547,6 +547,7 @@ void TabGame::replayFinished()
void TabGame::replayStartButtonClicked()
{
emit notIdle();
replayStartButton->setEnabled(false);
replayPauseButton->setEnabled(true);
replayFastForwardButton->setEnabled(true);
@ -556,6 +557,7 @@ void TabGame::replayStartButtonClicked()
void TabGame::replayPauseButtonClicked()
{
emit notIdle();
replayStartButton->setEnabled(true);
replayPauseButton->setEnabled(false);
replayFastForwardButton->setEnabled(false);
@ -565,6 +567,7 @@ void TabGame::replayPauseButtonClicked()
void TabGame::replayFastForwardButtonToggled(bool checked)
{
emit notIdle();
timelineWidget->setTimeScaleFactor(checked ? 10.0 : 1.0);
}
@ -594,6 +597,7 @@ void TabGame::actGameInfo()
void TabGame::actConcede()
{
emit notIdle();
if (QMessageBox::question(this, tr("Concede"), tr("Are you sure you want to concede this game?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) != QMessageBox::Yes)
return;
@ -602,6 +606,7 @@ void TabGame::actConcede()
void TabGame::actLeaveGame()
{
emit notIdle();
if (!gameClosed) {
if (!spectator)
if (QMessageBox::question(this, tr("Leave game"), tr("Are you sure you want to leave this game?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) != QMessageBox::Yes)
@ -625,6 +630,7 @@ void TabGame::actSay()
sendGameCommand(cmd);
sayEdit->clear();
}
emit notIdle();
}
void TabGame::actPhaseAction()
@ -778,6 +784,7 @@ AbstractClient *TabGame::getClientForPlayer(int playerId) const
void TabGame::sendGameCommand(PendingCommand *pend, int playerId)
{
emit notIdle();
AbstractClient *client = getClientForPlayer(playerId);
if (!client)
return;
@ -788,6 +795,7 @@ void TabGame::sendGameCommand(PendingCommand *pend, int playerId)
void TabGame::sendGameCommand(const google::protobuf::Message &command, int playerId)
{
emit notIdle();
AbstractClient *client = getClientForPlayer(playerId);
if (!client)
return;