Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 1.6, - new search, infinite map handling, etc #257

Draft
wants to merge 99 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
cb2f789
remove docker container signing because it fails the pipeline and is …
felacek Mar 30, 2024
0b79f6d
Merge remote-tracking branch 'origin/dev' into dev
felacek Mar 30, 2024
c3d6410
mvp of dynamic map loading
felacek Apr 5, 2024
f893887
allow displaying environment in maplist instead of karma
wsrvn Apr 6, 2024
ca651c0
allow displaying environment in podium mapwidget instead of tmx time
wsrvn Apr 6, 2024
ccffd5f
bun compatibility
felacek Apr 6, 2024
403382f
fix stacktrace errors
felacek Apr 6, 2024
bb119e7
Merge branch 'dev' into infinite-maps
felacek Apr 6, 2024
8a955c1
functional dynamic maps
felacek Apr 7, 2024
30c1492
fix requeue not pushing the map to the start of the queue
wsrvn Apr 8, 2024
01e89e6
functional dynamic maps
felacek Apr 8, 2024
80acc84
fix queue counter on duplicate maps
lythx Apr 8, 2024
02ffb5e
added comments and docs
felacek Apr 9, 2024
15b43ac
improved parsing by skipping existing maps
felacek Apr 9, 2024
718dfce
bug fixes
felacek Apr 10, 2024
9bbc51c
safety checks when loading maps, bug fixes, improved URI decoding
felacek Apr 11, 2024
6d2cfba
updated types after bumping node version up to 18
felacek Apr 11, 2024
aafabf7
reasonable default values for environments
felacek Apr 11, 2024
d1c8974
fixed controller crashing when attempting to look at non-existant map…
felacek Apr 11, 2024
6d694a3
adding maps will save them to the specified maps directory
felacek Apr 11, 2024
20edf5e
fixed adding, escape map names, specified different default map direc…
felacek Apr 11, 2024
46e65cc
Merge branch 'dev' into infinite-maps
felacek Apr 11, 2024
0e23ee1
added bun to readme
felacek Apr 11, 2024
33720ad
removed params, changed config, changed tm.game to gameconfig
felacek Apr 13, 2024
cb7ffe4
fix indentation in config files
wsrvn Apr 13, 2024
03dad89
fix indent in ts files (this commit sucks)
wsrvn Apr 13, 2024
40358ea
change objects to record type
wsrvn Apr 13, 2024
05f4f93
fixed filename parsing
felacek Apr 13, 2024
f18f7a7
important fix: map repository no longer outputs object Object
wsrvn Apr 13, 2024
9002424
prevent duplicates by using maps
felacek Apr 13, 2024
42f1415
map id set
felacek Apr 13, 2024
5b6cda5
Merge remote-tracking branch 'origin/infinite-maps' into infinite-maps
felacek Apr 13, 2024
e2a7d70
replaced arrays with sets in manualmaploading
felacek Apr 13, 2024
bf137da
fixed the ugly if oneliners :)
wsrvn Apr 13, 2024
b5dfe94
clamped checkpoint amount to 2 byte integer
felacek Apr 13, 2024
b3ec1cd
Merge remote-tracking branch 'origin/infinite-maps' into infinite-maps
felacek Apr 13, 2024
f3be35e
fixed challenge type parsing
felacek Apr 13, 2024
22d17fe
im idiot
felacek Apr 13, 2024
2543852
small fixes and linting
felacek Apr 13, 2024
fb3c49d
fix freezone plugin sending too long names to manialive
wsrvn Apr 14, 2024
95a896a
allow cp counter to be on the sides
wsrvn Apr 14, 2024
3e18077
nations servers will not get non-stad maps from db
felacek Apr 14, 2024
20006a7
fixed cpcounter width
wsrvn Apr 14, 2024
89ddb6f
fix cp counter config invalid width
wsrvn Apr 14, 2024
cb9023d
added environment-dependent screenshots for non-tmx maps
felacek Apr 14, 2024
2c987fc
updated gitignore
felacek Apr 14, 2024
1f2f122
Merge pull request #251 from lythx/infinite-maps
felacek Apr 16, 2024
1b248b9
added //savematchsettings
wsrvn Apr 18, 2024
5184bd5
implement new search algorithm
wsrvn Apr 21, 2024
665386b
fix types in admin commands and actions
wsrvn Apr 21, 2024
39bc095
fixed types in admin windows
wsrvn Apr 21, 2024
98444db
remove old matchstring code
wsrvn Apr 24, 2024
0d4d19c
fix and optimize topsums and topaverages
lythx Apr 24, 2024
e400663
dont update all ranks every time matchsettings are loaded
felacek Apr 25, 2024
2f17ed9
remove .then() from async code
wsrvn Apr 28, 2024
d2a143f
Merge pull request #256 from lythx/new-search
wsrvn Apr 28, 2024
7a9fd3c
add maplist >5000 map handling
lythx Apr 29, 2024
b5b9563
tmx parse crash fix and debug
lythx Apr 30, 2024
5777b61
fix crash on start due to incorrect information supplied to construct…
wsrvn Jun 2, 2024
6f3e3e5
revert 80acc84
lythx Jun 2, 2024
672b43e
Merge branch 'dev' of https://github.com/lythx/trakman into dev
lythx Jun 2, 2024
cd4a242
prevent the same map being juked twice
lythx Jun 2, 2024
73d80b0
moved requeue to actions
wsrvn Jun 2, 2024
9be438c
fix the requeue not returning on error
wsrvn Jun 2, 2024
046ecde
changed logins to nicknames in all actions
wsrvn Jun 2, 2024
c735b54
tmx quickfix number 38947268
lythx Jun 2, 2024
0fffe1a
Merge branch 'dev' of https://github.com/lythx/trakman into dev
lythx Jun 2, 2024
3b4ad5b
tmx hotfix number 38947269 (I LOVE TMX DEVELOPERS!!!!)
wsrvn Jun 2, 2024
4db3545
tmx hotfix number 38947270
wsrvn Jun 2, 2024
450841f
added autonewline to ui text options, fixed rank calculation, optimis…
felacek Jun 8, 2024
2af77cd
use this instead of class name in logger
wsrvn Jul 2, 2024
91c6465
maplist open on page feature
lythx Jul 2, 2024
f128c21
add page selection to maplist commands
lythx Jul 2, 2024
b8ea265
fix same map filename bug
lythx Jul 2, 2024
e336d08
implement timeout on manialink iteraction
lythx Jul 2, 2024
12c0d4d
change manialink click timeout to an optimal value
wsrvn Jul 2, 2024
4ee21a7
fix maplist commands page param
lythx Jul 2, 2024
463c8f7
fix incorrect values
wsrvn Jul 3, 2024
e0d8eff
fix maplist async out of bound error
lythx Jul 20, 2024
1a4981c
remove foreach from info plugin
wsrvn Jul 20, 2024
cbb85b5
fix maps over 1mb hanging the server
lythx Jul 20, 2024
d5b133f
Merge branch 'dev' of https://github.com/lythx/trakman into dev
lythx Jul 20, 2024
511e58c
revert add map function for low map amount servers
lythx Jul 20, 2024
2723607
optimize FixRankCoherence algorithm
lythx Jul 21, 2024
78601f8
hotfix bulkadd error with newlines in map name
wsrvn Aug 22, 2024
8720445
fixed formatting on some messages
wsrvn Aug 22, 2024
2c3884d
add safestring to chatlog playerstats bestcps and bestfinishes
lythx Aug 27, 2024
921acda
Merge branch 'dev' of https://github.com/lythx/trakman into dev
lythx Aug 27, 2024
fd72857
implement top playtimes update on interval
lythx Sep 12, 2024
6ea949e
Best Cps horizontal layout
lythx Sep 14, 2024
1e4e1a9
Best Finishes vertical layout
lythx Sep 14, 2024
a3d1a28
fix incorrect index on horizontal bestfins
wsrvn Sep 15, 2024
04e6e39
fix the index fix (Great Fortune)
wsrvn Sep 15, 2024
e25666b
skipping while in 'transition' state waits until 'race' before sendin…
felacek Sep 18, 2024
277df92
improved pay/vote replay/skip, single player can always extend
felacek Sep 19, 2024
b5e583a
forgot to commit oops
felacek Sep 19, 2024
6397656
set vertical best fins as default
felacek Sep 19, 2024
05ed027
font sizes
felacek Sep 19, 2024
f96b0f3
fix tmxfetcher not looping over tmx sites on empty response in gettmxid
wsrvn Sep 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SERVER_IP=127.0.0.1
SERVER_PORT=5000
SUPER_ADMIN_NAME=SuperAdmin
SUPER_ADMIN_PASSWORD=
SERVER_PACKMASK=nations

