Skip to content

Commit

Permalink
Merge pull request #57 from MikeIsAStar/allow-get-top-ten-rankings-re…
Browse files Browse the repository at this point in the history
…quests-for-competitions

RACE: Allow 'GetTopTenRankings' requests for competitions
  • Loading branch information
mkwcat authored Jul 26, 2024
2 parents a5d5bac + ffd533e commit 9591255
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions race/nintendo_racing_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,19 @@ func handleNintendoRacingServiceRequest(moduleName string, responseWriter http.R
logging.Error(moduleName, "Invalid region id")
return
}
if !courseId.IsValid() {
if courseId < common.MarioCircuit {
logging.Error(moduleName, "Invalid course id")
return
}

logging.Info(moduleName, "Received a request for the Top 10 of", aurora.BrightCyan(courseId.ToString()))
var topTenLeaderboard string
if courseId <= common.GBAShyGuyBeach {
topTenLeaderboard = courseId.ToString()
} else {
topTenLeaderboard = "a competition"
}

logging.Info(moduleName, "Received a request for the Top 10 of", aurora.BrightCyan(topTenLeaderboard))
handleGetTopTenRankingsRequest(moduleName, responseWriter)
}
}
Expand Down

0 comments on commit 9591255

Please sign in to comment.