Add server statistics which are sent by the server to every client each time they change.

This commit is contained in:
lotodore
2007-10-20 22:22:11 +00:00
parent c5246aaef3
commit 4bc57f07d0
21 changed files with 302 additions and 3 deletions
@@ -302,8 +302,9 @@ void gameLobbyDialogImpl::refreshGameStats() {
void gameLobbyDialogImpl::refreshPlayerStats() {
ServerStats stats = mySession->getClientStats();
label_nickListCounter->setText("| "+tr("players in chat: %1").arg(treeWidget_NickList->topLevelItemCount()));
label_connectedPlayersCounter->setText(tr("connected players: %1").arg(0));
label_connectedPlayersCounter->setText(tr("connected players: %1").arg(stats.numberOfPlayersOnServer));
}
void gameLobbyDialogImpl::gameAddPlayer(unsigned gameId, unsigned playerId)
@@ -357,6 +358,11 @@ void gameLobbyDialogImpl::gameRemovePlayer(unsigned gameId, unsigned playerId)
}
}
void gameLobbyDialogImpl::updateStats(ServerStats /*stats*/)
{
refreshPlayerStats();
}
void gameLobbyDialogImpl::clearDialog()
{
groupBox_GameInfo->setTitle(tr("Game Info"));