# Database config
DB_USER=postgres
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,3 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# VSCode
/.vscode/

# IntelliJ
/.idea/

# Config files
**/[Cc]onfig/*
**[Cc]onfig.js
Expand All @@ -22,4 +25,12 @@
/node_modules/

# Environment
.env
.env

# Docker
/trakman/
/tmf-config/
/tracks/

# Bun
bun.lockb
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you prefer not to use containers and/or want to install manually, [see this p

## Manual Installation Requirements
- Trackmania Forever dedicated server [v2011-02-21 / Latest](http://files2.trackmaniaforever.com/TrackmaniaServer_2011-02-21.zip)
- NodeJS [v14.21.3+](https://nodejs.org/en/download) (we recommend using the latest LTS version)
- Node.js [v18.20.2+](https://nodejs.org/en/download) (we recommend using the latest LTS version) OR Bun [v1.1+](https://bun.sh/docs/installation)
- PostgreSQL [v12+](https://www.postgresql.org/download) (any currently supported version is fine)

On Linux, relevant versions of NodeJS & PostgreSQL should be available in your distro's repositories by default (see [here](https://repology.org/project/nodejs/versions) for NodeJS and [here](https://repology.org/project/postgresql/versions) for PostgreSQL)
Expand Down
44 changes: 41 additions & 3 deletions config/Config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
/**
/**
* Manual chat routing is needed for chat utilities such as custom brackets or finish counter.
* Enabling it makes the chat a bit slower, as all input has to go through the controller first.
*/
Expand All @@ -22,6 +22,8 @@ export default {
defaultTMXSearchLimit: 50,
/** Whether to reset Cup mode scores after a map is skipped or restarted */
resetCupScoreOnSkipAndRestart: true,
/** Timeout after clicking manialink in miliseconds */
manialinkInteractionTimeout: 50,
/** Privilege levels for each of the administrative actions */
privileges: {
ban: 2,
Expand All @@ -33,14 +35,45 @@ export default {
addMap: 1,
removeMap: 1,
},
/**
* Enable this for Trakman to take over handling maps. The controller will read maps from a folder
* defined below and give the upcoming ones to the server, allowing for much more map capacity than
* the server can handle (it becomes basically unresponsive at 5000 maps).
* Enabling is recommended for new servers since writing a MatchSettings file manually is laborious,
* while old servers with some deleted maps will probably not gain a large advantage.
*
* Only works when the Trackmania server is on the same computer as Trakman!
*/
manualMapLoading: {
enabled: false,
/** Path to the `GameData/Tracks/` directory of the server. MUST end with a slash '/'!
* Default value: "../GameData/Tracks/" assuming the Trakman directory is on the same level as the server.
*/
mapsDirectoryPrefix: "../GameData/Tracks/",
/** Relative path to all the maps. Read recursively from `GameData/Tracks/`.
* MUST end with a slash '/' when a directory is specified (i.e. if not left empty)!
* Default value: ""
*/
mapsDirectory: "",
/** Ignore non-stadium maps */
stadiumOnly: undefined,
/** Amount of maps to load into the server. Default value: 5 */
preloadMaps: 5,
},
/**
* When adding a large amount of maps, it is better to add them in smaller chunks. This is the size
* of each chunk. Set to a higher amount to increase speed of pushing to the database, decrease
* if you are having problems with memory. Default value: 2000
*/
splitBy: 2000,
/** Whether the maplist gets reloaded on Match Settings updates.
* Enable this if you use external tools to modify the Match Settings */
updateMatchSettingsOnChange: false,
/** Point system for rounds and cup gamemodes */
roundsModePointSystem: [33, 29, 27, 25, 23, 21, 19, 17, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
/** Default time limit in TimeAttack mode (in miliseconds) */
/** Default time limit in TimeAttack mode (in milliseconds) */
defaultTimeAttackTimeLimit: 300000,
/** Minimal time value to which the dynamic timer can be set (in miliseconds) */
/** Minimal time value to which the dynamic timer can be set (in milliseconds) */
dynamicTimerSubtractionLimit: 30000,
/** Relative path (/GameData/Config/) to the blacklist file */
blacklistFile: "blacklist.txt",
Expand All @@ -54,6 +87,11 @@ export default {
truthyParams: ['true', 'yes', 'y', '1'],
/** Things that will be interpreted as false for the boolean command parameter */
falsyParams: ['false', 'no', 'n', '0'],
/** Object with options for ufuzzy, see https://github.com/leeoniya/uFuzzy#options */
searchOptions: {
intraMode: 1,
alpha: "a-zа-яё"
},
/** Represents default minimal similarity value at which nickname to
* login translation will be successful. Used in nickname to login
* translation in commands. 0.4 is the default value */
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.0"

services:
trakman:
image: borecek/trakman:main
Expand All @@ -25,6 +23,7 @@ services:
SERVER_PASSWORD: ""
SERVER_NET_PORT: 2350
SERVER_P2P_PORT: 3450
SERVER_PACKMASK: "nations"
# Database config - preconfigured for included database
DB_USER: "trakman"
DB_PASSWORD: "trakman"
Expand Down
2 changes: 2 additions & 0 deletions docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ else
xml ed -L -u "/dedicated/system_config/server_port" -v "$SERVER_NET_PORT" dedicated_cfg.txt.bk
xml ed -L -u "/dedicated/system_config/server_p2p_port" -v "$SERVER_P2P_PORT" dedicated_cfg.txt.bk
xml ed -L -u "/dedicated/system_config/xmlrpc_port" -v "$SERVER_PORT" dedicated_cfg.txt.bk
xml ed -L -u "/dedicated/system_config/packmask" -v "$SERVER_PACKMASK" dedicated_cfg.txt.bk
mv /app/server/dedicated_cfg.txt.bk /app/server/GameData/Config/dedicated_cfg.txt
fi
# copy over default tracks
Expand Down Expand Up @@ -55,6 +56,7 @@ chown -R server:server /app/server
# build and actually run everything
echo "#!/bin/sh
/app/server/TrackmaniaServer /game_settings=MatchSettings/MatchSettings.txt /dedicated_cfg=dedicated_cfg.txt
npm i --prefix /app/server/trakman
npm run build --prefix /app/server/trakman
chmod -R a+w /app/server
npm run daemon --prefix /app/server/trakman" > run.sh
Expand Down
107 changes: 60 additions & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"dependencies": {
"dice-similarity-coeff": "^1.1.1",
"@leeoniya/ufuzzy": "^1.0.14",
"dotenv": "^16.0.0",
"node-fetch": "^3.2.4",
"pg": "^8.7.3",
"pg-copy-streams": "^6.0.6",
"pm2": "^5.3.0",
"typescript": "^5.3.3",
"xml2js": "^0.5.0"
},
"devDependencies": {
"@types/node": "^17.0.33",
"@types/node": "^18.11.9",
"@types/pg": "^8.6.5",
"@types/pg-copy-streams": "^1.2.5",
"@types/xml2js": "^0.4.11",
"ts-node": "^10.7.0"
},
Expand Down
Loading
Loading