Closed davidbanham closed 11 years ago
I want to make sure I understand this one clearly:
The server admin need only set a maximum view duration. The user story is "I am happy for my users to be forced to wait n seconds, but no longer. If it becomes apparent that we're finished showing them content before that, they should be allowed to pass immediately."
Pseudocode:
maxDuration = 25
function trapContinue ->
if connectionTimer > maxDuration then continue()
else return null
http.get AdBackUrl + steamID, (returnVal) ->
if returnVal.status == 404 then tryAgain(3)
else if returnVal.status == 200
maxDuration = returnVal.body if returnVal.body < maxDuration
Alright one more question: Is this duration something I get before showing the MOTD, or do I get the value after the MOTD is shown to the player, and then adjust the viewing duration?
The data is only available after the ad has started playing in the MOTD. So yes, the duration needs to be adjusted.
This logic is implemented.
http://adback.pinion.gg/duration/:steamID Return values: 404 - No data available for that steamID. Expected behaviour, query again in 3 seconds. 200 - Set wait duration to Int contained in response body, unless that would cause duration to be longer than maximum specified by the server admin. Example: 404 - http://adback.pinion.gg/duration/wat 200 - http://adback.pinion.gg/duration/debug