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:
gender
andalign
are starting gender and alignmentsstarttime
andendtime
are formatted to be human-readable
Following fields are added by the scoreboard during parsing:
src
is the short-name of the source serverclan_unique
indicates if the game is a unique ascension for player's clanachievements
is an array of player's achievements' short-namesdumplog
is a URL of the dumplogn
is the index (sometimes useful when passing ref to the game itself)scum
indicates 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:
name
is simply player's name (the same as the key value)games
is list of player's gamesascs
is list of player's ascensionsrank
is player's rank in the ordering of players inplayers
.ordered
maxlvl
is player's maximum experience level achievedscore
is player's summary scorescores
is player's scoring log (see below)achievements
is list of player's achievements (this key always exists, even if empty)maxcond
is player's maximum of conducts reached in single game (only exists for ascending players)minturns
is a turncount of player's fastest gametime ascensionminscore
is player's minimum score for a winning gamehighscore
is player's high score for a winning gamemaxstreaklen
is player's longest streak's lengthrealtime
is player's fastest realtime of a winning game, in human readable formatratio
is player's ascension ratio (only exists for ascending players)streaks
is list of player's streaks, streaks are in turn lists of streak games (only exists for players with streaks)clan
is a reference to clan definition (numerical index, only exists for players that are clan members)trophies
is list of scoring entries (the same as inscores
), but only with actual trophies)scum
is 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:
trophy
is 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-minturnswhen
is Unix epoch time of when the scoring entry was issuedwhen_fmt
is human-readable time of when the scoring entry was issued*points
number of points the entry is issued fordata
is 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:
name
is clan's namen
is clan's index valueplayers
is list of clan membersadmins
is list of clan members with admin privilegegames
is list of all clan's gamesascs
is list of clan's ascensionsratio
is clan's ascension ratiounique_ascs
is a list of ascensions that are unique for the clanachievements
is list of clan achievementsudeaths_rank
is clan's rank in the Unique Deaths competitionunique_deaths
is list of (death message, game) tuples; the game refers to the game that cause the new death reason to be logged for the clanscores
is clan's full scoring log (see above in players section)trophies
is clan's trophy log (see above in players section), it only lists real trophies, not things like single ascensions, individual streaks etc.rank
is clan's rank in clan competitionscore
is summary clan scoregames1000t
is count of clan's games over 1000 turnsunique_ascs
is 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.