a large portion of docs until now

This commit is contained in:
Luna 2025-12-15 07:07:12 +01:00
parent d9f77887f8
commit ae26e16444
252 changed files with 11038 additions and 78 deletions

130
generate_docs.py Normal file
View file

@ -0,0 +1,130 @@
#!/usr/bin/env python3
import re
import os
from pathlib import Path
from collections import defaultdict
# Read the index.d.ts file
with open('/Users/serverbp/Documents/Luna/Development/ShyyTAUI/node_modules/moons-ta-client/dist/index.d.ts', 'r') as f:
content = f.read()
# Define the output directory
output_dir = Path('/Users/serverbp/Documents/Luna/Development/ShyyTAUI/src/lib/taDocs')
# Extract all enum definitions
enum_pattern = r'declare enum (\w+) \{([^}]+)\}'
enum_matches = re.finditer(enum_pattern, content, re.DOTALL)
enums = {}
for match in enum_matches:
enum_name = match.group(1)
enum_body = match.group(2)
enums[enum_name] = enum_body.strip()
# Extract all interface definitions
interface_pattern = r'interface (\w+) \{([^}]*(?:\{[^}]*\}[^}]*)*)\}'
interface_matches = re.finditer(interface_pattern, content, re.DOTALL)
interfaces = {}
for match in interface_matches:
interface_name = match.group(1)
interface_body = match.group(2)
# Skip $Type classes
if interface_name.endswith('$Type'):
continue
interfaces[interface_name] = interface_body.strip()
# Extract all types referenced in interfaces
referenced_types = defaultdict(set)
def extract_types_from_interface(interface_name, body):
# Find all type references in format: type?: SomeType or type: SomeType or property: Type[] etc
# This regex captures type names (capitalized words, can have underscores)
type_pattern = r'(?::\s*|(?:Promise<))(\w+(?:_\w+)*)'
for match in re.finditer(type_pattern, body):
type_name = match.group(1)
# Skip built-in types
if type_name not in ['string', 'number', 'boolean', 'any', 'void', 'never', 'unknown', 'object', 'Promise', 'IBinaryReader', 'IBinaryWriter', 'BinaryReadOptions', 'BinaryWriteOptions', 'PartialMessage', 'MessageType', 'Extract', 'Record', 'K']:
referenced_types[interface_name].add(type_name)
for name, body in interfaces.items():
extract_types_from_interface(name, body)
# Function to extract the full definition from the file (with comments)
def get_full_definition(name, is_enum=False):
if is_enum:
pattern = f'((?://.*\n)*declare enum {re.escape(name)} \\{{.*?\\}})'
else:
pattern = f'((?://.*\n)*interface {re.escape(name)} \\{{(?:.*?)*?\\}})'
match = re.search(pattern, content, re.DOTALL)
if match:
return match.group(1).strip()
return None
# Create enum documentation files
for enum_name in sorted(enums.keys()):
full_def = get_full_definition(enum_name, is_enum=True)
if not full_def:
full_def = f"declare enum {enum_name} {{{enums[enum_name]}}}"
# Extract referenced types from enum
refs = []
for match in re.finditer(r'(\w+(?:_\w+)*)', full_def):
type_name = match.group(1)
if type_name in enums or type_name in interfaces:
refs.append(type_name)
refs = list(set(refs))
refs = [r for r in refs if r != enum_name]
refs.sort()
# Create markdown content
md_content = f"# {enum_name}\n\n```ts\n{full_def}\n```\n"
# Add references
if refs:
md_content += "\n## References\n"
for ref in refs:
if ref in enums:
md_content += f"- For `{ref}` please find documentation at [Enums -> {ref}](/documentation#Enums/5-{ref}).\n"
elif ref in interfaces:
md_content += f"- For `{ref}` please find documentation at [Models -> {ref}](/documentation#Models/4-{ref}).\n"
# Write file
file_path = output_dir / f"5-{enum_name}.md"
with open(file_path, 'w') as f:
f.write(md_content)
print(f"✓ Created {file_path.name}")
# Create interface documentation files
for interface_name in sorted(interfaces.keys()):
full_def = get_full_definition(interface_name, is_enum=False)
if not full_def:
full_def = f"interface {interface_name} {{{interfaces[interface_name]}}}"
# Create markdown content
md_content = f"# {interface_name}\n\n```ts\n{full_def}\n```\n"
# Add references
refs = list(referenced_types.get(interface_name, set()))
refs.sort()
if refs:
md_content += "\n## References\n"
for ref in refs:
if ref in enums:
md_content += f"- For `{ref}` please find documentation at [Enums -> {ref}](/documentation#Enums/5-{ref}).\n"
elif ref in interfaces:
md_content += f"- For `{ref}` please find documentation at [Models -> {ref}](/documentation#Models/4-{ref}).\n"
# Write file
file_path = output_dir / f"4-{interface_name}.md"
with open(file_path, 'w') as f:
f.write(md_content)
print(f"✓ Created {file_path.name}")
print(f"\nProcessed {len(enums)} enums and {len(interfaces)} interfaces")

View file

@ -2,6 +2,7 @@
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://unpkg.com/primeicons@7.0.0/primeicons.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

View file

@ -1,6 +1,6 @@
still left:
- all the base client methods,
- all the modals
- all the Models
- all the enums
- all the evnts(listeners)
- further docs on streamsync

View file

@ -34,7 +34,7 @@ interface Match {
}
```
For the definition of a Map please look at the [Modals -> Map page](/documentation#Modals/4-Map)
For the definition of a Map please look at the [Models -> Map page](/documentation#Models/4-Map)
A direct implementation:
```ts

View file

