PinionTech / pinion-adverts-gmod

Pinion Adverts for Garry's Mod
2 stars 2 forks source link

Remove fudge factor, handled in backend #10

Closed davidbanham closed 11 years ago

davidbanham commented 11 years ago

@azuisleet Can you run an eye over this and make sure I haven't done anything dumb?

azuisleet commented 11 years ago

This looks reasonable. This means that the time of the ad plus the time it took to load the ad is being reported?

davidbanham commented 11 years ago

Correct. In the page code we calculate ad length and load time. Load time is defined as the time between javascript execution starting in the browser and the video starting to play. We add that figure, then send it up to the server, which adds a fudge factor of a few seconds (currently 4) to account for the amount of time we expect to have elapsed between the plugin on the server starting to count down and the javascript engine beginning to execute.

So the figure that gets reported via the adback API that the plugin polls is: ad loading time + ad length + server-side fudge factor.