Queued match information, consisting of player IDs of players to compete
All competitors that are anonymous, local (no user), competitors and not registered in database. Used only when there is a DB
Registered competitors in this tournament
Last modification date of configs
Configuration synchronization interval. Periodically makes a request to the DB if there is one and syncs configs
A reference to the dimension this tournament was spawned from
This tournament's ID
Promise array of which all resolves once every player added through constructor is finished adding
Logger
A queue whose elements are each arrays of players that are to compete against each other
Mapping match ids to active ongoing matches
This Tournament's name
The ranksystem object being used to update, initialize, etc. ranks
tournament runner interval, periodically calls tourneyRunner to start up new matches
The current status of the tournament
Add or update a player to the tournament
If no existing ID is specified, this is treated as adding a completely new player.
If existing ID is specified and that ID exists already, this will update the file for that player instead and effectively update the player. First time a player is added, if there is existing stats in a DB they won't be reset. Subsequent adds will change the stats.
If the player is to exist beyond the tournament, an existingID must always be provided and generated somewhere else
Resolves with the new player or updated player
The file to the bot or an object with the file and a name for the player specified
The optional id of the player. Can also be provided in the first arg in a object
Whether or not the player was called from initialization. If true, player version does not increment
Checks whether match can still be run
If there are no stats, player was removed and match can't be run. If player is disabled, then it won't run
Destroy this tournament. Rejects if an error occured in trying to destroy it.
Disables the player with id playerID
the player's id to disable
Returns a new id for identifying a player in a tournament Only used when adding a plyaer to a tournament is done without specifying an id to use.
Retrieves the local configurations
Returns a key name to be used when storing a tournament by a combination of its name and id
Return an Array of Players corresponding to the player ids stored in queuedMatchInfo
Resolves with player stats if player with the id exists. Includes database user if db contains the player Fields are null if they don't exist. If playerStat field is null, then this player does not exist
id of player to get
Gets all rankings with the given offset from rank 1 and limit. Note this it's not recommended to use this function if there are many users. It is suggested to create your own (aggregation) query to get rankings directly from the DB.
Returns the name of the tournament but formatted (no spaces)
Handles the start and end of a match, and updates state accrding to match results and the given result handler
Initialize competition with given players, which can be local or stored in DB
Does not read in any DB players, only uses those that are given at construction of tourney
Removes player from tournament. Removes from state and stats from database
Post run function before generic destroy takes place
Print tournament status to display
Removes a match by id. Returns true if deleted, false if nothing was deleted
Resets rankings of all competitors loaded to initial scores
Resumes the tournament if it was stopped.
whether or not the instance calling stop was the first one, the "primary" instance
Begin the tournament. Resolves once the tournament is started
tournament configurations to use
whether or not the instance calling stop was the first one, the "master" instance
Schedules matches to play. By default uses Scheduler.RankRangeRandom
If a matchMake function is provided, that will be used instead of the default.
For users who want to host larger scale competitions with 1000+ competitors, its recommended to turn self match make off and setup a separate match scheduling server that tournament servers can pull queued matches from
Schedule a match using match info
Sets configs and updates DB / propagates the message to every other tournament instance
Set tournament status and updates DB / propagates the message to every other tournament instance
Stops the tournament if it was running.
whether or not the instance calling stop was the first one, the "primary" instance
Sync configs from DB
Updates database with new player stats
If failure occurs, we ignore it and just log it as we will likely in the future perform an update operation on the database again anyway
Update player stats for whoever stats owns this player stat. Determined by checking the player field of Ladder.PlayerStat
Generates a 6 character tournament ID identifying this tournament class instance. Not to be confused with {@link Tournament.ID} which is the ID for competitors in the tournament
Generated using TypeDoc
The Ladder Tournament class and namespace. The Ladder Tournament namespace