Ant Zucaro [Sun, 25 Nov 2012 15:15:48 +0000 (10:15 -0500)]
Small copy change for the server info page.
"Recent" isn't exactly recent for some servers. I'll label it
"Most Recent" instead. That makes more sense when servers have
not had any games in a long time.
Ant Zucaro [Mon, 19 Nov 2012 00:27:14 +0000 (19:27 -0500)]
Make the "recent games" section more modular.
The main page was constructing all of the recent games queries
manually before. Now I've moved the query and the associated
class (which would have been a namedtuple if not for the various
transformations needed) into a new "helpers" view. This view is
intended to house query functions and the corresponding classes
for them, so no more grabbing from a query, then looping around
and creating namedtuples to get stuff like nick_html_colors. Now
one can just pass the row returned by the query to a class, which
will "know" how to construct stuff like that. Win!
Ant Zucaro [Wed, 14 Nov 2012 04:02:56 +0000 (23:02 -0500)]
Provide an option to show elo deltas on the game info page.
I was tired of looking at the actual elo deltas by bouncing
between the player_info and game_info pages for several
players just to see their collective elo delta values. This
provides a query parameter "show_elo" to the game info page
to show the extra elo delta column.
As a bonus, the up/down/neutral arrows on the player_info
page will take you to a scoreboard page where those values
are shown.
Ant Zucaro [Fri, 9 Nov 2012 04:42:29 +0000 (23:42 -0500)]
Handle Elos properly when players have big alivetimes.
Due to a bug, the alivetimes for players also include time
spent in warmup. Since elo uses score per second, the
skewed alivetime made players who actually lost look like
they won under certain circumstances (like when their
opponent spent a very long time in warmup).
This change puts a ceiling on the alivetime used by Elo
by limiting the alivetime to be at most the game's
duration.
Ant Zucaro [Fri, 9 Nov 2012 04:18:55 +0000 (23:18 -0500)]
Parse and store the game's duration.
The duration has been sent for a while as the 'D' line, but
it hasn't really been needed until now; it was just a nice thing
to have. Now Elo calculations are messing up because the warmup
time is being summed into player alivetimes. This duration field
can assist in creating a workaround. Having it, Elo calculations
can know the true maximum game time, so anything higher can be
brought down to the "floor" of the real duration of the match.
Ant Zucaro [Fri, 2 Nov 2012 01:59:21 +0000 (21:59 -0400)]
Show the best flag capture times on the game info page.
The best flag capture time for each player is shown in the game
info page now. This only happens for CTF. The format shown is
seconds.milliseconds, with up to two decimal places shown.
Ant Zucaro [Mon, 29 Oct 2012 15:49:03 +0000 (11:49 -0400)]
Add storage of captimes and fastest caps.
Fastest caps are recorded on a per-player basis in the game_stats
table, and the player's overall fastest cap on a given map is
stored in a new table, player_map_captimes.
One weird thing is if the constraint on game_id in the captimes
table is enabled, sqla throws an integrity error. For this reason
the constraint is disabled (commented out in xonstatdb) even though
it should be there. More investigation is needed.
Ant Zucaro [Sun, 7 Oct 2012 02:37:09 +0000 (22:37 -0400)]
Make the "recent games" table expand with the "more" link.
Previously a big list of scoreboards would be shown if a person
clicked on the "more" link below the "recent games" table on the
player info page. Now a table that is exactly the same is shown,
but with pagination. This is in essence an attempt to keep the
same elements in the view; when a person clicks on a "more" link,
they expect to see more of the same items they were looking at.
The end benefit for players is that they can quickly page through
all of their games and see summary results as well as their elo
changes from one simple view.
Ant Zucaro [Sat, 6 Oct 2012 15:00:30 +0000 (11:00 -0400)]
Add elo deltas to the player info page.
The elo deltas will just show an up, down, or neutral icon for how
their elo has changed during the games in the "recent games" table
at the bottom of the page. Hovering over these icons will show the
actual delta value in the event it went up or down (rather than
stayed the same).
Ant Zucaro [Sat, 22 Dec 2012 21:57:46 +0000 (16:57 -0500)]
Refactor the "top <blah>" tables on the front page, cache them.
The main_index view was getting a little long, so I factored out
the "top <blah>" data queries into separate functions. I cached
those functions under an hourly term while I was at it.
Ant Zucaro [Sat, 22 Dec 2012 20:59:17 +0000 (15:59 -0500)]
Simplify the rank table calculations. Woohoo, negative LOC!
Before the main view was running three separate, similar queries
to grab the rank data for the three game types shown on the page.
This was factored out into a separate function that can be called
and cached (currently hourly_term). Also if no ranks are available,
don't show tables filled with '-' characters, but rather an
informative message instead.
Ant Zucaro [Tue, 11 Dec 2012 22:28:02 +0000 (17:28 -0500)]
Add a JSON Elo view to support autobalance.
The view at /elo/<hashkey> will send just Elo info about a player.
This is to facilitate a possible autobalance feature where the
Xonotic server will request Elo values for all of the
players entering the game, then use it (among other things) to
figure out who needs to be switched to make the teams right.
Ant Zucaro [Tue, 4 Dec 2012 02:55:22 +0000 (21:55 -0500)]
Add a hashkey view similar to the player_info JSON one.
This view is driven by hashkey (not player_id) so the Xonotic
server can query for info using something it knows. The response
value is a JSON object containing the things in the player info
page minus the recent weapons and recent games stuff.
The URL pattern is /hashkey/<hashkey value>.
All this is pretty alpha and is subject to change once we truly
determine our needs Think of this as a proof of concept for
communicating between the game server and the webapp.
Ant Zucaro [Sun, 25 Nov 2012 15:15:48 +0000 (10:15 -0500)]
Small copy change for the server info page.
"Recent" isn't exactly recent for some servers. I'll label it
"Most Recent" instead. That makes more sense when servers have
not had any games in a long time.
Ant Zucaro [Mon, 19 Nov 2012 00:27:14 +0000 (19:27 -0500)]
Make the "recent games" section more modular.
The main page was constructing all of the recent games queries
manually before. Now I've moved the query and the associated
class (which would have been a namedtuple if not for the various
transformations needed) into a new "helpers" view. This view is
intended to house query functions and the corresponding classes
for them, so no more grabbing from a query, then looping around
and creating namedtuples to get stuff like nick_html_colors. Now
one can just pass the row returned by the query to a class, which
will "know" how to construct stuff like that. Win!
Ant Zucaro [Wed, 14 Nov 2012 04:02:56 +0000 (23:02 -0500)]
Provide an option to show elo deltas on the game info page.
I was tired of looking at the actual elo deltas by bouncing
between the player_info and game_info pages for several
players just to see their collective elo delta values. This
provides a query parameter "show_elo" to the game info page
to show the extra elo delta column.
As a bonus, the up/down/neutral arrows on the player_info
page will take you to a scoreboard page where those values
are shown.
Ant Zucaro [Fri, 9 Nov 2012 04:42:29 +0000 (23:42 -0500)]
Handle Elos properly when players have big alivetimes.
Due to a bug, the alivetimes for players also include time
spent in warmup. Since elo uses score per second, the
skewed alivetime made players who actually lost look like
they won under certain circumstances (like when their
opponent spent a very long time in warmup).
This change puts a ceiling on the alivetime used by Elo
by limiting the alivetime to be at most the game's
duration.
Ant Zucaro [Fri, 9 Nov 2012 04:18:55 +0000 (23:18 -0500)]
Parse and store the game's duration.
The duration has been sent for a while as the 'D' line, but
it hasn't really been needed until now; it was just a nice thing
to have. Now Elo calculations are messing up because the warmup
time is being summed into player alivetimes. This duration field
can assist in creating a workaround. Having it, Elo calculations
can know the true maximum game time, so anything higher can be
brought down to the "floor" of the real duration of the match.
Ant Zucaro [Fri, 2 Nov 2012 01:59:21 +0000 (21:59 -0400)]
Show the best flag capture times on the game info page.
The best flag capture time for each player is shown in the game
info page now. This only happens for CTF. The format shown is
seconds.milliseconds, with up to two decimal places shown.
Ant Zucaro [Mon, 29 Oct 2012 15:49:03 +0000 (11:49 -0400)]
Add storage of captimes and fastest caps.
Fastest caps are recorded on a per-player basis in the game_stats
table, and the player's overall fastest cap on a given map is
stored in a new table, player_map_captimes.
One weird thing is if the constraint on game_id in the captimes
table is enabled, sqla throws an integrity error. For this reason
the constraint is disabled (commented out in xonstatdb) even though
it should be there. More investigation is needed.
Ant Zucaro [Sun, 7 Oct 2012 02:37:09 +0000 (22:37 -0400)]
Make the "recent games" table expand with the "more" link.
Previously a big list of scoreboards would be shown if a person
clicked on the "more" link below the "recent games" table on the
player info page. Now a table that is exactly the same is shown,
but with pagination. This is in essence an attempt to keep the
same elements in the view; when a person clicks on a "more" link,
they expect to see more of the same items they were looking at.
The end benefit for players is that they can quickly page through
all of their games and see summary results as well as their elo
changes from one simple view.
Ant Zucaro [Sat, 6 Oct 2012 15:00:30 +0000 (11:00 -0400)]
Add elo deltas to the player info page.
The elo deltas will just show an up, down, or neutral icon for how
their elo has changed during the games in the "recent games" table
at the bottom of the page. Hovering over these icons will show the
actual delta value in the event it went up or down (rather than
stayed the same).
Jan Behrens [Mon, 1 Oct 2012 19:48:47 +0000 (21:48 +0200)]
Moved over to new Xonstat API (using functions xonstat.views.player directly);
enabled UTF-8 encoded playernicks for testing (FIXME: it is known that some nicks cause problems with cairo currently)
Ant Zucaro [Fri, 28 Sep 2012 02:19:52 +0000 (22:19 -0400)]
Add total playing time.
I forgot to add the total playing time from the get_overall_stats
call. This includes it and moves win percentage over to the right
pane to space things out more evenly.
Ant Zucaro [Wed, 26 Sep 2012 02:47:18 +0000 (22:47 -0400)]
Acceptable version of the games breakdown tab.
This version does not have localized time. More code changes are
needed to add it, and I just ran out of time. It is simple enough
to add and will come soon. This commit basically styles the tabs
and also adds a cap_ratio when you click on ctf.
Ant Zucaro [Thu, 20 Sep 2012 02:56:09 +0000 (22:56 -0400)]
Get rid of unneeded functions. Away with you. Away!
All of the old functions returned data in a format that wasn't
very flexible, or didn't break down the information by game type.
Out with them! Named tuples are now used, making for much more
readable (if not a bit lengthy) templates.
Ant Zucaro [Thu, 20 Sep 2012 02:51:53 +0000 (22:51 -0400)]
Initial checkin of tabs for the player_info view.
Underneath the player's nick will be a tabbed list of game types,
starting with "overall." Within each of these tabs will be stats
pertaining to only that game type. This allows players to view
fine-grained details about their playing history.
Note that this commit does not style the table much. This is mainly
to ensure that all of the content is being fetched properly.