New endpoint: Get recent world records
This commit is contained in:
@ -51,6 +51,9 @@ local STRAFESNET_API_ENDPOINTS = {
|
|||||||
},
|
},
|
||||||
TIMES = {
|
TIMES = {
|
||||||
LIST = "time",
|
LIST = "time",
|
||||||
|
WORLD_RECORD = {
|
||||||
|
GET = "time/worldrecord"
|
||||||
|
},
|
||||||
GET = "time/%d"
|
GET = "time/%d"
|
||||||
},
|
},
|
||||||
USERS = {
|
USERS = {
|
||||||
@ -104,6 +107,20 @@ function StrafesNET.ListTimes(UserId, MapId, GameId, ModeId, StyleId, SortBy, Pa
|
|||||||
return Request("GET", RequestUrl, Params, Headers)
|
return Request("GET", RequestUrl, Params, Headers)
|
||||||
end
|
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)
|
function StrafesNET.GetTime(TimeId)
|
||||||
local RequestUrl = STRAFESNET_API_URL .. STRAFESNET_API_ENDPOINTS.TIMES.GET:format(TimeId)
|
local RequestUrl = STRAFESNET_API_URL .. STRAFESNET_API_ENDPOINTS.TIMES.GET:format(TimeId)
|
||||||
return Request("GET", RequestUrl, nil, Headers)
|
return Request("GET", RequestUrl, nil, Headers)
|
||||||
|
Reference in New Issue
Block a user