Compare commits

...

2 Commits

Author SHA1 Message Date
e2d3a57629 New endpoint: Get recent world records 2025-06-27 22:08:17 -04:00
083b8960aa Normalize param name 2025-06-27 22:08:05 -04:00

View File

@ -51,6 +51,9 @@ local STRAFESNET_API_ENDPOINTS = {
},
TIMES = {
LIST = "time",
WORLD_RECORD = {
GET = "time/worldrecord"
},
GET = "time/%d"
},
USERS = {
@ -79,9 +82,9 @@ end
function StrafesNET.ListRanks(GameId, ModeId, StyleId, SortBy, PageSize, PageNumber)
local RequestUrl = STRAFESNET_API_URL .. STRAFESNET_API_ENDPOINTS.RANKS.LIST
local Params = {
gameId = GameId,
modeId = ModeId,
styleId = StyleId,
game_id = GameId,
mode_id = ModeId,
style_id = StyleId,
sort_by = SortBy or 1,
page_size = PageSize or 10,
page_number = PageNumber or 1
@ -104,6 +107,20 @@ function StrafesNET.ListTimes(UserId, MapId, GameId, ModeId, StyleId, SortBy, Pa
return Request("GET", RequestUrl, Params, Headers)
end
function StrafesNET.GetWorldRecords(UserId, MapId, GameId, ModeId, StyleId, PageSize, PageNumber)
local RequestUrl = STRAFESNET_API_URL .. STRAFESNET_API_ENDPOINTS.TIMES.WORLD_RECORD.GET
local Params = {
user_id = UserId,
map_id = MapId,
game_id = GameId,
mode_id = ModeId,
style_id = StyleId,
page_size = PageSize or 10,
page_number = PageNumber or 0
}
return Request("GET", RequestUrl, Params, Headers)
end
function StrafesNET.GetTime(TimeId)
local RequestUrl = STRAFESNET_API_URL .. STRAFESNET_API_ENDPOINTS.TIMES.GET:format(TimeId)
return Request("GET", RequestUrl, nil, Headers)