Ant Zucaro [Mon, 14 Nov 2016 01:09:15 +0000 (20:09 -0500)]
Make precondition failures return plain-text.
These show up in the server admin's logs as HTML currently. Making them plain
text (which is, of course, how the server logs are formatted) makes them easier
to see and understand.
Ant Zucaro [Mon, 14 Nov 2016 00:45:20 +0000 (19:45 -0500)]
Improve server matching.
The old code would attempt to match on hashkey OR name, depending on what
information was provided. The new version will search on both at the same time
by using the builder pattern on the query.
Ant Zucaro [Sun, 6 Nov 2016 00:58:59 +0000 (00:58 +0000)]
Merge branch 'sev/xolonium4-badges' into 'master'
Render badges with Xolonium 4.0
I have recently finished Xolonium 4.0, available [here](https://fontlibrary.org/en/font/xolonium).
Most notably, it now also includes a hinted ttf version. As a result, it should be possible to render the badges with sharper text.
Now, there is no point in just telling you this, so I pushed this branch as a potential update for the badge scripts. It adds the necessary hinting options and slightly adjusts some of the font sizes and positions, to optimize the result. Of course, it is necessary to install the new ttf version first.
I also have noticed that the rendered badge images are quite heavy. It would be fairly easy to cut their size by reducing the colors to 8bit, without a noticable effect on quality. I have added an exemplary script (optimize.sh), which could reduce file sizes by almost half.
Ant Zucaro [Sun, 6 Nov 2016 00:52:48 +0000 (00:52 +0000)]
Merge branch 'sev/xolonium4' into 'master'
Update Xolonium webfonts
This branch updates the webfonts to [Xolonium 4.0](https://fontlibrary.org/en/font/xolonium).
Note that I have deleted the .svg format, because it is [deprecated](http://caniuse.com/svg-fonts).
In return, I have added the new .woff2 format, which offers better compression.
Also note that I have removed Arial and Helvetica as fallbacks, resulting in:
`font-family:Xolonium,sans-serif;`
I consider this preferable, because it falls back to the default sans-serif font,
which should be the "best" font as determined by the system or the user.
I can change it back if desired.
Ant Zucaro [Sat, 6 Feb 2016 21:21:44 +0000 (16:21 -0500)]
Make the active players/servers/maps use the cache.
Instead of fetching from the base data, the active players/server/maps views
will fetch from the so-called "materialized view" tables instead. These tables
are precomputed and will be MUCH faster, performance-wise. Regular Beaker
caching remains the same for these, and the paginated pages now only support
clicking "more" until the list is exhausted. Perhaps in the future they will be
fetched via JSON and appended to the page in a "never-ending scroll" thing.
Ant Zucaro [Wed, 27 Jan 2016 01:16:57 +0000 (20:16 -0500)]
Force create_dt to start_dt for games.
There's some drift in the database between the two, when in actuality they
should only be milliseconds apart. The start_dt *was* being set via the
application and the create_dt with a database default. The values resulting
from the defaults were sometimes minutes earlier, which doesn't makes sense.
Until the true cause is identified I'll force the two to be the same.
Ant Zucaro [Sat, 23 Jan 2016 15:51:36 +0000 (10:51 -0500)]
Fix the navigation icons. Fixes #161.
For some reason the navigation links were still using the old "glyphicon" font
classes. This meant that the actual "previous" and "next" page links weren't
actually visible, leading to some navigation issues. Changing them to the
font-awesome classes makes them visible again!
Ant Zucaro [Sat, 23 Jan 2016 15:08:41 +0000 (10:08 -0500)]
Whitelist rank game types in the view. Fixes #162.
The game types where you could view ranks were previously controlled by a
regular expression check within the route. This was completely NOT obvious to
troubleshoot. This moves them to within the view, which is much easier to
control. Additionally, a 404-check is added for malformed values.
Ant Zucaro [Sat, 16 Jan 2016 22:36:56 +0000 (17:36 -0500)]
Move MapCapTime and PlayerCapTime to models.
The more I thought about it, the more I think that these two classes should
live inside the models module. They are nothing more than models for views. So
what if they aren't object-relational!
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.