Back-end part of the /dev/null/nethack replacement tournament. Work in progress.
--help
Display usage summary and exit.
--json, --json=file
Output the scoreboard's internal data that are passed into templates as JSON
text file, either on output or to specified file.
--nohtml
Do not compile templates into HTML. Useful when you only want to get the
JSON data.
--coalesce=file
Merge the source xlogfiles into one unified xlogfile. This can be used by
external consumer to see the tournament as a single source.
The scoreboard collates single coherent data structure that is passed to the Template Toolkit templates to produce final HTML pages. Alternatively, this data structure can be output as JSON encoded text.
Following are the top-level sections of the data
- games
- players
- clans
- trophies
- config
The detailed description of the section follows.
This section has only two sub-sections: all and ascs.
games.all
games.all is an array of hashes, each hash representing one game
from xlogfile(s), with the keys being the xlogfile fields with some
additional fields added by the scoreboard. The order is by value of
endtime, ascending.
games.all acts as the master games list. Every other part of the
data that refers to individual games refers to this array's numerical
index. In other words, games are referenced as integers, that are
an index to this array.
Following fields are taken from xlogfile fields with some caveats (see below):
name, points, role, race, gender, align, maxlvl,
realtime, deathlev, turns, starttime, endtime, death,
maxhp , hp,
These fields are processed and not taken verbatim from xlogfile:
genderandalignare starting gender and alignmentsstarttimeandendtimeare formatted to be human-readable
Following fields are added by the scoreboard during parsing:
srcis the short-name of the source serverclan_uniqueindicates if the game is a unique ascension for player's clanachievementsis an array of player's achievements' short-namesdumplogis a URL of the dumplognis the index (sometimes useful when passing ref to the game itself)scumindicates if the game is regarded as scummmed; scumming criteria are defined in configuration
games.ascs
This is a simple array of ascended games, in chronological order.
This section lists all the player details. Players, for the purpose of the scoreboard, are identified by their name, ie. there is no special index. This is different from clans, which are refered to by numerical index.
players.all
This is the master player "list". It's actually hash with player names as hash keys.
Each player is a hash with following keys:
nameis simply player's name (the same as the key value)gamesis list of player's gamesascsis list of player's ascensionsrankis player's rank in the ordering of players inplayers.orderedmaxlvlis player's maximum experience level achievedscoreis player's summary scorescoresis player's scoring log (see below)achievementsis list of player's achievements (this key always exists, even if empty)maxcondis player's maximum of conducts reached in single game (only exists for ascending players)minturnsis a turncount of player's fastest gametime ascensionminscoreis player's minimum score for a winning gamehighscoreis player's high score for a winning gamemaxstreaklenis player's longest streak's lengthrealtimeis player's fastest realtime of a winning game, in human readable formatratiois player's ascension ratio (only exists for ascending players)streaksis list of player's streaks, streaks are in turn lists of streak games (only exists for players with streaks)clanis a reference to clan definition (numerical index, only exists for players that are clan members)trophiesis list of scoring entries (the same as inscores), but only with actual trophies)scumis a count of scummed games, this field always exists
players.ordered
This is list of playernames ordered by the primary sorting criteria (score, number of ascensions etc.).
scoring entries
Both players and clans have associated lists of scoring entries.
Each event that generates some points is logged in scoring list
(scores key in player/clan). Single scoring entry is a hash
with following keys:
trophyis trophy short name like minturns, ascension etc. (note: the entry might be for something that is not actually a trophy, like a simple ascension); clan trophies "clan-" prepended to them, eg. clan-minturnswhenis Unix epoch time of when the scoring entry was issuedwhen_fmtis human-readable time of when the scoring entry was issued*pointsnumber of points the entry is issued fordatais a hash of additional, trophy specific data, this can be empty or even missing
This section details clan data and has two keys all and ordered.
clans.all
List of hashes, each hash for one clan. The (numerical) index of a clan in this array is how the clans are refered to elsewhere.
Following keys are present:
nameis clan's namenis clan's index valueplayersis list of clan membersadminsis list of clan members with admin privilegegamesis list of all clan's gamesascsis list of clan's ascensionsratiois clan's ascension ratiounique_ascsis a list of ascensions that are unique for the clanachievementsis list of clan achievementsudeaths_rankis clan's rank in the Unique Deaths competitionunique_deathsis list of (death message, game) tuples; the game refers to the game that cause the new death reason to be logged for the clanscoresis clan's full scoring log (see above in players section)trophiesis clan's trophy log (see above in players section), it only lists real trophies, not things like single ascensions, individual streaks etc.rankis clan's rank in clan competitionscoreis summary clan scoregames1000tis count of clan's games over 1000 turnsunique_ascsis count of clan's unique (ie. non-repeating) ascensions
clans.ordered
List of clan indices ordered by clan scores.
This section primarily exists to generate the Trophies page. It has two
sub-sections: players and clans. Both of these have the same structure,
so we will describe them at once.
The keys under players or clans are the trophy short words such as
minturns, mostascs or gimpossible. Where the trophy can only be held
by one player/clan, there's only single value. Otherwise, the value is a list
of values.
The exception here are trophies Great/Lesser Race/Role. These are under keys
greatfoo and lesserfoo and have subkeys such greatrace:orc,
greatrole:hum, lesserrace:elf etc.
Note, that only trophies that have been achieved are listed in the trophies
section.
This section simply includes the entirety of config.json file, so that templates can use configuration data when needed.