Ant Zucaro [Mon, 18 Jun 2012 00:10:20 +0000 (20:10 -0400)]
Add favorite map support.
This commit adds a line item to the player_info page
showing the player's favorite map. This is the map
the player has played the most in the past 90 days.
A link to the map_info page of that map in included.
Ant Zucaro [Sat, 16 Jun 2012 13:44:21 +0000 (09:44 -0400)]
Integrate the damage efficiency graph in player_info.
It isn't complete yet, but it is much better than before, where
new players would have a blank graph. Now it checks that the
given player has *any* accuracy or damage based weapon usage
and shows the graph accordingly. If the player does not have
five games of either, the appropriate graph doesn't show.
The incomplete part is that I'm not setting the default
weapon to show (nex and rocket launcher). If a player plays,
say, 10 games avoiding the rocket launcher then it will still
show a blank graph b/c the rocket launcher is the default dmg
weapon shown. This will be fixed, I just need to find a good way.
Ant Zucaro [Fri, 15 Jun 2012 13:39:25 +0000 (09:39 -0400)]
Add a damage efficiency view structure.
Allow tracking of damage efficiency as well. Damage efficiency I'll
define as the amount of damage you do per hit. The higher, the
better! This is appropriate for all splash-damage weapons. Spam shots
are not included on purpose (unless they hit, of course) after
conversations with the competitive community; spam shots usually miss
and are intended for blocking routes or catching your opponent while
they are out of your direct line of sight.
Ant Zucaro [Wed, 16 May 2012 02:37:38 +0000 (22:37 -0400)]
Add initial support for JSON on map_index view.
This commit adds initial JSON support to the map_index view.
I am giving each model class a to_dict function that returns
a select number of its instance variables back in the form of
a dictionary, which can then be returned directly by a JSON
renderer. I'm not sure if this is the right way to go, but
it works for now.
I've also ripped out the main "data-calling" piece of each
view callable into a separate function so that the JSON-
enabled view callable can use it. The non-JSON one just
returns the result of that function, while the JSON one
massages the data to be able to make it fit better for
API-like consumption.
Ant Zucaro [Mon, 14 May 2012 20:55:51 +0000 (16:55 -0400)]
Make pagination a GET parameter, not part of the URL.
It was not the best idea to add the 'page' displayed to be an actual
part of the URL. It should be a GET parameter instead, which jives
a little better with my understanding of REST-like resources. This
changes all paginated views to use a GET parameter and also limits
results returned to 10 per page for performance and viewability
reasons.
Ant Zucaro [Mon, 14 May 2012 16:55:49 +0000 (12:55 -0400)]
Do not die if missing revision metadata.
The Xonotic revision metadata comes as a part of the 'R'
line in the POST. Although it isn't required, server was dying
when it was missing. I made it optional now, defaulting
that field to "unkown" when it isn't present. Note: DTG
brought this issue into the light, as they custom compile
their Xonotic, and they omit #ifdef'ing WARPZONE, which
is what prints the 'R' line in stats.
Ant Zucaro [Mon, 30 Apr 2012 01:47:58 +0000 (21:47 -0400)]
Add a toggle-able accuracy selector to the player info page.
You can choose which weapon to show accuracy stats for. The only weapons shown are those that the player has used in 5 or more games in the past 90 days. This is still a work in progress, as I don't have labels or nice hovers for the datapoints. :(
Ant Zucaro [Sun, 29 Apr 2012 16:10:14 +0000 (12:10 -0400)]
Initial version of ajax-updating of the accuracy graph.
The accuracy view needs to be changed to accommodate clicking on weapons where not enough data is supplied. Right now it results in a JS error that halts all further updates to the graph.
Don't throw an error if the number of duel ranks found is < 10.
I was using '-' as a filler in such cases, and was populating four values into a tuple. The template expected three, so in situations when I had to fall back on the filler values, I was providing one too many, leading to 'too many values to unpack' upon loading up the main page.
Ant Zucaro [Tue, 17 Apr 2012 00:39:39 +0000 (20:39 -0400)]
Adds an accuracy graph and removes the overall accuracy table.
In retrospect the accuracy/damage table was a cop-out. It doesn't really show anything useful, it was just easy to display query-wise. Meanwhile I've been told time and time again that nex accuracy is the only thing that people are truly looking at as a measure of their accuracy, so that is what this commit does in graphical form. Other useful things will come later, but likely not in a tabular format again.
Ant Zucaro [Sun, 15 Apr 2012 11:42:11 +0000 (07:42 -0400)]
Add some kill ratio and win percentage, clean up recent games.
Added the kill ratio and win percentage to the first section along with a breakdown of how I got them. Also cleaned up the recent games section so it looks more like what is on all of the other "leaderboard" pages, which people should expect. I removed the overall stats section altogether, as 99% of the time people are looking after what is currently provided (e.g. flag carrier kills = rather unimportant in the grand scheme of things).
Ant Zucaro [Tue, 27 Mar 2012 21:23:53 +0000 (17:23 -0400)]
Add Google Analytics support.
Stats has been operational for almost six months now, yet I don't have a clue of how many people are using/visiting the site on a daily basis. It's time to fix that! GA support will be tracked up to the xonstat address at gmail.com.
Ant Zucaro [Tue, 20 Mar 2012 11:07:23 +0000 (07:07 -0400)]
Huge performance boost for the DB queries on the home page.
The queries on the home page weren't bound by dates (which are indexed) or limited by the number of rows returned (despite the tables being a fixed size there). Adding these two filters on each of the queries makes the home page fly. The dates are done w/ a BETWEEN clause, while the limit on the queries is done w/ a normal LIMIT statement. The result takes the page from 3.5s average load time to about 400ms. :D :D :D
Ant Zucaro [Sun, 18 Mar 2012 20:07:03 +0000 (16:07 -0400)]
Cap RGB value darkness by first converting to HSL, then applying threshold.
RGB values that were too dark to read against a black background are now viewable. This is done by converting the RGB values (from the hex values provided) to HSL, then moving any L (lightness) values beyond a certain threshold back. Finally they are converted back to RGB for display. In practice all this really does is to lighten the dark colors without changing their hue or saturation values (e.g. black becomes gray).
Thanks go to dmazary for helping me with this and working through the various bugs I found. Thanks, Dave!
David Mazary [Fri, 16 Mar 2012 15:14:36 +0000 (12:14 -0300)]
Idea about classifying text as light or dark so css styling could increase contrast for dark text. This looks interesting: http://css-tricks.com/adding-stroke-to-web-text/ Maybe using that trick with an electric-blue text outline for dark text.
Ant Zucaro [Thu, 15 Mar 2012 11:16:08 +0000 (07:16 -0400)]
Add an itemized breakdown of the games played by a player.
This is so we can see how many of each type of game type that the player has played. It will look like <total games played> (<number of games played> <game type cd>).
Ant Zucaro [Wed, 14 Mar 2012 02:19:59 +0000 (22:19 -0400)]
Honor cl_allow_uid2name 0 when cl_allow_uidtracking is 1.
In an attempt to display better nick information I've overwritten the provided nick (in this case none) w/ what was on the player record. This is wrong - if uid2name is 0, thus leading to no nick provided, that means I should show "Anonymous Player". This ends up being a little silly when uidtracking is 1, because a person can just click on the "Anonymous Player" link to see who was actually playing :D.