Ant Zucaro [Sun, 29 Nov 2015 15:07:55 +0000 (10:07 -0500)]
Clean up xs_submit.
This was written when I didn't really know that much Golang. I know a little
bit more about it now, so I can at least format accordingly! Also I know how to
use a Scanner now. Shame on my past self...
Ant Zucaro [Sun, 29 Nov 2015 15:05:08 +0000 (10:05 -0500)]
Fetch ranks for the post-match report.
The ranks are updated daily, so they don't change game-per-game for an
individual, but having the rank value still tells people how strong a player
is that they've been playing against.
Ant Zucaro [Thu, 19 Nov 2015 01:29:07 +0000 (20:29 -0500)]
Provide a plaintext response to stats submissions.
For all of XonStat's history the POST requests sent in by servers had plain
HTTP responses. This begins to change with this commit, which responds back to
the Xonotic server with meaningful information about /what happened/ during the
match that was just submitted. Of particular importance are the player_ids and
elo delta values that were stored as a result of the game. The template
establishing the format for this is submit_stats.mako. It will be extended
after we decide what other things we want to include.
Ant Zucaro [Sat, 14 Nov 2015 21:20:33 +0000 (16:20 -0500)]
Refactor the Elo processing code into EloProcessor.
Before, Elo processing was simply a couple of extra methods that mutated
PlayerGameStat and PlayerElo rows, adding them to a session for updating or
inserting later. In order to support an end-of-match game report, we now need
to hold onto to those intermediate values so they can be passed into a
template. To do this I created an EloProcessor class to perform all of the
computation and an EloWIP class to hold onto all of the intermediate values.
EloProcessor can be used to find out what changed during Elo calculations.
Ant Zucaro [Sun, 8 Nov 2015 19:22:01 +0000 (14:22 -0500)]
Clean up the production configuration file.
This includes a little better organization of the production.ini file for
administrators. It includes comments on the different directives, better
indentation, and rotating log files of limited size using Python's
logging.handlers.RotatingFileHandler facility.
Ant Zucaro [Sat, 7 Nov 2015 15:15:54 +0000 (10:15 -0500)]
Don't put anonymous players in games.players
The "games" table has a convenience, de-normalized column for storing the list
of player_ids who played in that game. This is intended for use in quick
searches. Since anonymous players (players having a player_id == 2) aren't
searchable, they don't need to be in this list. This should decrease the
overall size of the GIN index on that column over time.
Ant Zucaro [Wed, 22 Apr 2015 10:48:25 +0000 (06:48 -0400)]
Remove the join to game stats for accuracy data.
This speeds up the game_info view considerably. On my local machine the
requests go from .62 to about .2 seconds! I believe the pgstat rows were
included in the response to show nicknames in the accuracy table.
I'll have to do further checks to ensure that if a pgstat row exists a
corresponding pwstat row exists as well.
Ant Zucaro [Sat, 21 Mar 2015 19:40:09 +0000 (15:40 -0400)]
Convert the player_info page.
Geez that was a huge one. I'll have to refactor this one later. In particular
the tab content is long and convoluted. It is a good candidate for moving into
a separate template, which can then be used with a namespace.
Ant Zucaro [Wed, 18 Mar 2015 10:43:02 +0000 (06:43 -0400)]
Remove the server_game_index view.
This view was replaced by the game_finder view. During that time I removed the
other views that implemented this functionality, but I must have missed this
one! It still had an active route mapping, although no other route used it.