Parkkeo1/CS-Py

Edge case where two POST requests are sent for one round.

Closed this issue · 2 comments

Two entries within one second of each other. Edge case where I died to the last enemy but was instantly traded, ending the round. Since my death animation had not completed yet, I was not spectating and thus the player ID was me instead of the teammate who traded me.

1515799616 de_cache live dumby CT 2.0 0.0 4.0 0.0 4.0 4550.0 2.0 1.0
1515799617 de_cache live dumby CT 2.0 1.0 4.0 1.0 5.0 4550.0 2.0 1.0

The edge case caused the error in pistol stats. Also, will adjust threshold value to be more lenient ($200 + $800 = total highest possible equip. value for pistol round)

SQL data for game: player_data.txt

Temporary fix for this issue has been pushed to master. GSHandler now checks (if not endgame payload) if the difference in time between the last entry and current to-be entry is greater than 1 second. If so, entry is inserted into the table.

I've also thought of a slower, but safer fix using a manual for loop through the df to pick out individual indices remove AFTER the edge case entries have been added. Being tested in database.py.

Successfully tested the remove last/replace with new method by using manual POST request with python-requests.

test.json added to manually test GSHandler edge case fix