mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-23 05:53:34 +00:00
remove extra stuff
This commit is contained in:
parent
e56d4dfbca
commit
768a9eda6c
@ -272,7 +272,6 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activi
|
|||||||
|
|
||||||
const auto oldScore = Database::Get()->GetPlayerScore(playerID, activityId);
|
const auto oldScore = Database::Get()->GetPlayerScore(playerID, activityId);
|
||||||
|
|
||||||
std::string saveQuery("UPDATE leaderboard SET timesPlayed = timesPlayed + 1 WHERE character_id = ? AND game_id = ?;");
|
|
||||||
ILeaderboard::Score newScore{ .primaryScore = primaryScore, .secondaryScore = secondaryScore, .tertiaryScore = tertiaryScore };
|
ILeaderboard::Score newScore{ .primaryScore = primaryScore, .secondaryScore = secondaryScore, .tertiaryScore = tertiaryScore };
|
||||||
if (oldScore.has_value()) {
|
if (oldScore.has_value()) {
|
||||||
bool lowerScoreBetter = leaderboardType == Leaderboard::Type::Racing || leaderboardType == Leaderboard::Type::MonumentRace;
|
bool lowerScoreBetter = leaderboardType == Leaderboard::Type::Racing || leaderboardType == Leaderboard::Type::MonumentRace;
|
||||||
@ -286,13 +285,13 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activi
|
|||||||
ILeaderboard::Score newScoreFlipped(newScore.secondaryScore, newScore.primaryScore);
|
ILeaderboard::Score newScoreFlipped(newScore.secondaryScore, newScore.primaryScore);
|
||||||
newHighScore = newScoreFlipped > oldScoreFlipped;
|
newHighScore = newScoreFlipped > oldScoreFlipped;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newHighScore) {
|
if (newHighScore) {
|
||||||
Database::Get()->UpdateScore(playerID, activityId, newScore);
|
Database::Get()->UpdateScore(playerID, activityId, newScore);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Database::Get()->SaveScore(playerID, activityId, newScore);
|
Database::Get()->SaveScore(playerID, activityId, newScore);
|
||||||
}
|
}
|
||||||
LOG("save query %s %i %i", saveQuery.c_str(), playerID, activityId);
|
|
||||||
|
|
||||||
// track wins separately
|
// track wins separately
|
||||||
if (leaderboardType == Leaderboard::Type::Racing && tertiaryScore != 0.0f) {
|
if (leaderboardType == Leaderboard::Type::Racing && tertiaryScore != 0.0f) {
|
||||||
|
Loading…
Reference in New Issue
Block a user