class Srcom::Api::Leaderboards

Defined in:

srcr/apis/leaderboards.cr

Constant Summary

Log = Srcom::Log.for("leaderboards")

Class Method Summary

Class Method Detail

def self.get_full_game_board(game : String, category : String, top : Int32 | Nil = nil, platform : String | Nil = nil, region : String | Nil = nil, emulators : Bool | Nil = nil, video_only : Bool = false, timing : String | Nil = nil, date : Time | Nil = nil, vars : Hash(String, String) | Nil = nil) : Srcom::Leaderboard #

game and category can both be ids or abbreviations Gets the full Leaderboard for the given game and the given category, where both game and category can be the respective id or abbreviation, and category must represent a per-game Category.

Setting top will restrict each Leaderboard to only contain the top N runs.

Both platform and region can be set to a Platform / Region id to restrict the Leaderboard to only containing runs completed on that Platform / Region.

When emulators is set to true, only runs done on an emulator will be included in the Leaderboard. If it is set to false, only runs not done on an emulator will be included. If it is nil, both runs doneon an emulated and runs done on a real system will be included.

If video_only is set to true, only runs with video proof will be included in the Leaderboard. If it is set to false, runs with and without video proof will be included.

Possible values for timing: "realtime", "realtime_noloads", or "ingame". This ranks the runs on the Leaderboard by that respective time.

Setting date will result in only runs that were done before the given date being included in the Leaderboard.

The vars hash needs to be of the format variable_id => value_id, which will restrict the Leaderboard to only include runs that have that Variable set to that Variable::Values::Value.

NOTE Giving a value for timing that the given game doesn't support will result in an error.


[View source]
def self.get_level_board(game : String, level : String, category : String, top : Int32 | Nil = nil, platform : String | Nil = nil, region : String | Nil = nil, emulators : Bool | Nil = nil, video_only : Bool = false, timing : String | Nil = nil, date : Time | Nil = nil, vars : Hash(String, String) | Nil = nil) : Srcom::Leaderboard #

game and category can both be ids or abbreviations Gets the full Leaderboard for the given game, the given category and the given *game, all of which can be their respective id or abbreviation, and where category needs to represent a per-level Category.

Setting top will restrict each Leaderboard to only contain the top N runs.

Both platform and region can be set to a Platform / Region id to restrict the Leaderboard to only containing runs completed on that Platform / Region.

When emulators is set to true, only runs done on an emulator will be included in the Leaderboard. If it is set to false, only runs not done on an emulator will be included. If it is nil, both runs doneon an emulated and runs done on a real system will be included.

If video_only is set to true, only runs with video proof will be included in the Leaderboard. If it is set to false, runs with and without video proof will be included.

Possible values for timing: "realtime", "realtime_noloads", or "ingame". This ranks the runs on the Leaderboard by that respective time.

Setting date will result in only runs that were done before the given date being included in the Leaderboard.

The vars hash needs to be of the format variable_id => value_id, which will restrict the Leaderboard to only include runs that have that Variable set to that Variable::Values::Value.

NOTE Giving a value for timing that the given game doesn't support will result in an error.


[View source]