@@ -50,8 +50,8 @@ void CScorePlayerResult::SetVariant(Variant v)
50
50
for (float &TimeCp : m_Data.m_Info .m_aTimeCp )
51
51
TimeCp = 0 ;
52
52
break ;
53
- case PLAYER_ROUNDSWON :
54
- m_Data.m_Info .m_RoundsWon = 0 ;
53
+ case PLAYER_GAMESWON :
54
+ m_Data.m_Info .m_GamesWon = 0 ;
55
55
break ;
56
56
}
57
57
}
@@ -1953,21 +1953,21 @@ bool CScoreWorker::GetSaves(IDbConnection *pSqlServer, const ISqlData *pGameData
1953
1953
bool CScoreWorker::SaveStats (IDbConnection *pSqlServer, const ISqlData *pGameData, Write w, char *pError, int ErrorSize)
1954
1954
{
1955
1955
const auto *pData = dynamic_cast <const CSqlSaveStats *>(pGameData);
1956
- if (pSqlServer->SaveStats (pData->m_aName , pData->m_RoundWin , pError, ErrorSize))
1956
+ if (pSqlServer->SaveStats (pData->m_aName , pData->m_Winner , pData-> m_HammerKills , pData-> m_CollateralKills , pData-> m_RoundsSurvived , pError, ErrorSize))
1957
1957
{
1958
1958
return true ;
1959
1959
}
1960
1960
return false ;
1961
1961
}
1962
1962
1963
- bool CScoreWorker::LoadPlayerRoundsWon (IDbConnection *pSqlServer, const ISqlData *pGameData, char *pError, int ErrorSize)
1963
+ bool CScoreWorker::LoadPlayerGamesWon (IDbConnection *pSqlServer, const ISqlData *pGameData, char *pError, int ErrorSize)
1964
1964
{
1965
1965
const auto *pData = dynamic_cast <const CSqlPlayerRequest *>(pGameData);
1966
1966
auto *pResult = dynamic_cast <CScorePlayerResult *>(pGameData->m_pResult .get ());
1967
1967
1968
1968
char aBuf[1024 ];
1969
1969
str_format (aBuf, sizeof (aBuf),
1970
- " SELECT RoundsWon "
1970
+ " SELECT GamesWon "
1971
1971
" FROM %s_stats "
1972
1972
" WHERE Name = ? "
1973
1973
" LIMIT 1" ,
@@ -1986,8 +1986,8 @@ bool CScoreWorker::LoadPlayerRoundsWon(IDbConnection *pSqlServer, const ISqlData
1986
1986
}
1987
1987
if (!End)
1988
1988
{
1989
- pResult->SetVariant (CScorePlayerResult::PLAYER_ROUNDSWON );
1990
- pResult->m_Data .m_Info .m_RoundsWon = pSqlServer->GetInt (1 );
1989
+ pResult->SetVariant (CScorePlayerResult::PLAYER_GAMESWON );
1990
+ pResult->m_Data .m_Info .m_GamesWon = pSqlServer->GetInt (1 );
1991
1991
}
1992
1992
return false ;
1993
1993
}
@@ -2000,9 +2000,9 @@ bool CScoreWorker::ShowStats(IDbConnection *pSqlServer, const ISqlData *pGameDat
2000
2000
char aBuf[256 ];
2001
2001
str_format (aBuf, sizeof (aBuf),
2002
2002
" SELECT ("
2003
- " SELECT COUNT(Name) + 1 FROM %s_stats WHERE RoundsWon > ("
2004
- " SELECT RoundsWon FROM %s_stats WHERE Name = ?"
2005
- " )) as Ranking, RoundsWon, RoundsPlayed , Name "
2003
+ " SELECT COUNT(Name) + 1 FROM %s_stats WHERE GamesWon > ("
2004
+ " SELECT GamesWon FROM %s_stats WHERE Name = ?"
2005
+ " )) as Ranking, GamesWon, GamesPlayed, HammerKills, CollateralKills, RoundsSurvived , Name "
2006
2006
" FROM %s_stats WHERE Name = ?" ,
2007
2007
pSqlServer->GetPrefix (), pSqlServer->GetPrefix (), pSqlServer->GetPrefix ());
2008
2008
@@ -2022,27 +2022,32 @@ bool CScoreWorker::ShowStats(IDbConnection *pSqlServer, const ISqlData *pGameDat
2022
2022
if (!End)
2023
2023
{
2024
2024
int Ranking = pSqlServer->GetInt (1 );
2025
- int RoundsWon = pSqlServer->GetInt (2 );
2026
- int RoundsPlayed = pSqlServer->GetInt (3 );
2025
+ int GamesWon = pSqlServer->GetInt (2 );
2026
+ int GamesPlayed = pSqlServer->GetInt (3 );
2027
+ int HammerKills = pSqlServer->GetInt (4 );
2028
+ int CollateralKills = pSqlServer->GetInt (5 );
2029
+ int RoundsSurvived = pSqlServer->GetInt (6 );
2027
2030
2028
2031
if (str_comp_nocase (pData->m_aRequestingPlayer , pData->m_aName ) == 0 )
2029
2032
{
2030
2033
str_format (pResult->m_Data .m_aaMessages [0 ], sizeof (pResult->m_Data .m_aaMessages [0 ]),
2031
- " %d. %s has won %d rounds of bombtag and played a total of %d with a win rate of %.02f%%" ,
2032
- Ranking, pData->m_aName , RoundsWon, RoundsPlayed , ((float )RoundsWon / (float )RoundsPlayed ) * 100 .0f );
2034
+ " %d. %s has won %d games of bombtag and played a total of %d with a win rate of %.02f%%" ,
2035
+ Ranking, pData->m_aName , GamesWon, GamesPlayed , ((float )GamesWon / (float )GamesPlayed ) * 100 .0f );
2033
2036
}
2034
2037
else
2035
2038
{
2036
2039
pResult->m_MessageKind = CScorePlayerResult::ALL;
2037
2040
str_format (pResult->m_Data .m_aaMessages [0 ], sizeof (pResult->m_Data .m_aaMessages [0 ]),
2038
- " %d. %s has won %d rounds of bombtag and played a total of %d with a win rate of %.02f%% requested by %s" ,
2039
- Ranking, pData->m_aName , RoundsWon, RoundsPlayed , ((float )RoundsWon / (float )RoundsPlayed ) * 100 .0f , pData->m_aRequestingPlayer );
2041
+ " %d. %s has won %d games of bombtag and played a total of %d with a win rate of %.02f%% requested by %s" ,
2042
+ Ranking, pData->m_aName , GamesWon, GamesPlayed , ((float )GamesWon / (float )GamesPlayed ) * 100 .0f , pData->m_aRequestingPlayer );
2040
2043
}
2044
+ str_format (pResult->m_Data .m_aaMessages [1 ], sizeof (pResult->m_Data .m_aaMessages [1 ]),
2045
+ " Hammer kills: %d - Collateral kills: %d - Total rounds survived: %d" , HammerKills, CollateralKills, RoundsSurvived);
2041
2046
}
2042
2047
else
2043
2048
{
2044
2049
str_format (pResult->m_Data .m_aaMessages [0 ], sizeof (pResult->m_Data .m_aaMessages [0 ]),
2045
- " %s has not played any rounds of bombtag" , pData->m_aName );
2050
+ " %s has not played any games of bombtag" , pData->m_aName );
2046
2051
}
2047
2052
return false ;
2048
2053
}
@@ -2057,11 +2062,11 @@ bool CScoreWorker::ShowTopWins(IDbConnection *pSqlServer, const ISqlData *pGameD
2057
2062
2058
2063
char aBuf[512 ];
2059
2064
str_format (aBuf, sizeof (aBuf),
2060
- " SELECT RANK() OVER (ORDER BY a.RoundsWon DESC) as Ranking, RoundsWon, RoundsPlayed , Name "
2065
+ " SELECT RANK() OVER (ORDER BY a.GamesWon DESC) as Ranking, GamesWon, GamesPlayed , Name "
2061
2066
" FROM ("
2062
- " SELECT RoundsWon , Name, RoundsPlayed "
2067
+ " SELECT GamesWon , Name, GamesPlayed "
2063
2068
" FROM %s_stats "
2064
- " ORDER BY RoundsWon DESC LIMIT ?"
2069
+ " ORDER BY GamesWon DESC LIMIT ?"
2065
2070
" ) as a "
2066
2071
" ORDER BY Ranking ASC, Name ASC LIMIT ?, 5" ,
2067
2072
pSqlServer->GetPrefix ());
0 commit comments