@ -34,4 +34,4 @@ interface Match {
}
```
For the definition of a Map please look at the [Modals -> Map page](/documentation#Modals/4-Map)
For the definition of a Map please look at the [Models -> Map page](/documentation#Models/4-Map)

View file

@ -57,7 +57,7 @@ interface QualifierEvent {
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Good to know:</strong> For the sake of simplification, the type of <code>infoChannel</code> has been substituted. Find the documentation on the original type <a href="/documentation#Modals/4-modals-Channel">here: Modals -> Channel</a>
<strong>Good to know:</strong> For the sake of simplification, the type of <code>infoChannel</code> has been substituted. Find the documentation on the original type <a href="/documentation#Models/4-Models-Channel">here: Models -> Channel</a>
</div>
</div>

View file

@ -42,11 +42,11 @@ interface Tournament {
}
```
- For the definition of a Tournament_TournamentSettings please look at the [Modals -> Tournament_TournamentSettings page](/documentation#Modals/4-Tournament_TournamentSettings)
- For the definition of a User please look at the [Modals -> User page](/documentation#Modals/4-User)
- For the definition of a Match please look at the [Modals -> Match page](/documentation#Modals/4-Match)
- For the definition of a QualifierEvent please look at the [Modals -> QualifierEvent page](/documentation#Modals/4-QualifierEvent)
- For the definition of a CoreServer please look at the [Modals -> CoreServer page](/documentation#Modals/4-CoreServer)
- For the definition of a Tournament_TournamentSettings please look at the [Models -> Tournament_TournamentSettings page](/documentation#Models/4-Tournament_TournamentSettings)
- For the definition of a User please look at the [Models -> User page](/documentation#Models/4-User)
- For the definition of a Match please look at the [Models -> Match page](/documentation#Models/4-Match)
- For the definition of a QualifierEvent please look at the [Models -> QualifierEvent page](/documentation#Models/4-QualifierEvent)
- For the definition of a CoreServer please look at the [Models -> CoreServer page](/documentation#Models/4-CoreServer)
A direct implementation:
```ts

View file

@ -41,11 +41,11 @@ interface Tournament {
}
```
- For the definition of a Tournament_TournamentSettings please look at the [Modals -> Tournament_TournamentSettings page](/documentation#Modals/4-Tournament_TournamentSettings)
- For the definition of a User please look at the [Modals -> User page](/documentation#Modals/4-User)
- For the definition of a Match please look at the [Modals -> Match page](/documentation#Modals/4-Match)
- For the definition of a QualifierEvent please look at the [Modals -> QualifierEvent page](/documentation#Modals/4-QualifierEvent)
- For the definition of a CoreServer please look at the [Modals -> CoreServer page](/documentation#Modals/4-CoreServer)
- For the definition of a Tournament_TournamentSettings please look at the [Models -> Tournament_TournamentSettings page](/documentation#Models/4-Tournament_TournamentSettings)
- For the definition of a User please look at the [Models -> User page](/documentation#Models/4-User)
- For the definition of a Match please look at the [Models -> Match page](/documentation#Models/4-Match)
- For the definition of a QualifierEvent please look at the [Models -> QualifierEvent page](/documentation#Models/4-QualifierEvent)
- For the definition of a CoreServer please look at the [Models -> CoreServer page](/documentation#Models/4-CoreServer)
A direct implementation:
```ts

View file

@ -77,8 +77,8 @@ interface User {
- For the definition of a User_ClientTypes please look at the [Enums -> User_ClientTypes page](/documentation#Enums/5-User_ClientTypes)
- For the definition of a User_PlayStates please look at the [Enums -> User_PlayStates page](/documentation#Enums/5-User_PlayStates)
- For the definition of a User_DownloadStates please look at the [Enums -> User_DownloadStates page](/documentation#Enums/5-User_DownloadStates)
- For the definition of a User_Point please look at the [Modals -> User_Point page](/documentation#Modals/4-User_Point)
- For the definition of a User_DiscordInfo please look at the [Modals -> User_DiscordInfo page](/documentation#Modals/4-User_DiscordInfo)
- For the definition of a User_Point please look at the [Models -> User_Point page](/documentation#Models/4-User_Point)
- For the definition of a User_DiscordInfo please look at the [Models -> User_DiscordInfo page](/documentation#Models/4-User_DiscordInfo)
- For the definition of a Permissions please look at the [Enums -> Permissions page](/documentation#Enums/5-Permissions)
A direct implementation:

View file

@ -77,8 +77,8 @@ interface User {
- For the definition of a User_ClientTypes please look at the [Enums -> User_ClientTypes page](/documentation#Enums/5-User_ClientTypes)
- For the definition of a User_PlayStates please look at the [Enums -> User_PlayStates page](/documentation#Enums/5-User_PlayStates)
- For the definition of a User_DownloadStates please look at the [Enums -> User_DownloadStates page](/documentation#Enums/5-User_DownloadStates)
- For the definition of a User_Point please look at the [Modals -> User_Point page](/documentation#Modals/4-User_Point)
- For the definition of a User_DiscordInfo please look at the [Modals -> User_DiscordInfo page](/documentation#Modals/4-User_DiscordInfo)
- For the definition of a User_Point please look at the [Models -> User_Point page](/documentation#Models/4-User_Point)
- For the definition of a User_DiscordInfo please look at the [Models -> User_DiscordInfo page](/documentation#Models/4-User_DiscordInfo)
- For the definition of a Permissions please look at the [Enums -> Permissions page](/documentation#Enums/5-Permissions)
<div class="info-box">

View file

@ -6,6 +6,6 @@ This method should NOT be used, as it is already handled, just exists.
await taClient.stateManager.handlePacket(packet: Packet);
```
For the definition of a `Packet` please refer to [Modals -> Packet](/documentation#Modals/Packet)
For the definition of a `Packet` please refer to [Models -> Packet](/documentation#Models/Packet)
I will not proide further documentation for this method, as it should NOT be used. Every way you could use it exists with another method.

View file

@ -21,6 +21,7 @@ const response: Response = taClient.addAuthorizedUser(tournamentGuid, userDiscor
The `response` variable from above will actually be a 'mashup' of two types. Firstly, the standard `Response` type. Secondly the `Response_AddAuthorizedUser`. Find the custom response object below.
## Standard Response:
```js
{
details: {
@ -31,8 +32,8 @@ The `response` variable from above will actually be a 'mashup' of two types. Fir
type: Response_ResponseType
}
```
- For `Response` please find documentation at [Modals -> Response](/documentation#Modals/4-Response)
- For `Response_AddAuthorizedUser` please find documentation at [Modals -> Response_AddAuthorizedUser](/documentation#Modals/4-Response_AddAuthorizedUser).
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
- For `Response_AddAuthorizedUser` please find documentation at [Models -> Response_AddAuthorizedUser](/documentation#Models/4-Response_AddAuthorizedUser).
<div class="info-box">
<span class="material-icons">info</span>

View file

@ -19,8 +19,8 @@ async function addQualifierMaps(tournamentId: string, qualifierId: string, maps:
```ts
const response: Response = taClient.addQualifierMaps(tournamentGuid, qualifierEventGuid, [map1, map2]);
```
- For the `Map` modal please find documentation at [Modals -> Response](/documentation#Modals/4-Map)
- For `Response` please find documentation at [Modals -> Response](/documentation#Modals/4-Response)
- For the `Map` modal please find documentation at [Models -> Map](/documentation#Models/4-Map)
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
<div class="info-box">
<span class="material-icons">info</span>
@ -31,11 +31,12 @@ const response: Response = taClient.addQualifierMaps(tournamentGuid, qualifierEv
A the following properties for the maps may be left empty or as a placeholder value:
- `map.guid`: may be left as `""`
- `map.gameplayParameters.playerSettings`: may be left as an empty [PlayerSpecificSettings](/documentation#Modals/4-PlayerSpecificSettings) object
- `map.gameplayParameters.playerSettings`: may be left as an empty [PlayerSpecificSettings](/documentation#Models/4-PlayerSpecificSettings) object
- for qualifier maps `map.disableCustomNotesOnStream` and `map.useSync` will not have any effect on gameplay, hence they can be left as a boolean value such as `false`
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
@ -46,7 +47,7 @@ If you have not yet, please read [Client -> Introduction to the Client](/documen
type: Response_ResponseType
}
```
- For `Request_AddQualifierMaps` please find documentation at [Modals -> Request_AddQualifierMaps](/documentation#Modals/4-Request_AddQualifierMaps).
- For `Request_AddQualifierMaps` please find documentation at [Models -> Request_AddQualifierMaps](/documentation#Models/4-Request_AddQualifierMaps).
```ts
// this method is called when the user submits the AddOrEditMapModal.svelte form
@ -55,7 +56,7 @@ async function handleMapAdded(event: CustomEvent) {
await client.addQualifierMaps(tournamentGuid, qualifierGuid, [event.detail.map]);
// a local method to just "refresh" the data on the page for reactivity
fetchQualifierData();
// a horrible example of how to use confirmations and modals
// a horrible example of how to use confirmations and Models
// show the popup for "Successfully added the map!"
modalMessage = `Successfully added the map!`;
modalIcon = 'check';

View file

@ -19,8 +19,8 @@ async function addTournamentPool(tournamentId: string, name: string, image: Uint
```ts
const response: Response = taClient.addTournamentPool(tournamentGuid, "Testing Map Pool", convertUrlToUnit8Array('https://png.com/pngPlaceholder'), maps: [map1, map2]);
```
- For the `Map` modal please find documentation at [Modals -> Response](/documentation#Modals/4-Map)
- For `Response` please find documentation at [Modals -> Response](/documentation#Modals/4-Response)
- For the `Map` modal please find documentation at [Models -> Map](/documentation#Models/4-Map)
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
<div class="info-box">
<span class="material-icons">info</span>
@ -31,42 +31,56 @@ const response: Response = taClient.addTournamentPool(tournamentGuid, "Testing M
A the following properties for the maps may be left empty or as a placeholder value. Do note that these are only from the `maps` array, since not all properties must be defined for the `maps`:
- `map.guid`: may be left as `""`
- `map.gameplayParameters.playerSettings`: may be left as an empty [PlayerSpecificSettings](/documentation#Modals/4-PlayerSpecificSettings) object
- `map.gameplayParameters.playerSettings`: may be left as an empty [PlayerSpecificSettings](/documentation#Models/4-PlayerSpecificSettings) object
- `map.attempts` and `map.showScoreboard` will not have any effect on gameplay, hence they can be left as a placeholder value such as `0` and `false`
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
addTournamentPool: Response_UpdateQualifierEvent,
oneofKind: 'addQualifierMaps'
updateTournament: Response_UpdateTournament,
oneofKind: 'updateTournament'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_UpdateQualifierEvent` please find documentation at [Modals -> Request_AddQualifierMaps](/documentation#Modals/4-Request_AddQualifierMaps).
- For `Response_UpdateTournament` please find documentation at [Models -> Response_UpdateTournament](/documentation#Models/4-Response_UpdateTournament).
```ts
// this method is called when the user submits the AddOrEditMapModal.svelte form
async function handleMapAdded(event: CustomEvent) {
// add the single map that the user configured. This includes all settings and data for the map.
await client.addQualifierMaps(tournamentGuid, qualifierGuid, [event.detail.map]);
// a local method to just "refresh" the data on the page for reactivity
fetchQualifierData();
// a horrible example of how to use confirmations and modals
// show the popup for "Successfully added the map!"
modalMessage = `Successfully added the map!`;
modalIcon = 'check';
modalButtons = [];
modalAutoClose = 1;
showGenericModal = true;
}
// Method called when we have set the image and name of th enew map pool in the popup.
async function handleMapPoolCreated(event: CustomEvent<TAMapPool>) {
const newMapPool = event.detail;
// Add the new map pool with no maps inside
let createMapPoolResponse = await client.addTournamentPool(tournamentGuid, newMapPool.name, newMapPool.image, []);
// Check if the request did not succeeded
if(createMapPoolResponse.type !== Response_ResponseType.Success) {
error = "Failed to create the new map pool! Please refresh this page!";
} else {
// Handle images for map pools
let mapPoolImage;
try {
mapPoolImage = bufferToImageUrl(newMapPool.image);
} catch (error) {
mapPoolImage = "/talogo.png"
}
// Add map pool to my own custom way of representing map pools
mapPools = [...mapPools, {
name: newMapPool.name,
image: mapPoolImage,
guid: newMapPool.guid,
color: generateRandomHexColor()
}];
showSuccessfullySaved = true;
}
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Example:</strong> This is a direct example from ShyyTAUI. It comes from the page where users edit qualifiers.
<strong>Example:</strong> This is a direct example from ShyyTAUI. It comes from the page where users edit map pools.
</div>
</div>

View file

@ -0,0 +1,73 @@
# The taClient.addTournamentPoolMaps() method
This documents the `taClient.addTournamentPoolMaps()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function addTournamentPoolMaps(tournamentId: string, poolId: string, maps: Map[]): Promise<Response> {
// backend logic
}
```
`tournamentId` refers to the guid of the tournament and poolId refers to the guid of the map pool.
## General usage:
```ts
const response: Response = taClient.addTournamentPoolMaps(tournamentGuid, poolGuid, [map1, map2]);
```
- For the `Map` modal please find documentation at [Models -> Map](/documentation#Models/4-Map)
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> Some parameters do not actually have to be provided, but for a complete object to exist you must give it some placeholder value.
</div>
</div>
A the following properties for the maps may be left empty or as a placeholder value. Do note that these are only from the `maps` array, since not all properties must be defined for the `maps`:
- `map.guid`: may be left as `""` (overwritten by backend)
- `map.gameplayParameters.playerSettings`: may be left as an empty [PlayerSpecificSettings](/documentation#Models/4-PlayerSpecificSettings) object
- `map.attempts` and `map.showScoreboard` will not have any effect on gameplay, hence they can be left as a placeholder value such as `0` and `false`. Please keep in mind that `map.attempts` only influences qualifiers. If you intend to load maps from a map pool for qualifiers this may be critical to define, however for the match room it has no effect.
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
updateTournament: Response_UpdateTournament,
oneofKind: 'updateTournament'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_UpdateTournament` please find documentation at [Models -> Response_UpdateTournament](/documentation#Models/4-Response_UpdateTournament).
An implmentation example:
```ts
// Method called when we click "+ Add Map" in the edit / add modal on the map pools page
async function handleMapAdded(event: CustomEvent) {
// Add the map passed on from the modal
await client.addTournamentPoolMaps(tournamentGuid, poolGuid, [event.detail.map]);
// Re-fetch the data from the state
fetchMapPoolData();
// Show success
showSuccessNotification = true;
setTimeout(() => {
showSuccessNotification = false;
}, 2500);
successMessage = "Map successfully added!";
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Example:</strong> This is a direct example from ShyyTAUI. It comes from the page where users edit map pools.
</div>
</div>

View file

@ -0,0 +1,93 @@
# The taClient.addTournamentRole() method
This documents the `taClient.addTournamentRole()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function addTournamentRole(tournamentId: string, role: Role): Promise<Response> {
// backend logic
}
```
`tournamentId` refers to the guid of the tournament.
## General usage:
```ts
const response: Response = taClient.addTournamentRole(tournamentGuid, {
guid: '',
name: '',
tounamentId: 'uuidv4',
roleId: '',
permissions: ['', '']
});
```
- For the `Role` modal please find documentation at [Models -> Role](/documentation#Models/4-Role)
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> Some parameters do not actually have to be provided, but for a complete object to exist you must give it some placeholder value.
</div>
</div>
A the following properties for the role may be left empty or as a placeholder value.
- `role.guid`: may be left as `""` (overwritten by backend)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
updateTournament: Response_UpdateTournament,
oneofKind: 'updateTournament'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_UpdateTournament` please find documentation at [Models -> Response_UpdateTournament](/documentation#Models/4-Response_UpdateTournament).
An implmentation example:
```ts
// Method called when we click "+ Add Role" in the edit / add modal on the settings page
async function handleAddRole(event: CustomEvent) {
// Get data from popup
const roleData = event.detail;
// Construct Role object
let role: Role = {
name: roleData.name,
roleId: roleData.roleId,
permissions: roleData.permissions,
tournamentId: tournamentGuid,
guid: ''
}
// Debug log to show what role we are adding
console.log('Adding role:', role);
try {
// Add the role
let addRoleResult = await client.addTournamentRole(tournamentGuid, role);
console.log("result", addRoleResult)
// If the request succeeds then add it to the roles locally
if (addRoleResult.type === Response_ResponseType.Success) {
tournamentRoles = [...tournamentRoles, role];
}
} catch (err) {
console.error('Error adding role:', err);
error = "Failed to add role, please view console, screenshot it and send it to serverbp or matrikmoon on Discord.";
}
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Example:</strong> This is a direct example from ShyyTAUI. It comes from the settings page of tournaments.
</div>
</div>

View file

@ -0,0 +1,82 @@
# The taClient.addTournamentTeam() method
This documents the `taClient.addTournamentTeam()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function addTournamentTeam(tournamentId: string, name: string, image: Unit8Array): Promise<Response> {
// backend logic
}
```
`tournamentId` refers to the guid of the tournament.
## General usage:
```ts
const response: Response = taClient.addTournamentTeam(tournamentGuid, "teamName", teamImageUnit8Array);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
updateTournament: Response_UpdateTournament,
oneofKind: 'updateTournament'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_UpdateTournament` please find documentation at [Models -> Response_UpdateTournament](/documentation#Models/4-Response_UpdateTournament).
An implmentation example:
```ts
// Method called when the "Add New Team" button is pressed
async function createTeam() {
// Construct new team object
const newTeam: TATeam = {
guid: uuidv4(),
name: newTeamName,
image: teamImageBuffer || new Uint8Array(1)
};
console.log(newTeam);
// Add the new team
let createTeamResponse = await client.addTournamentTeam(tournamentGuid, newTeam.name, newTeam.image);
// Handle error
if(createTeamResponse.type !== Response_ResponseType.Success) {
error = "Failed to create the new team! Please refresh this page!";
} else {
// Handle image
let teamImage;
try {
teamImage = bufferToImageUrl(teamImageBuffer || new Uint8Array(1));
} catch (error) {
teamImage = "/talogo.png"
}
// Add the team locally
teams = [...teams, {
name: newTeam.name,
image: teamImage,
guid: newTeam.guid,
color: generateRandomHexColor()
}];
}
// Close the popup
closeTeamPopup();
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Example:</strong> This is a direct example from ShyyTAUI. It comes from the teams page of tournaments.
</div>
</div>

View file

@ -0,0 +1,56 @@
# The taClient.addUserToMatch() method
This documents the `taClient.addUserToMatch()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function addUserToMatch(tournamentId: string, matchId: string, userId: string): Promise<Response> {
// backend logic
}
```
`tournamentId` refers to the guid of the tournament, matchId is the guid of the match, and userId is the guid of the user.
## General usage:
```ts
const response: Response = taClient.addUserToMatch(tournamentGuid, matchGuid, userGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
updateMatch: Response_UpdateMatch,
oneofKind: 'updateMatch'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_UpdateMatch` please find documentation at [Models -> Response_UpdateMatch](/documentation#Models/4-Response_UpdateMatch).
An implmentation example:
```ts
// This method is called when we want to add ourselves to a match in order ro receive live score updates etc.
async function addSelfToMatch() {
// If we are not in the match already
if(!match?.associatedUsers.includes(client.stateManager.getSelfGuid())) {
// Add ourselves to the match
const response = await client.addUserToMatch(tournamentGuid, matchGuid, client.stateManager.getSelfGuid());
console.log("Added Self to match!", response);
}
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Example:</strong> This is a direct example from ShyyTAUI. It comes from the matches page of tournaments.
</div>
</div>

View file

@ -21,6 +21,8 @@ The table below shows all of the functions of the taClient. From this point onwa
|deleteMatch()|Delete a match.|True|
|deleteQualifierEvent()|Delete a qualifier event.|True|
|deleteTournament()|Delete a tournament.|True|
|disableBlueNotes()|Toggle blue notes on/off for specified players. Warning: This toggles, not disables permanently.|False|
|disableRedNotes()|Toggle red notes on/off for specified players. Warning: This toggles, not disables permanently.|False|
|disconnect()|Disconnect from the Core Server.|True|
|emit()|Emit a custom packet. This is used for new feature testing and will not be discussed|True|
|flipColors()|Flip the colours of the players in the match. This was used in JJ25, and has just been left in.|True|
@ -46,6 +48,7 @@ The table below shows all of the functions of the taClient. From this point onwa
|removeTournamentRole()|Remove a role from a tournament.|True|
|removeTournamentTeam()|Remove a team from a tournament.|True|
|removeUserFromMatch()|Remove a user from a match.|True|
|refundAttempts()|Refund qualifier attempts for a specific map and platform.|True|
|returnToMenu()|Return the speciied players to the menu.|False|
|revokeBotToken()|Revoke a bot token. This will revoke the access of a bot token.|True|
|sendResponse()|Send a custom response to the TA Core Server. Do not use this unless you know exactly what you are doing.|True|
@ -63,13 +66,18 @@ The table below shows all of the functions of the taClient. From this point onwa
|setTournamentEnableTeams()|Set whether the teams feature is enabled.|True|
|setTournamentImage()|Set the image of the tournament.|True|
|setTournamentName()|Set the name of the tournament.|True|
|setTournamentPoolImage()|Set the image of an already existing map pool in a tournament.|True|
|setTournamentPoolName()|Set the name of an already existing map pool in a tournament.|True|
|setTournamentRoleName()|Set the name of a tournament role.|True|
|setTournamentRolePermissions()|Set the permissions for a tournament role.|True|
|setTournamentScoreUpdateFrequency()|Set the score update frequency for a tournament. This is usualy 30 frames.|True|
|setTournamentShowQualifierButton()|Set whether the qualifier button is shown in the tournament menu in game.|True|
|setTournamentShowTournamentButton()|Set whether the tournament button is shown in the tournament menu in game.|True|
|setTournamentTeamImage()|Set the image of an already existing team in a tournament.|True|
|setTournamentTeamName()|Set the name of an already existing team in a tournament.|True|
|showLoadedImage()|**STREAMSYNC MORE DOCS REQUIRED** Show the loaded image that is currently used for streamsync.|True|
|showColor()|Display a color on the game client for specified players. Used with StreamSync.|False|
|showLoadedImage()|Show or hide a previously loaded image for StreamSync.|False|
|showPrompt()|Show a custom prompt to the users.|True|
|showPrompt()|Show a custom prompt to the users.|True|
|stateManager|This is the state manager. Find further documentation, as it is a vital component.|False|
|updateQualifierMap()|Update the settings of an already existing qualifier map. |True|

View file

@ -0,0 +1,58 @@
# The taClient.conect() method
This documents the `taClient.conect()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function conect(serverAddress: string, port: string): Promise<Response> {
// backend logic
}
```
## General usage:
```ts
const response: Response = taClient.conect('server.tournamentassistant.net', '8676');
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
connect: Response_Connect,
oneofKind: 'connect'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_Connect` please find documentation at [Models -> Response_Connect](/documentation#Models/4-Response_Connect).
An implmentation example:
```ts
// Check for the client being already connected
if(!client.isConnected) {
// Connect to the TA server
const connectResult = await client.connect($TAServerUrl, $TAServerPort);
// Verify that the connection was successful
if (connectResult.details.oneofKind === "connect" && connectResult.type === Response_ResponseType.Fail) {
authError = connectResult.details.connect.message;
loading = false;
return;
}
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Example:</strong> This is a direct example from ShyyTAUI. It comes from the tournament list page.
</div>
</div>

View file

@ -0,0 +1,69 @@
# The taClient.createMatch() method
This documents the `taClient.createMatch()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function createMatch(tournamentId: string, match: Match): Promise<Response> {
// backend logic
}
```
- For `Match` please find documentation at [Models -> Match](/documentation#Models/4-Match)
## General usage:
```ts
const response: Response = taClient.createMatch(tournamentGuid {
guid: "sumyUUIDv4",
leader: 'myUUIDv4',
associatedUsers: ['string', 'array', 'of', 'player', 'guids']
});
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
createMatch: Response_CreateMatch,
oneofKind: 'createMatch'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_CreateMatch` please find documentation at [Models -> Response_CreateMatch](/documentation#Models/4-Response_CreateMatch).
An implmentation example:
```ts
// Method called when players are selected for mtch creation and the button is pressed
async function createMatch() {
// Send the request
const response = await client.createMatch(tournament!.guid, {
// dummy placeholder uuidv4
guid: '00000000-0000-4000-00000000',
// Set self as the leader. This is the user guid.
leader: client.stateManager.getSelfGuid(),
// An array of the user guids who you want to add. !!NOT PLATFORM ID-S. GUIDS.!!
associatedUsers: $selectedPlayerGuids
});
console.log("Match created! Response: ", response);
const newMatch = (response as any).details.createMatch.match;
goto(`/tournaments/${tournamentGuid}/matches/${newMatch.guid}`);
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Example:</strong> This is a direct example from ShyyTAUI. It comes from the tournament matches page.
</div>
</div>

View file

@ -0,0 +1,89 @@
# The taClient.createQualifierEvent() method
This documents the `taClient.createQualifierEvent()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function createQualifierEvent(tournamentId: string, name: string, infoChannelId: string, maps: Map[], flags: QualifierEvent_EventSettings, sort: QualifierEvent_LeaderboardSort, qualifierImage: Uint8Array): Promise<Response> {
// backend logic
}
```
- For `Map` please find documentation at [Models -> Map](/documentation#Models/4-Map)
- For `QualifierEvent_EventSettings` please find documentation at [Enums -> QualifierEvent_EventSettings](/documentation#Enums/5-QualifierEvent_EventSettings)
- For `QualifierEvent_LeaderboardSort` please find documentation at [Enums -> QualifierEvent_LeaderboardSort](/documentation#MEnums/5-QualifierEvent_LeaderboardSort)
## General usage:
```ts
const response: Response = taClient.createQualifierEvent(tournamentGuid, "New Qualifier name", 'discord snowflake or empty string', emptyMapsArray, flags, leaderboardSort, qualifierImageBuffer || new Uint8Array(1));
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
createQualifierEvent: Response_CreateQualifierEvent,
oneofKind: 'createQualifierEvent'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_CreateQualifierEvent` please find documentation at [Models -> Response_CreateQualifierEvent](/documentation#Models/4-Response_CreateQualifierEvent).
An implmentation example:
```ts
// Called when all the details for a new qualifier event have been provided
async function createQualifier() {
// Create a new local object for a qualifier event
const newQualifier: QualifierEvent = {
guid: uuidv4(),
name: newQualifierName,
// image: qualifierImageBuffer || new Uint8Array(1),
image: "",
qualifierMaps: [],
infoChannel: {
id: "",
name: ""
},
flags: 0,
sort: 0
};
// Create the event using the client
let createQualifierResponse = await client.createQualifierEvent(
tournamentGuid, // Tournament GUID
newQualifier.name, // Qualifier name
newQualifier.infoChannel!.id, // Discord Channel ID for live feeds
[], // Intial qualifier maps
0, // Flags (flags are really QualifierEvent_EventSettings, so 0 is None)
0, // Sort (0 is modifiedScore. FInd type QualifierEvent_LeaderboardSort for further details)
qualifierImageBuffer || new Uint8Array(1)
);
console.log("newQual", createQualifierResponse);
// Add the event to the other qualifier events
qualifiers = [
...qualifiers,
{
...(createQualifierResponse as any).details.createQualifierEvent.qualifier,
maps: []
}
];
closeQualifierPopup();
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Example:</strong> This is a direct example from ShyyTAUI. It comes from the tournament qualifiers page.
</div>
</div>

View file

@ -0,0 +1,152 @@
# The taClient.createTournament() method
This documents the `taClient.createTournament()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function createTournament(
serverAddress: string,
serverName: string,
serverPort: string,
serverWebsocketPort: string,
name: string,
tournamentImage?: Uint8Array,
enableTeams?: boolean,
enablePools?: boolean,
showTournamentButton?: boolean,
showQualifierButton?: boolean,
roles?: Role[],
teams?: Tournament_TournamentSettings_Team[],
scoreUpdateFrequency?: number,
bannedMods?: string[],
pools?: Tournament_TournamentSettings_Pool[],
allowUnauthorizedView?: boolean
): Promise<Response> {
// backend logic
}
```
## Parameters:
- **`serverAddress`** (string): The core server address/hostname
- **`serverName`** (string): The name of the core server
- **`serverPort`** (string): The core server port number
- **`serverWebsocketPort`** (string): The server WebSocket port number
- **`name`** (string): The name of the tournament
- **`tournamentImage`** (Uint8Array): The image for the tournament as a Uint8Array (binary data)
- **`enableTeams`** (boolean, optional): Whether to enable team functionality in this tournament
- **`enablePools`** (boolean, optional): Whether to enable pool functionality in this tournament
- **`showTournamentButton`** (boolean, optional): Whether to show the tournament button in the UI
- **`showQualifierButton`** (boolean, optional): Whether to show the qualifier button in the UI
- **`roles`** (Role[], optional): Array of roles to create for the tournament
- **`teams`** (Tournament_TournamentSettings_Team[], optional): Array of teams to create for the tournament
- **`scoreUpdateFrequency`** (number, optional): How frequently (in milliseconds) to update scores
- **`bannedMods`** (string[], optional): Array of mod IDs that are banned in this tournament
- **`pools`** (Tournament_TournamentSettings_Pool[], optional): Array of pools to create for the tournament
- **`allowUnauthorizedView`** (boolean, optional): Whether to allow unauthorized users to view the tournament
## General usage:
```ts
const response: Response = await taClient.createTournament(
'server.tournamentassistant.net',
'Main Server',
'8675',
'8676',
'New Tournament',
tournamentImageBuffer,
true, // enableTeams
true, // enablePools
true, // showTournamentButton
true, // showQualifierButton
[], // Leave default roles
[], // no teams
30, // scoreUpdateFrequency (every scoreUpdateFrequency frames, the players will send score data)
['IntroSkip', 'SongChartVisualizer'],
[], // Empty pools
false // Keep the tournament hidden
);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
createTournament: Response_CreateTournament,
oneofKind: 'createTournament'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_CreateTournament` please find documentation at [Models -> Response_CreateTournament](/documentation#Models/4-Response_CreateTournament).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The Uint8Array for the tournament image should be obtained from file input. If no image is provided, you can pass an empty Uint8Array or a default placeholder image.
</div>
</div>
An implmentation example:
```ts
// Create the tournament object
let tournament: Tournament = {
guid: uuidv4(),
users: [],
matches: [],
qualifiers: [],
settings: {
tournamentName: newTournamentName.trim(),
// tournamentImage: new Uint8Array([1]), // Default placeholder
tournamentImage: "",
enableTeams: false,
enablePools: false,
showTournamentButton: true,
showQualifierButton: true,
teams: [],
scoreUpdateFrequency: 30,
bannedMods: [],
pools: [],
allowUnauthorizedView: true,
roles: [],
myPermissions: []
},
server: {
name: `${$TAServerUrl}:${$TAServerPort}`,
address: $TAServerUrl,
port: $TAServerPlayerPort,
websocketPort: $TAServerPort
}
};
// Create the tournament
const response = await client.createTournament(
tournament.server!.address,
tournament.server!.name,
tournament.server!.port.toString(),
tournament.server!.websocketPort.toString(),
tournament.settings!.tournamentName,
await convertImageToUint8Array(newTournamentImage),
false,
false,
true,
true,
);
console.log("Tournament created:", response);
const responseTournament = (response.details as any).createTournament.tournament;
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Example:</strong> This is a direct example from ShyyTAUI. It comes from the tournaments page.
</div>
</div>

View file

@ -0,0 +1,37 @@
# The taClient.delayTestFinished() method
This documents the `taClient.delayTestFinished()` method.
<div class="warning-box">
<span class="material-icons">warning</span>
<div>
<strong>Streamsync:</strong> This method is used in streamsync. Since I am still discovering the best way to do streamsync I am not comfortable providing guidance on a "correct" appliance. Standard docs are provided below, but nothing extensive. This will be added later once streamsync is a thing in ShyyTAUI too.
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
function delayTestFinished(tournamentId: string, userIds: string[]): void {
// backend logic
}
```
## Parameters:
- **`tournamentId`** (string): The GUID of the tournament
- **`userIds`** (string[]): An array of user GUIDs who have completed their delay test
## General usage:
```ts
taClient.delayTestFinished(tournamentGuid, [userGuid1, userGuid2]);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns `void` - it does not return a response. It sends the signal directly to the specified users.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This is a synchronous method used to signal that specified players have completed a delay test and are ready to proceed with the tournament match.
</div>
</div>

View file

@ -0,0 +1,80 @@
# The taClient.deleteMatch() method
This documents the `taClient.deleteMatch()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function deleteMatch(tournamentId: string, matchId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **`tournamentId`** (string): The GUID of the tournament containing the match to delete
- **`matchId`** (string): The GUID of the match to delete
## General usage:
```ts
const response: Response = taClient.deleteMatch(tournamentGuid, matchGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
deleteMatch: Response_DeleteMatch,
oneofKind: 'deleteMatch'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_DeleteMatch` please find documentation at [Models -> Response_DeleteMatch](/documentation#Models/4-Response_DeleteMatch).
<div class="warning-box">
<span class="material-icons">warning</span>
<div>
<strong>Note:</strong> Deleting a match will not pull the players from from the map they are playing. Neither will removing them from the match. It also will not stop realtimeScores from being sent to clients that have already subscribed to it, however it will prevent new subscriptions from going through. A songFinished event also will not be triggered.
</div>
</div>
A direct implementation:
```ts
// In a method triggered when the "End Match" button is clicked
if(endMatch) {
if (isAnyPlayerPlaying) {
showExitMatchModal = true;
modalMessage = `Players are currently in-game. Exiting will close the match for all players. Continue?`;
modalIcon = 'warning';
modalButtons = [
{
text: `Close (NO)`,
type: 'primary',
action: () => showBackToMenuModal = false,
icon: 'close'
},
{
text: `Yes (YES)`,
type: 'secondary',
action: async() => await confirmExitMatch(),
icon: 'backspace'
}
];
} else {
// Remove outselves from the match
await removeSelfFromMatch();
// Delete the match
await client.deleteMatch(tournamentGuid, matchGuid);
// Navigate back to the page where people see the matches overview
goto(`/tournaments/${tournamentGuid}`);
}
}

View file

@ -0,0 +1,48 @@
# The taClient.deleteQualifierEvent() method
This documents the `taClient.deleteQualifierEvent()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function deleteQualifierEvent(tournamentId: string, qualifierId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **`tournamentId`** (string): The GUID of the tournament containing the qualifier event
- **`qualifierId`** (string): The GUID of the qualifier event to delete
## General usage:
```ts
const response: Response = taClient.deleteQualifierEvent(tournamentGuid, qualifierGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
deleteQualifierEvent: Response_DeleteQualifierEvent,
oneofKind: 'deleteQualifierEvent'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_DeleteQualifierEvent` please find documentation at [Models -> Response_DeleteQualifierEvent](/documentation#Models/4-Response_DeleteQualifierEvent).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> Deleting a qualifier event will permanently remove it from the tournament and all associated leaderboard data.
</div>
</div>

View file

@ -0,0 +1,47 @@
# The taClient.deleteTournament() method
This documents the `taClient.deleteTournament()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function deleteTournament(tournamentId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament to delete
## General usage:
```ts
const response: Response = taClient.deleteTournament(tournamentGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
deleteTournament: Response_DeleteTournament,
oneofKind: 'deleteTournament'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_DeleteTournament` please find documentation at [Models -> Response_DeleteTournament](/documentation#Models/4-Response_DeleteTournament).
<div class="warning-box">
<span class="material-icons">warning</span>
<div>
<strong>Warning:</strong> Deleting a tournament will permanently remove it and all associated data including matches, qualifier events, teams, and leaderboard data. This action cannot be undone.
</div>
</div>

View file

@ -0,0 +1,44 @@
# The taClient.disableBlueNotes() method
This documents the `taClient.disableBlueNotes()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Synchronous:</strong> This is a synchronous method that does not require await
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
function disableBlueNotes(tournamentId: string, userIds: string[]): void {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **userIds** (string[]): An array of user GUIDs for whom blue notes should be disabled
## General usage:
```ts
taClient.disableBlueNotes(tournamentGuid, [userGuid1, userGuid2]);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns `void` - it does not return a response. It sends the disable command directly to the specified users.
<div class="warning-box">
<span class="material-icons">warning</span>
<div>
<strong>Warning:</strong> This method TOGGLES blue notes rather than disabling them. Calling this method once will disable blue notes, but calling it again will re-enable them. It does not permanently disable blue notes - it switches the state each time it's called.
</div>
</div>
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This is a synchronous method that toggles blue notes in the game client for specified players. This can be used for accessibility or gameplay modification purposes.
</div>
</div>

View file

@ -0,0 +1,44 @@
# The taClient.disableRedNotes() method
This documents the `taClient.disableRedNotes()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Synchronous:</strong> This is a synchronous method that does not require await
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
function disableRedNotes(tournamentId: string, userIds: string[]): void {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **userIds** (string[]): An array of user GUIDs for whom red notes should be disabled
## General usage:
```ts
taClient.disableRedNotes(tournamentGuid, [userGuid1, userGuid2]);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns `void` - it does not return a response. It sends the disable command directly to the specified users.
<div class="warning-box">
<span class="material-icons">warning</span>
<div>
<strong>Warning:</strong> This method TOGGLES red notes rather than disabling them. Calling this method once will disable red notes, but calling it again will re-enable them. It does not permanently disable red notes - it switches the state each time it's called.
</div>
</div>
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This is a synchronous method that toggles red notes in the game client for specified players. This can be used for accessibility or gameplay modification purposes.
</div>
</div>

View file

@ -0,0 +1,44 @@
# The taClient.disconnect() method
This documents the `taClient.disconnect()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function disconnect(): Promise<Response> {
// backend logic
}
```
## General usage:
```ts
const response: Response = taClient.disconnect();
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
disconnect: Response_Disconnect,
oneofKind: 'disconnect'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_Disconnect` please find documentation at [Models -> Response_Disconnect](/documentation#Models/4-Response_Disconnect).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Best Practice:</strong> Always call disconnect() when your application is shutting down or when the user logs out. This ensures that all event listeners are properly cleaned up and the connection is gracefully terminated.
</div>
</div>

View file

@ -0,0 +1,37 @@
# The taClient.flipColors() method
This documents the `taClient.flipColors()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Synchronous:</strong> This is a synchronous method that does not require await
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
function flipColors(tournamentId: string, userIds: string[]): void {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **userIds** (string[]): An array of user GUIDs whose colors should be flipped
## General usage:
```ts
taClient.flipColors(tournamentGuid, [userGuid1, userGuid2]);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns `void` - it does not return a response. It sends the flip command directly to the specified users.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This is a synchronous method that flips the color assignment of players in a tournament. It was utilized during the JJ25 tournament and remains available for legacy compatibility.
</div>
</div>

View file

@ -0,0 +1,37 @@
# The taClient.flipHands() method
This documents the `taClient.flipHands()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Synchronous:</strong> This is a synchronous method that does not require await
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
function flipHands(tournamentId: string, userIds: string[]): void {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **userIds** (string[]): An array of user GUIDs whose hand orientation should be flipped
## General usage:
```ts
taClient.flipHands(tournamentGuid, [userGuid1, userGuid2]);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns `void` - it does not return a response. It sends the flip command directly to the specified users.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This is a synchronous method that toggles the hand orientation (left-handed/right-handed mode) for specified players. This is useful for accommodating players who need to switch their preferred hand orientation during a tournament.
</div>
</div>

View file

@ -0,0 +1,47 @@
# The taClient.generateBotToken() method
This documents the `taClient.generateBotToken()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function generateBotToken(userId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **userId** (string): The GUID of the user for which to generate a bot token
## General usage:
```ts
const response: Response = taClient.generateBotToken(userGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
generateBotToken: Response_GenerateBotToken,
oneofKind: 'generateBotToken'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_GenerateBotToken` please find documentation at [Models -> Response_GenerateBotToken](/documentation#Models/4-Response_GenerateBotToken).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Use Case:</strong> Bot tokens are often used for creating overlays, stream integrations, or automated tools that need to authenticate as a specific user without requiring interactive login. The generated JWT can be used to authenticate API requests on behalf of that user.
</div>
</div>

View file

@ -0,0 +1,47 @@
# The taClient.getAuthorizedUsers() method
This documents the `taClient.getAuthorizedUsers()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function getAuthorizedUsers(tournamentId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament for which to retrieve authorized users
## General usage:
```ts
const response: Response = taClient.getAuthorizedUsers(tournamentGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
getAuthorizedUsers: Response_GetAuthorizedUsers,
oneofKind: 'getAuthorizedUsers'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_GetAuthorizedUsers` please find documentation at [Models -> Response_GetAuthorizedUsers](/documentation#Models/4-Response_GetAuthorizedUsers).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method returns a list of users who have been authorized to access the tournament with various role permissions (admin, viewer, etc.).
</div>
</div>

View file

@ -0,0 +1,47 @@
# The taClient.getBotTokensForUser() method
This documents the `taClient.getBotTokensForUser()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function getBotTokensForUser(userId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **userId** (string): The GUID of the user whose bot tokens should be retrieved
## General usage:
```ts
const response: Response = taClient.getBotTokensForUser(userGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
getBotTokensForUser: Response_GetBotTokensForUser,
oneofKind: 'getBotTokensForUser'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_GetBotTokensForUser` please find documentation at [Models -> Response_GetBotTokensForUser](/documentation#Models/4-Response_GetBotTokensForUser).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method retrieves the bot token metadata for a user but does not return the JWT itself. To view the actual JWT, you would need to use the response from `generateBotToken()`.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.getDiscordInfo() method
This documents the `taClient.getDiscordInfo()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function getDiscordInfo(tournamentId: string, discordId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **discordId** (string): The Discord ID of the user whose Discord information should be retrieved
## General usage:
```ts
const response: Response = await taClient.getDiscordInfo(tournamentGuid, '1234567890');
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
getDiscordInfo: Response_GetDiscordInfo,
oneofKind: 'getDiscordInfo'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_GetDiscordInfo` please find documentation at [Models -> Response_GetDiscordInfo](/documentation#Models/4-Response_GetDiscordInfo).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method retrieves Discord-related information for a user, such as their Discord ID, username, and other linked Discord account details.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.getLeaderboard() method
This documents the `taClient.getLeaderboard()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function getLeaderboard(qualifierId: string, mapId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **qualifierId** (string): The GUID of the qualifier event
- **mapId** (string): The GUID of the map within the qualifier for which to retrieve the leaderboard
## General usage:
```ts
const response: Response = taClient.getLeaderboard(qualifierGuid, mapGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
getLeaderboard: Response_GetLeaderboard,
oneofKind: 'getLeaderboard'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_GetLeaderboard` please find documentation at [Models -> Response_GetLeaderboard](/documentation#Models/4-Response_GetLeaderboard).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method retrieves the complete leaderboard for a specific map within a qualifier event, including all player scores sorted according to the leaderboard sort settings.
</div>
</div>

View file

@ -15,7 +15,7 @@ There are a couple of important notes for client responses. Since most client re
type: Response_ResponseType
}
```
For the definition of the `Response_ResponseType` look at the [Modals -> Response_ResponseType](/documentation#Modals/4-Response_ResponseType).
For the definition of the `Response_ResponseType` look at the [Enums -> Response_ResponseType](/documentation#Enums/5-Response_ResponseType).
Generally for responses `details.packetType` will contain the actual data of the response. In order to retreive data from the response in TypeScript, we have to use the `as any` syntax.
```ts

View file

@ -0,0 +1,46 @@
# The taClient.isConnected() method
This documents the `taClient.isConnected()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Synchronous:</strong> This is a synchronous method that does not require await
</div>
</div>
This method has no input parameters. The function could easily be defined as:
```ts
function isConnected(): boolean {
// backend logic
}
```
## General usage:
```ts
const isConnected: boolean = taClient.isConnected();
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns a boolean value:
- **true**: The client is currently connected to a TA Core Server
- **false**: The client is not currently connected to a TA Core Server
## Example usage:
```ts
// Check if the client is connected before performing operations
if (taClient.isConnected()) {
// Perform operations that require a connection
const response = await taClient.createMatch(tournamentGuid, matchData);
} else {
console.log("Not connected to the TA server");
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Best Practice:</strong> Always check if the client is connected before attempting to perform operations that require a server connection.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.isConnecting() method
This documents the `taClient.isConnecting()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Synchronous:</strong> This is a synchronous method that does not require await
</div>
</div>
This method has no input parameters. The function could easily be defined as:
```ts
function isConnecting(): boolean {
// backend logic
}
```
## General usage:
```ts
const isConnecting: boolean = taClient.isConnecting();
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns a boolean value:
- **true**: The client is currently in the process of connecting to a TA Core Server
- **false**: The client is not currently attempting to connect
## Example usage:
```ts
// Show a loading indicator while the client is attempting to connect
if (taClient.isConnecting()) {
// Display connection in progress message or spinner
console.log("Attempting to connect to the TA server...");
} else if (taClient.isConnected()) {
console.log("Successfully connected");
} else {
console.log("Not connected and not attempting to connect");
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method is useful for displaying connection status in UI elements such as spinners or status indicators.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.joinTournament() method
This documents the `taClient.joinTournament()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function joinTournament(tournamentId: string, userId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament to join
- **userId** (string): The GUID of the user who is joining the tournament
## General usage:
```ts
const response: Response = taClient.joinTournament(tournamentGuid, userGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
joinTournament: Response_JoinTournament,
oneofKind: 'joinTournament'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_JoinTournament` please find documentation at [Models -> Response_JoinTournament](/documentation#Models/4-Response_JoinTournament).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method allows a user to officially join a tournament. Once joined, the user becomes a participant and their participation is recorded on the server.
</div>
</div>

View file

@ -0,0 +1,51 @@
# The taClient.loadImage() method
This documents the `taClient.loadImage()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function loadImage(tournamentId: string, bitmap: Uint8Array, userIds: string[]): Promise<ResponseFromUser[]> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **bitmap** (Uint8Array): The image data as a Uint8Array (binary bitmap data)
- **userIds** (string[]): An array of user GUIDs for whom the image should be loaded
## General usage:
```ts
const responses: ResponseFromUser[] = await taClient.loadImage(tournamentGuid, imageBuffer, [userGuid1, userGuid2]);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
The method returns an array of `ResponseFromUser` objects, each containing:
```js
{
userId: 'user-guid-1',
response: {
details: {
loadImage: Response_LoadImage,
oneofKind: 'loadImage'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method is used in conjunction with StreamSync and related overlay systems to load custom images for display. After loading the image, you can call `showLoadedImage()` to display it.
</div>
</div>

View file

@ -0,0 +1,49 @@
# The taClient.loadSong() method
This documents the `taClient.loadSong()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function loadSong(tournamentId: string, levelId: string, userIds: string[], timeout?: number): Promise<ResponseFromUser[]> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **levelId** (string): The level ID/hash of the song to load
- **userIds** (string[]): An array of user GUIDs for whom the song should be loaded
- **timeout** (number, optional): The timeout in milliseconds for loading the song
## General usage:
```ts
const responses: ResponseFromUser[] = await taClient.loadSong(tournamentGuid, 'levelHash123', [userGuid1, userGuid2], 5000);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
The method returns an array of `ResponseFromUser` objects, each containing:
```js
{
userId: 'user-guid-1',
response: {
type: Response_ResponseType,
respondingToPacketId: 'packet-guid-uuidv4',
details: { ... }
}
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method prepares a song for the specified players in a tournament. The method returns a response from each user indicating whether the song was successfully loaded on their client.
</div>
</div>

View file

@ -0,0 +1,66 @@
# The taClient.on() method
This documents the `taClient.on()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function on(eventName: string, callback: (data: any) => void): Promise<void> {
// backend logic
}
```
## Parameters:
- **eventName** (string): The name of the event to listen for (e.g., 'realtimeScore', 'songFinished')
- **callback** (function): A callback function that will be invoked whenever the event is triggered. The callback receives the event data as a parameter.
## General usage:
```ts
taClient.on('realtimeScore', (scoreData) => {
console.log('Score update:', scoreData);
});
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Common Events:
- **realtimeScore**: Fired when a player's score is updated in real-time during a match
- **songFinished**: Fired when a player finishes playing a song
- **matchCreated**: Fired when a new match is created
- **matchDeleted**: Fired when a match is deleted
- And many others - refer to the Events documentation for a complete list
## Example usage:
```ts
// Listen for real-time score updates
taClient.on('realtimeScore', (scoreData) => {
console.log('Player score updated:', scoreData);
// Update your UI with the new score
});
// Listen for song completion
taClient.on('songFinished', (finishData) => {
console.log('Song finished:', finishData);
// Perform actions when a song finishes
});
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> Event listeners remain active until explicitly removed with `removeListener()`. This is the standard way to subscribe to real-time events that are not stored in the state manager.
</div>
</div>
## Important:
```ts
// When your component or application is destroyed,
// remember to remove the listener to prevent memory leaks
taClient.removeListener('realtimeScore', callbackFunction);
```
- For more information on removing listeners, see [Client -> removeListener](/documentation#Client/3-client-removeListener)

View file

@ -0,0 +1,68 @@
# The taClient.once() method
This documents the `taClient.once()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function once(eventName: string, callback: (data: any) => void): Promise<void> {
// backend logic
}
```
## Parameters:
- **eventName** (string): The name of the event to listen for
- **callback** (function): A callback function that will be invoked exactly once when the event is triggered. The callback receives the event data as a parameter.
## General usage:
```ts
taClient.once('matchCreated', (matchData) => {
console.log('Match was created:', matchData);
});
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Key Differences from on():
- **on()**: Listener persists and fires every time the event occurs
- **once()**: Listener automatically removes itself after the first occurrence
## Example usage:
```ts
// Listen for a match creation event - will only fire once
taClient.once('matchCreated', (matchData) => {
console.log('New match created:', matchData);
// This callback will only run one time
});
// Alternatively, wait for a specific tournament update
taClient.once('tournamentUpdated', (tournamentData) => {
console.log('Tournament was updated:', tournamentData);
});
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Use Case:</strong> Use `once()` when you want to respond to a specific one-time event without having to manually manage listener cleanup.
</div>
</div>
## Comparison:
```ts
// Using on() - fires multiple times
taClient.on('realtimeScore', (data) => {
updateUI(data);
});
// Using once() - fires only the first time
taClient.once('matchStarted', (data) => {
console.log('Match started for the first time');
// This runs only once
});
```

View file

@ -0,0 +1,56 @@
# The taClient.playSong() method
This documents the `taClient.playSong()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Synchronous:</strong> This is a synchronous method that does not require await
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
function playSong(tournamentId: string, gameplayParameters: GameplayParameters, userIds: string[]): void {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **gameplayParameters** (GameplayParameters): An object containing gameplay settings including the beatmap information, modifiers, and difficulty settings
- **userIds** (string[]): An array of user GUIDs for whom the song should be played
## General usage:
```ts
const gameplayParams: GameplayParameters = {
levelId: 'levelHash123',
difficulty: 'Expert',
modifiers: ['HD', 'FL'] // optional modifiers
};
taClient.playSong(tournamentGuid, gameplayParams, [userGuid1, userGuid2]);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns `void` - it does not return a response object. It sends the play command directly to the specified users.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This is a synchronous method that sends the signal to play a song to the specified players in a tournament. You must have previously loaded the song using `loadSong()` before calling this method.
</div>
</div>
## Typical workflow:
```ts
// 1. Load the song for specific players
const responses = await taClient.loadSong(tournamentGuid, 'levelHash123', [userGuid1, userGuid2]);
// 2. Once loaded, play the song for those players (synchronous - no await needed)
const gameplayParams: GameplayParameters = {
levelId: 'levelHash123',
difficulty: 'Expert'
};
taClient.playSong(tournamentGuid, gameplayParams, [userGuid1, userGuid2]);
```

View file

@ -0,0 +1,59 @@
# The taClient.refundAttempts() method
This documents the `taClient.refundAttempts()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function refundAttempts(tournamentId: string, qualifierId: string, mapId: string, platformId: string, count: number): Promise<ResponseFromUser[]> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **qualifierId** (string): The GUID of the qualifier event
- **mapId** (string): The GUID of the map for which attempts should be refunded
- **platformId** (string): The platform ID (typically the user or platform identifier)
- **count** (number): The number of attempts to refund
## General usage:
```ts
const responses: ResponseFromUser[] = await taClient.refundAttempts(
tournamentGuid,
qualifierGuid,
mapGuid,
platformId,
3 // Refund 3 attempts
);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
The method returns an array of `ResponseFromUser` objects, each containing:
```js
{
userId: 'user-guid-1',
response: {
details: {
refundAttempts: Response_RefundAttempts,
oneofKind: 'refundAttempts'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method refunds attempts for a specific map in a qualifier event. This is useful for correcting mistakes or providing second chances to players who experienced technical issues.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.removeAuthorizedUser() method
This documents the `taClient.removeAuthorizedUser()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function removeAuthorizedUser(tournamentId: string, discordId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **discordId** (string): The Discord ID of the user to remove from authorized users
## General usage:
```ts
const response: Response = taClient.removeAuthorizedUser(tournamentGuid, userDiscordId);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
removeAuthorizedUser: Response_RemoveAuthorizedUser,
oneofKind: 'removeAuthorizedUser'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_RemoveAuthorizedUser` please find documentation at [Models -> Response_RemoveAuthorizedUser](/documentation#Models/4-Response_RemoveAuthorizedUser).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method revokes all permissions for a user on a tournament, effectively removing them from the authorized users list.
</div>
</div>

View file

@ -0,0 +1,89 @@
# The taClient.removeListener() method
This documents the `taClient.removeListener()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function removeListener(eventName: string, callback: (data: any) => void): Promise<void> {
// backend logic
}
```
## Parameters:
- **eventName** (string): The name of the event to stop listening for
- **callback** (function): The exact callback function that was previously registered with `on()` or `once()`
## General usage:
```ts
const handleScoreUpdate = (scoreData) => {
console.log('Score updated:', scoreData);
};
// Add listener
taClient.on('realtimeScore', handleScoreUpdate);
// ... later, remove the listener
taClient.removeListener('realtimeScore', handleScoreUpdate);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Important Note:
The callback function passed to `removeListener()` must be the **exact same function reference** that was passed to `on()` or `once()`. This is why it's important to store your callback functions in variables rather than using inline arrow functions.
## Example - Correct Usage:
```ts
// Store the callback in a variable
const handleRealtimeScore = (scoreData) => {
console.log('Score update:', scoreData);
};
// onMount
taClient.on('realtimeScore', handleRealtimeScore);
// When cleaning up (e.g., on component destroy)
taClient.removeListener('realtimeScore', handleRealtimeScore);
```
## Example - Incorrect Usage:
```ts
// DON'T do this - the callback won't be removed!
taClient.on('realtimeScore', (scoreData) => {
console.log('Score update:', scoreData);
});
// This won't work because it's a different function reference
taClient.removeListener('realtimeScore', (scoreData) => {
console.log('Score update:', scoreData);
});
```
<div class="warning-box">
<span class="material-icons">warning</span>
<div>
<strong>Best Practice:</strong> Always remove listeners when your component is destroyed or when you no longer need them. Failing to do so can cause memory leaks, especially in single-page applications.
</div>
</div>
## Typical Svelte onDestroy pattern:
```ts
import { onDestroy } from 'svelte';
const handleScoreUpdate = (scoreData) => {
// Handle the update
};
onMount(() => {
taClient.on('realtimeScore', handleScoreUpdate);
});
onDestroy(() => {
taClient.removeListener('realtimeScore', handleScoreUpdate);
});
```

View file

@ -0,0 +1,48 @@
# The taClient.removeQualifierMap() method
This documents the `taClient.removeQualifierMap()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function removeQualifierMap(qualifierId: string, mapId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **qualifierId** (string): The GUID of the qualifier event
- **mapId** (string): The GUID of the map to remove from the qualifier
## General usage:
```ts
const response: Response = taClient.removeQualifierMap(qualifierGuid, mapGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
removeQualifierMap: Response_RemoveQualifierMap,
oneofKind: 'removeQualifierMap'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_RemoveQualifierMap` please find documentation at [Models -> Response_RemoveQualifierMap](/documentation#Models/4-Response_RemoveQualifierMap).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method removes a specific map from a qualifier event. The leaderboard and scores for this map will be retained but the map will no longer be part of the qualifier.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.removeTournamentPool() method
This documents the `taClient.removeTournamentPool()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function removeTournamentPool(tournamentId: string, poolId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **poolId** (string): The GUID of the map pool to remove
## General usage:
```ts
const response: Response = taClient.removeTournamentPool(tournamentGuid, poolGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
removeTournamentPool: Response_RemoveTournamentPool,
oneofKind: 'removeTournamentPool'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_RemoveTournamentPool` please find documentation at [Models -> Response_RemoveTournamentPool](/documentation#Models/4-Response_RemoveTournamentPool).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> Removing a map pool will delete the pool and all its associated maps from the tournament.
</div>
</div>

View file

@ -0,0 +1,49 @@
# The taClient.removeTournamentPoolMap() method
This documents the `taClient.removeTournamentPoolMap()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function removeTournamentPoolMap(tournamentId: string, poolId: string, mapId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **poolId** (string): The GUID of the map pool
- **mapId** (string): The GUID of the map to remove from the pool
## General usage:
```ts
const response: Response = taClient.removeTournamentPoolMap(tournamentGuid, poolGuid, mapGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
removeTournamentPoolMap: Response_RemoveTournamentPoolMap,
oneofKind: 'removeTournamentPoolMap'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_RemoveTournamentPoolMap` please find documentation at [Models -> Response_RemoveTournamentPoolMap](/documentation#Models/4-Response_RemoveTournamentPoolMap).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method removes a specific map from an existing map pool. The pool itself remains intact.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.removeTournamentRole() method
This documents the `taClient.removeTournamentRole()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function removeTournamentRole(tournamentId: string, roleId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **roleId** (string): The ID of the role to remove
## General usage:
```ts
const response: Response = taClient.removeTournamentRole(tournamentGuid, roleId);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
removeTournamentRole: Response_RemoveTournamentRole,
oneofKind: 'removeTournamentRole'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_RemoveTournamentRole` please find documentation at [Models -> Response_RemoveTournamentRole](/documentation#Models/4-Response_RemoveTournamentRole).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> Removing a tournament role will delete the role definition from the tournament. Any users assigned to this role will have their role assignment removed.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.removeTournamentTeam() method
This documents the `taClient.removeTournamentTeam()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function removeTournamentTeam(tournamentId: string, teamId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **teamId** (string): The GUID of the team to remove
## General usage:
```ts
const response: Response = taClient.removeTournamentTeam(tournamentGuid, teamGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
removeTournamentTeam: Response_RemoveTournamentTeam,
oneofKind: 'removeTournamentTeam'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_RemoveTournamentTeam` please find documentation at [Models -> Response_RemoveTournamentTeam](/documentation#Models/4-Response_RemoveTournamentTeam).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> Removing a tournament team will delete the team from the tournament. Any players assigned to this team will have their team assignment removed.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.removeUserFromMatch() method
This documents the `taClient.removeUserFromMatch()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function removeUserFromMatch(matchId: string, userId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **matchId** (string): The GUID of the match
- **userId** (string): The GUID of the user to remove from the match
## General usage:
```ts
const response: Response = taClient.removeUserFromMatch(matchGuid, userGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
removeUserFromMatch: Response_RemoveUserFromMatch,
oneofKind: 'removeUserFromMatch'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_RemoveUserFromMatch` please find documentation at [Models -> Response_RemoveUserFromMatch](/documentation#Models/4-Response_RemoveUserFromMatch).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method removes a user from a match. If the user is the match leader and there are other players, the leader role may be transferred to another player.
</div>
</div>

View file

@ -0,0 +1,46 @@
# The taClient.returnToMenu() method
This documents the `taClient.returnToMenu()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Synchronous:</strong> This is a synchronous method that does not require await
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
function returnToMenu(...userIds: string[]): void {
// backend logic
}
```
## Parameters:
- **userIds** (string[]): Variable arguments containing the GUIDs of users who should return to the menu
## General usage:
```ts
taClient.returnToMenu(userGuid1, userGuid2, userGuid3);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns `void` and does not return a response.
## Example usage:
```ts
// Send all players back to the main menu
const playerGuids = ['guid1', 'guid2', 'guid3'];
taClient.returnToMenu(...playerGuids);
// Or send a single player back
taClient.returnToMenu(userGuid);
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method immediately sends the specified players back to the menu in the game client, interrupting any ongoing gameplay.
</div>
</div>

View file

@ -0,0 +1,47 @@
# The taClient.revokeBotToken() method
This documents the `taClient.revokeBotToken()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function revokeBotToken(tokenId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tokenId** (string): The ID of the bot token to revoke
## General usage:
```ts
const response: Response = taClient.revokeBotToken(tokenId);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
revokeBotToken: Response_RevokeBotToken,
oneofKind: 'revokeBotToken'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_RevokeBotToken` please find documentation at [Models -> Response_RevokeBotToken](/documentation#Models/4-Response_RevokeBotToken).
<div class="warning-box">
<span class="material-icons">warning</span>
<div>
<strong>Warning:</strong> Revoking a bot token will immediately invalidate it. Any integrations or tools using this token will cease to function until a new token is generated.
</div>
</div>

View file

@ -0,0 +1,41 @@
# The taClient.sendResponse() method
This documents the `taClient.sendResponse()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function sendResponse(response: Response): Promise<void> {
// backend logic
}
```
## Parameters:
- **response** (Response): A Response object to send to the TA Core Server
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
## General usage:
```ts
await taClient.sendResponse(customResponseObject);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
<div class="warning-box">
<span class="material-icons">warning</span>
<div>
<strong>Warning:</strong> Do not use this method unless you know exactly what you are doing. This method is intended for advanced use cases and new feature testing only. Sending malformed or incorrect responses can disrupt tournament operations.
</div>
</div>
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Advanced:</strong> This method is used for custom packet handling and should only be used by developers who understand the Tournament Assistant protocol.
</div>
</div>

View file

@ -0,0 +1,47 @@
# The taClient.setAuthToken() method
This documents the `taClient.setAuthToken()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setAuthToken(token: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **token** (string): The authentication JWT token to set for the client
## General usage:
```ts
const response: Response = taClient.setAuthToken(jwtToken);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setAuthToken: Response_SetAuthToken,
oneofKind: 'setAuthToken'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetAuthToken` please find documentation at [Models -> Response_SetAuthToken](/documentation#Models/4-Response_SetAuthToken).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The authentication token is typically obtained through Discord OAuth authentication. It is required for most operations on the server.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setMatchLeader() method
This documents the `taClient.setMatchLeader()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setMatchLeader(matchId: string, userId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **matchId** (string): The GUID of the match
- **userId** (string): The GUID of the user who should become the new match leader
## General usage:
```ts
const response: Response = taClient.setMatchLeader(matchGuid, userGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setMatchLeader: Response_SetMatchLeader,
oneofKind: 'setMatchLeader'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetMatchLeader` please find documentation at [Models -> Response_SetMatchLeader](/documentation#Models/4-Response_SetMatchLeader).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The match leader is typically the coordinator who manages the match. Only a user who is already part of the match can be set as the leader.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setMatchMap() method
This documents the `taClient.setMatchMap()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setMatchMap(matchId: string, mapId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **matchId** (string): The GUID of the match
- **mapId** (string): The GUID of the map (song) to set for the match
## General usage:
```ts
const response: Response = taClient.setMatchMap(matchGuid, mapGuid);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setMatchMap: Response_SetMatchMap,
oneofKind: 'setMatchMap'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetMatchMap` please find documentation at [Models -> Response_SetMatchMap](/documentation#Models/4-Response_SetMatchMap).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> Setting the match map will load the map for all players in the match, preparing them to play the specified song.
</div>
</div>

View file

@ -0,0 +1,49 @@
# The taClient.setQualifierFlags() method
This documents the `taClient.setQualifierFlags()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setQualifierFlags(qualifierId: string, flags: number): Promise<Response> {
// backend logic
}
```
## Parameters:
- **qualifierId** (string): The GUID of the qualifier event
- **flags** (number): The flags/settings for the qualifier event (of type `QualifierEvent_EventSettings`)
## General usage:
```ts
const response: Response = taClient.setQualifierFlags(qualifierGuid, flags);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
- For `QualifierEvent_EventSettings` please find documentation at [Enums -> QualifierEvent_EventSettings](/documentation#Enums/5-QualifierEvent_EventSettings)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setQualifierFlags: Response_SetQualifierFlags,
oneofKind: 'setQualifierFlags'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetQualifierFlags` please find documentation at [Models -> Response_SetQualifierFlags](/documentation#Models/4-Response_SetQualifierFlags).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The flags parameter controls various settings and behaviors of the qualifier event. Refer to the QualifierEvent_EventSettings enum for the available flag values.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setQualifierImage() method
This documents the `taClient.setQualifierImage()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setQualifierImage(qualifierId: string, image: Uint8Array): Promise<Response> {
// backend logic
}
```
## Parameters:
- **qualifierId** (string): The GUID of the qualifier event
- **image** (Uint8Array): The image for the qualifier as a Uint8Array (binary data)
## General usage:
```ts
const response: Response = taClient.setQualifierImage(qualifierGuid, imageBuffer);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setQualifierImage: Response_SetQualifierImage,
oneofKind: 'setQualifierImage'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetQualifierImage` please find documentation at [Models -> Response_SetQualifierImage](/documentation#Models/4-Response_SetQualifierImage).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The image will be displayed in the tournament menu and on qualifier-related UI elements. The Uint8Array should be obtained from file input or image processing.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setQualifierInfoChannel() method
This documents the `taClient.setQualifierInfoChannel()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setQualifierInfoChannel(qualifierId: string, discordChannelId: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **qualifierId** (string): The GUID of the qualifier event
- **discordChannelId** (string): The Discord channel ID where qualifier scores and updates will be sent
## General usage:
```ts
const response: Response = taClient.setQualifierInfoChannel(qualifierGuid, discordChannelId);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setQualifierInfoChannel: Response_SetQualifierInfoChannel,
oneofKind: 'setQualifierInfoChannel'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetQualifierInfoChannel` please find documentation at [Models -> Response_SetQualifierInfoChannel](/documentation#Models/4-Response_SetQualifierInfoChannel).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The Tournament Assistant bot will post qualifying scores and updates to the specified Discord channel. This allows for easy monitoring of qualifier progress by server members.
</div>
</div>

View file

@ -0,0 +1,49 @@
# The taClient.setQualifierLeaderboardSort() method
This documents the `taClient.setQualifierLeaderboardSort()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setQualifierLeaderboardSort(qualifierId: string, sortType: QualifierEvent_LeaderboardSort): Promise<Response> {
// backend logic
}
```
## Parameters:
- **qualifierId** (string): The GUID of the qualifier event
- **sortType** (QualifierEvent_LeaderboardSort): The sorting method for the leaderboard (e.g., modifiedScore, sumScore, bestScore)
## General usage:
```ts
const response: Response = taClient.setQualifierLeaderboardSort(qualifierGuid, sortType);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
- For `QualifierEvent_LeaderboardSort` please find documentation at [Enums -> QualifierEvent_LeaderboardSort](/documentation#Enums/5-QualifierEvent_LeaderboardSort)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setQualifierLeaderboardSort: Response_SetQualifierLeaderboardSort,
oneofKind: 'setQualifierLeaderboardSort'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetQualifierLeaderboardSort` please find documentation at [Models -> Response_SetQualifierLeaderboardSort](/documentation#Models/4-Response_SetQualifierLeaderboardSort).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The leaderboard sort type determines how player scores are ranked and displayed. Different sort types can emphasize consistency versus peak performance.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setQualifierName() method
This documents the `taClient.setQualifierName()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setQualifierName(qualifierId: string, name: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **qualifierId** (string): The GUID of the qualifier event
- **name** (string): The new name for the qualifier event
## General usage:
```ts
const response: Response = taClient.setQualifierName(qualifierGuid, 'New Qualifier Name');
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setQualifierName: Response_SetQualifierName,
oneofKind: 'setQualifierName'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetQualifierName` please find documentation at [Models -> Response_SetQualifierName](/documentation#Models/4-Response_SetQualifierName).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The qualifier name is displayed in the tournament menu and in all UI elements related to the qualifier event.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setTournamentAllowUnauthorizedView() method
This documents the `taClient.setTournamentAllowUnauthorizedView()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentAllowUnauthorizedView(tournamentId: string, allow: boolean): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **allow** (boolean): Whether to allow unauthorized users to view the tournament
## General usage:
```ts
const response: Response = taClient.setTournamentAllowUnauthorizedView(tournamentGuid, true);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentAllowUnauthorizedView: Response_SetTournamentAllowUnauthorizedView,
oneofKind: 'setTournamentAllowUnauthorizedView'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentAllowUnauthorizedView` please find documentation at [Models -> Response_SetTournamentAllowUnauthorizedView](/documentation#Models/4-Response_SetTournamentAllowUnauthorizedView).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> When enabled, users without the view permission can still access and view tournament information. When disabled, only authorized users can view the tournament.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setTournamentBannedMods() method
This documents the `taClient.setTournamentBannedMods()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentBannedMods(tournamentId: string, bannedMods: string[]): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **bannedMods** (string[]): An array of mod names to ban from the tournament
## General usage:
```ts
const response: Response = taClient.setTournamentBannedMods(tournamentGuid, ['Mod1', 'Mod2']);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentBannedMods: Response_SetTournamentBannedMods,
oneofKind: 'setTournamentBannedMods'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentBannedMods` please find documentation at [Models -> Response_SetTournamentBannedMods](/documentation#Models/4-Response_SetTournamentBannedMods).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> Banned mods cannot be used during tournament matches. This helps enforce tournament rules and fairness.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setTournamentEnablePools() method
This documents the `taClient.setTournamentEnablePools()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentEnablePools(tournamentId: string, enable: boolean): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **enable** (boolean): Whether to enable the map pools feature for the tournament
## General usage:
```ts
const response: Response = taClient.setTournamentEnablePools(tournamentGuid, true);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentEnablePools: Response_SetTournamentEnablePools,
oneofKind: 'setTournamentEnablePools'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentEnablePools` please find documentation at [Models -> Response_SetTournamentEnablePools](/documentation#Models/4-Response_SetTournamentEnablePools).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> When enabled, tournament organizers can create and manage map pools. When disabled, the map pools feature is hidden and unavailable.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setTournamentEnableTeams() method
This documents the `taClient.setTournamentEnableTeams()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentEnableTeams(tournamentId: string, enable: boolean): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **enable** (boolean): Whether to enable the teams feature for the tournament
## General usage:
```ts
const response: Response = taClient.setTournamentEnableTeams(tournamentGuid, true);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentEnableTeams: Response_SetTournamentEnableTeams,
oneofKind: 'setTournamentEnableTeams'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentEnableTeams` please find documentation at [Models -> Response_SetTournamentEnableTeams](/documentation#Models/4-Response_SetTournamentEnableTeams).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> When enabled, tournament organizers can create teams and assign players to them. When disabled, the teams feature is hidden and unavailable.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setTournamentImage() method
This documents the `taClient.setTournamentImage()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentImage(tournamentId: string, image: Uint8Array): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **image** (Uint8Array): The image for the tournament as a Uint8Array (binary data)
## General usage:
```ts
const response: Response = taClient.setTournamentImage(tournamentGuid, imageBuffer);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentImage: Response_SetTournamentImage,
oneofKind: 'setTournamentImage'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentImage` please find documentation at [Models -> Response_SetTournamentImage](/documentation#Models/4-Response_SetTournamentImage).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The tournament image will be displayed in the tournament menu and on tournament-related UI elements. The Uint8Array should be obtained from file input or image processing.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setTournamentName() method
This documents the `taClient.setTournamentName()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentName(tournamentId: string, name: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **name** (string): The new name for the tournament
## General usage:
```ts
const response: Response = taClient.setTournamentName(tournamentGuid, 'New Tournament Name');
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentName: Response_SetTournamentName,
oneofKind: 'setTournamentName'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentName` please find documentation at [Models -> Response_SetTournamentName](/documentation#Models/4-Response_SetTournamentName).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The tournament name is displayed throughout the application in tournament menus and information pages.
</div>
</div>

View file

@ -0,0 +1,51 @@
# The taClient.setTournamentPoolImage() method
This documents the `taClient.setTournamentPoolImage()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentPoolImage(tournamentId: string, poolId: string, image: Uint8Array): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **poolId** (string): The GUID of the pool for which to set the image
- **image** (Uint8Array): The image data as a Uint8Array (binary bitmap data)
## General usage:
```ts
const response: Response = await taClient.setTournamentPoolImage(
tournamentGuid,
poolGuid,
imageBuffer
);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentPoolImage: Request_SetTournamentPoolImage,
oneofKind: 'setTournamentPoolImage'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method sets the image associated with a tournament pool. The image will be displayed in the tournament interface to visually identify the pool. The Uint8Array should contain the binary image data obtained from file input or image processing.
</div>
</div>

View file

@ -0,0 +1,49 @@
# The taClient.setTournamentPoolName() method
This documents the `taClient.setTournamentPoolName()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentPoolName(tournamentId: string, poolId: string, name: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **poolId** (string): The GUID of the map pool
- **name** (string): The new name for the map pool
## General usage:
```ts
const response: Response = taClient.setTournamentPoolName(tournamentGuid, poolGuid, 'Round 1 Pool');
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentPoolName: Response_SetTournamentPoolName,
oneofKind: 'setTournamentPoolName'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentPoolName` please find documentation at [Models -> Response_SetTournamentPoolName](/documentation#Models/4-Response_SetTournamentPoolName).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The map pool name is used to identify the pool in tournament management interfaces.
</div>
</div>

View file

@ -0,0 +1,51 @@
# The taClient.setTournamentRoleName() method
This documents the `taClient.setTournamentRoleName()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentRoleName(tournamentId: string, roleId: string, roleName: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **roleId** (string): The GUID of the role to rename
- **roleName** (string): The new name for the role
## General usage:
```ts
const response: Response = await taClient.setTournamentRoleName(
tournamentGuid,
roleGuid,
'Tournament Organizer'
);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentRoleName: Request_SetTournamentRoleName,
oneofKind: 'setTournamentRoleName'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method updates the display name of a tournament role. Role names are used to identify different permission levels and responsibilities within a tournament (e.g., "Administrator", "Referee", "Commentator").
</div>
</div>

View file

@ -0,0 +1,51 @@
# The taClient.setTournamentRolePermissions() method
This documents the `taClient.setTournamentRolePermissions()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentRolePermissions(tournamentId: string, roleId: string, permissions: string[]): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **roleId** (string): The GUID of the role for which to set permissions
- **permissions** (string[]): An array of permission strings that define what actions this role can perform
## General usage:
```ts
const response: Response = await taClient.setTournamentRolePermissions(
tournamentGuid,
roleGuid,
['create_matches', 'edit_matches', 'view_results', 'manage_teams']
);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentRolePermissions: Request_SetTournamentRolePermissions,
oneofKind: 'setTournamentRolePermissions'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method sets the permissions for a tournament role, controlling what actions users with that role can perform in the tournament (e.g., creating matches, managing teams, viewing results).
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setTournamentScoreUpdateFrequency() method
This documents the `taClient.setTournamentScoreUpdateFrequency()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentScoreUpdateFrequency(tournamentId: string, frequency: number): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **frequency** (number): The update frequency in frames (typically 30 frames per second)
## General usage:
```ts
const response: Response = taClient.setTournamentScoreUpdateFrequency(tournamentGuid, 30);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentScoreUpdateFrequency: Response_SetTournamentScoreUpdateFrequency,
oneofKind: 'setTournamentScoreUpdateFrequency'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentScoreUpdateFrequency` please find documentation at [Models -> Response_SetTournamentScoreUpdateFrequency](/documentation#Models/4-Response_SetTournamentScoreUpdateFrequency).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The score update frequency determines how often score updates are sent from the game clients to the server. A higher number means more frequent updates. The typical value is 30 frames per second.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setTournamentShowQualifierButton() method
This documents the `taClient.setTournamentShowQualifierButton()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentShowQualifierButton(tournamentId: string, show: boolean): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **show** (boolean): Whether to show the qualifier button in the tournament menu
## General usage:
```ts
const response: Response = taClient.setTournamentShowQualifierButton(tournamentGuid, true);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentShowQualifierButton: Response_SetTournamentShowQualifierButton,
oneofKind: 'setTournamentShowQualifierButton'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentShowQualifierButton` please find documentation at [Models -> Response_SetTournamentShowQualifierButton](/documentation#Models/4-Response_SetTournamentShowQualifierButton).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> When enabled, players will see a qualifier button in the tournament menu within the game. When disabled, the qualifier button is hidden.
</div>
</div>

View file

@ -0,0 +1,48 @@
# The taClient.setTournamentShowTournamentButton() method
This documents the `taClient.setTournamentShowTournamentButton()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentShowTournamentButton(tournamentId: string, show: boolean): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **show** (boolean): Whether to show the tournament button in the tournament menu
## General usage:
```ts
const response: Response = taClient.setTournamentShowTournamentButton(tournamentGuid, true);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentShowTournamentButton: Response_SetTournamentShowTournamentButton,
oneofKind: 'setTournamentShowTournamentButton'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentShowTournamentButton` please find documentation at [Models -> Response_SetTournamentShowTournamentButton](/documentation#Models/4-Response_SetTournamentShowTournamentButton).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> When enabled, players will see a tournament button in the tournament menu within the game. When disabled, the tournament button is hidden.
</div>
</div>

View file

@ -0,0 +1,49 @@
# The taClient.setTournamentTeamImage() method
This documents the `taClient.setTournamentTeamImage()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentTeamImage(tournamentId: string, teamId: string, image: Uint8Array): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **teamId** (string): The GUID of the team
- **image** (Uint8Array): The image for the team as a Uint8Array (binary data)
## General usage:
```ts
const response: Response = taClient.setTournamentTeamImage(tournamentGuid, teamGuid, imageBuffer);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentTeamImage: Response_SetTournamentTeamImage,
oneofKind: 'setTournamentTeamImage'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentTeamImage` please find documentation at [Models -> Response_SetTournamentTeamImage](/documentation#Models/4-Response_SetTournamentTeamImage).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The team image is displayed in the tournament menu and on team-related UI elements. The Uint8Array should be obtained from file input or image processing.
</div>
</div>

View file

@ -0,0 +1,49 @@
# The taClient.setTournamentTeamName() method
This documents the `taClient.setTournamentTeamName()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function setTournamentTeamName(tournamentId: string, teamId: string, name: string): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **teamId** (string): The GUID of the team
- **name** (string): The new name for the team
## General usage:
```ts
const response: Response = taClient.setTournamentTeamName(tournamentGuid, teamGuid, 'New Team Name');
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
setTournamentTeamName: Response_SetTournamentTeamName,
oneofKind: 'setTournamentTeamName'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_SetTournamentTeamName` please find documentation at [Models -> Response_SetTournamentTeamName](/documentation#Models/4-Response_SetTournamentTeamName).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> The team name is displayed in the tournament menu and on team-related UI elements.
</div>
</div>

View file

@ -0,0 +1,38 @@
# The taClient.showColor() method
This documents the `taClient.showColor()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Synchronous:</strong> This is a synchronous method that does not require await
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
function showColor(tournamentId: string, color: string, userIds: string[]): void {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **color** (string): The color to display (typically as a hex color code like "#FF0000" or color name)
- **userIds** (string[]): An array of user GUIDs for whom the color should be displayed
## General usage:
```ts
taClient.showColor(tournamentGuid, "#FF0000", [userGuid1, userGuid2]);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns `void` - it does not return a response. It sends the display command directly to the specified users.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This is a synchronous method that displays a color on the game client for specified players. This is typically used with StreamSync for overlay visualization of player colors or status indicators.
</div>
</div>

View file

@ -0,0 +1,51 @@
# The taClient.showLoadedImage() method
This documents the `taClient.showLoadedImage()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Synchronous:</strong> This is a synchronous method that does not require await
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
function showLoadedImage(tournamentId: string, userIds: string[], show?: boolean): void {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **userIds** (string[]): An array of user GUIDs to show the image to
- **show** (boolean, optional): Whether to show (true) or hide (false) the image. Defaults to true
## General usage:
```ts
// Show the loaded image to players
taClient.showLoadedImage(tournamentGuid, [userGuid1, userGuid2], true);
// Or hide the image
taClient.showLoadedImage(tournamentGuid, [userGuid1, userGuid2], false);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Return Value:
This method returns `void` - it does not return a response object. It sends the display command directly to the specified users.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This is a synchronous method that displays a previously loaded image using `loadImage()`. This is typically used with StreamSync and overlay systems.
</div>
</div>
## Typical workflow:
```ts
// 1. Load the image
await taClient.loadImage(imageBuffer, userGuid1, userGuid2);
// 2. Display the loaded image for 5 seconds
const response = await taClient.showLoadedImage(5000, userGuid1, userGuid2);
```

View file

@ -0,0 +1,67 @@
# The taClient.showPrompt() method
This documents the `taClient.showPrompt()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function showPrompt(tournamentId: string, userIds: string[], titleText: string, bodyText: string, canClose: boolean, options: Request_ShowPrompt_PromptOption[], timer?: number): Promise<ResponseFromUser[]> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **userIds** (string[]): An array of user GUIDs to show the prompt to
- **titleText** (string): The title text of the prompt
- **bodyText** (string): The body/message content of the prompt
- **canClose** (boolean): Whether users can manually close the prompt
- **options** (Request_ShowPrompt_PromptOption[]): An array of prompt options/buttons for user selection
- **timer** (number, optional): Optional timer in milliseconds for auto-dismissal of the prompt
## General usage:
```ts
const options = [
{ text: 'Ready', value: '1' },
{ text: 'Not Ready', value: '0' }
];
const responses: ResponseFromUser[] = await taClient.showPrompt(
tournamentGuid,
[userGuid1, userGuid2],
'Attention',
'Please wait for the next match',
true,
options,
5000 // 5 second timeout
);
```
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
The method returns an array of `ResponseFromUser` objects, each containing:
```js
{
userId: 'user-guid-1',
response: {
details: {
showPrompt: Response_ShowPrompt,
oneofKind: 'showPrompt'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
}
```
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Use Case:</strong> This method is useful for sending notifications or important messages to players during a tournament, such as announcements or match preparations.
</div>
</div>

View file

@ -0,0 +1,50 @@
# The taClient.updateQualifierMap() method
This documents the `taClient.updateQualifierMap()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function updateQualifierMap(qualifierId: string, mapId: string, updatedMap: Map): Promise<Response> {
// backend logic
}
```
## Parameters:
- **qualifierId** (string): The GUID of the qualifier event
- **mapId** (string): The GUID of the map to update
- **updatedMap** (Map): The updated map object with new settings
- For `Map` please find documentation at [Models -> Map](/documentation#Models/4-Map)
## General usage:
```ts
const response: Response = taClient.updateQualifierMap(qualifierGuid, mapGuid, updatedMapObject);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
updateQualifierMap: Response_UpdateQualifierMap,
oneofKind: 'updateQualifierMap'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_UpdateQualifierMap` please find documentation at [Models -> Response_UpdateQualifierMap](/documentation#Models/4-Response_UpdateQualifierMap).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method allows you to update the settings of an existing map within a qualifier event, such as modifiers or difficulty adjustments.
</div>
</div>

View file

@ -0,0 +1,51 @@
# The taClient.updateTournamentPoolMap() method
This documents the `taClient.updateTournamentPoolMap()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function updateTournamentPoolMap(tournamentId: string, poolId: string, mapId: string, updatedMap: Map): Promise<Response> {
// backend logic
}
```
## Parameters:
- **tournamentId** (string): The GUID of the tournament
- **poolId** (string): The GUID of the map pool
- **mapId** (string): The GUID of the map to update
- **updatedMap** (Map): The updated map object with new settings
- For `Map` please find documentation at [Models -> Map](/documentation#Models/4-Map)
## General usage:
```ts
const response: Response = taClient.updateTournamentPoolMap(tournamentGuid, poolGuid, mapGuid, updatedMapObject);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
updateTournamentPoolMap: Response_UpdateTournamentPoolMap,
oneofKind: 'updateTournamentPoolMap'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_UpdateTournamentPoolMap` please find documentation at [Models -> Response_UpdateTournamentPoolMap](/documentation#Models/4-Response_UpdateTournamentPoolMap).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method allows you to update the settings of an existing map within a tournament map pool, such as modifiers or difficulty adjustments.
</div>
</div>

View file

@ -0,0 +1,49 @@
# The taClient.updateUser() method
This documents the `taClient.updateUser()` method.
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Async:</strong> This is a method you would want to use await with
</div>
</div>
This method has input parameters. The function could easily be defined as:
```ts
async function updateUser(userId: string, userData: User): Promise<Response> {
// backend logic
}
```
## Parameters:
- **userId** (string): The GUID of the user to update
- **userData** (User): The updated user object with new information
- For `User` please find documentation at [Models -> User](/documentation#Models/4-User)
## General usage:
```ts
const response: Response = taClient.updateUser(userGuid, updatedUserObject);
```
- For `Response` please find documentation at [Models -> Response](/documentation#Models/4-Response)
If you have not yet, please read [Client -> Introduction to the Client](/documentation#Client/3-client-intro)
## Standard Response:
```js
{
details: {
updateUser: Response_UpdateUser,
oneofKind: 'updateUser'
},
respondingToPacketId: 'packet-guid-uuidv4',
type: Response_ResponseType
}
```
- For `Response_UpdateUser` please find documentation at [Models -> Response_UpdateUser](/documentation#Models/4-Response_UpdateUser).
<div class="info-box">
<span class="material-icons">info</span>
<div>
<strong>Note:</strong> This method allows you to update user information, potentially including Discord ID associations and other user-related data.
</div>
</div>

View file

@ -0,0 +1,22 @@
# Acknowledgement
```ts
/**
* ---- Backbone ---- //
*
* @generated from protobuf message proto.packets.Acknowledgement
*/
interface Acknowledgement {
/**
* @generated from protobuf field: string packet_id = 1;
*/
packetId: string;
/**
* @generated from protobuf field: proto.packets.Acknowledgement.AcknowledgementType type = 2;
*/
type: Acknowledgement_AcknowledgementType;
}
```
## References
- For `Acknowledgement_AcknowledgementType` please find documentation at [Enums -> Acknowledgement_AcknowledgementType](/documentation#Enums/5-Acknowledgement_AcknowledgementType).

View file

@ -0,0 +1,25 @@
# Beatmap
```ts
interface Beatmap {
/**
* @generated from protobuf field: string name = 1;
*/
name: string;
/**
* @generated from protobuf field: string level_id = 2;
*/
levelId: string;
/**
* @generated from protobuf field: proto.models.Characteristic characteristic = 3;
*/
characteristic?: Characteristic;
/**
* @generated from protobuf field: int32 difficulty = 4;
*/
difficulty: number;
}
```
## References
- For `Characteristic` please find documentation at [Models -> Characteristic](/documentation#Models/4-Characteristic).

View file

@ -0,0 +1,14 @@
# Channel
```ts
interface Channel {
/**
* @generated from protobuf field: string id = 1;
*/
id: string;
/**
* @generated from protobuf field: string name = 2;
*/
name: string;
}
```

View file

@ -0,0 +1,16 @@
# Characteristic
```ts
interface Characteristic {
/**
* @generated from protobuf field: string serialized_name = 1;
*/
serializedName: string;
/**
* @generated from protobuf field: repeated int32 difficulties = 2;
*/
difficulties: number[];
}
```
- `serializedName` is usually either `Standard`, or `Lawless`. Nowever characteristic names exist for no lights and a few other like 90, 180, and 360 degree maps.

View file

@ -0,0 +1,28 @@
# Command
```ts
/**
* ---- Commands (DO something!) ---- //
*
* @generated from protobuf message proto.packets.Command
*/
interface Command {
/**
* @generated from protobuf field: string tournament_id = 11;
*/
tournamentId: string;
/**
* @generated from protobuf field: repeated string forward_to = 12;
*/
forwardTo: string[];
/**
* @generated from protobuf oneof: type
*/
type: {
oneofKind: "oneOfKind";
/**
* @generated from protobuf field: bool oneOfKind = 2;
*/
oneOfKind: any;
}
```

View file

@ -0,0 +1,16 @@
# Command_ModifyGameplay
```ts
/**
* @generated from protobuf message proto.packets.Command.ModifyGameplay
*/
interface Command_ModifyGameplay {
/**
* @generated from protobuf field: proto.packets.Command.ModifyGameplay.Modifier modifier = 1;
*/
modifier: Command_ModifyGameplay_Modifier;
}
```
## References
- For `Command_ModifyGameplay_Modifier` please find documentation at [Enums -> Command_ModifyGameplay_Modifier](/documentation#Enums/5-Command_ModifyGameplay_Modifier).

View file

@ -0,0 +1,16 @@
# Command_PlaySong
```ts
/**
* @generated from protobuf message proto.packets.Command.PlaySong
*/
interface Command_PlaySong {
/**
* @generated from protobuf field: proto.models.GameplayParameters gameplay_parameters = 1;
*/
gameplayParameters?: GameplayParameters;
}
```
## References
- For `GameplayParameters` please find documentation at [Models -> GameplayParameters](/documentation#Models/4-GameplayParameters).

View file

@ -0,0 +1,13 @@
# Command_ShowColorForStreamSync
```ts
/**
* @generated from protobuf message proto.packets.Command.ShowColorForStreamSync
*/
interface Command_ShowColorForStreamSync {
/**
* @generated from protobuf field: string color = 1;
*/
color: string;
}
```

View file

@ -0,0 +1,22 @@
# CoreServer
```ts
interface CoreServer {
/**
* @generated from protobuf field: string name = 1;
*/
name: string;
/**
* @generated from protobuf field: string address = 2;
*/
address: string;
/**
* @generated from protobuf field: int32 port = 3;
*/
port: number;
/**
* @generated from protobuf field: int32 websocket_port = 4;
*/
websocketPort: number;
}
```

View file

@ -0,0 +1,14 @@
# DiscordUser
```ts
interface DiscordUser {
/**
* @generated from protobuf field: string id = 1;
*/
id: string;
/**
* @generated from protobuf field: string name = 2;
*/
name: string;
}
```

18
src/lib/taDocs/4-Event.md Normal file
View file

@ -0,0 +1,18 @@
# Event
```ts
interface Event {
/**
* @generated from protobuf oneof: changed_object
*/
changedObject: {
oneofKind: "oneOfKind";
/**
* @generated from protobuf field: proto.packets.Event.oneOfKind oneOfKind = 1;
*/
oneOfKind: any;
}
}
```
Again, this is not something you will really be seeing any of during development unless you are handling protobuf for yourself, in which case you are better off in the proto models repo.

View file

@ -0,0 +1,17 @@
# Event_MatchCreated
```ts
interface Event_MatchCreated {
/**
* @generated from protobuf field: string tournament_id = 1;
*/
tournamentId: string;
/**
* @generated from protobuf field: proto.models.Match match = 2;
*/
match?: Match;
}
```
## References
- For `Match` please find documentation at [Models -> Match](/documentation#Models/4-Match).

View file

@ -0,0 +1,17 @@
# Event_MatchDeleted
```ts
interface Event_MatchDeleted {
/**
* @generated from protobuf field: string tournament_id = 1;
*/
tournamentId: string;
/**
* @generated from protobuf field: proto.models.Match match = 2;
*/
match?: Match;
}
```
## References
- For `Match` please find documentation at [Models -> Match](/documentation#Models/4-Match).

Some files were not shown because too many files have changed in this diff Show more