lythx / trakman

Trackmania Forever server controller written in TypeScript
https://trakman.ptrk.eu
MIT License
24 stars 4 forks source link

changes for 1.4.3 #243

Closed wsrvn closed 7 months ago

wsrvn commented 7 months ago

closes #242 #240 #238 #237 #235 #234 #233 #232 #231. idk about other cup mode stuff. we cant/dont test cup mode really

felacek commented 7 months ago

When all maps but one are removed and the current one is skipped, the controller crashes.

wsrvn commented 7 months ago

map service doesnt expect maps other than the current one being removed i believe, as that wasnt possible until now (just a guess) @lythx gotta fix this before merge

xadll commented 7 months ago

During today's testing, I tried switching mods a lot, skipping/restarting maps a lot, and removing various maps from the jukebox and map list.

Some errors popped up in the log, I probably didn't notice it in the game if something went wrong there. I don't know the exact replication procedure yet.

Error: Cant find map with id znbgMZayw8uBByLWqc6kYsEfG6l in memory
    at Function.updateNextMap (file:///app/server/trakman/src/services/MapService.ts:380:36)
    at Function.update (file:///app/server/trakman/src/services/MapService.ts:356:16)
    at Object.callback (file:///app/server/trakman/src/Listeners.ts:214:11)

Could it be related to leaving the SCORE screen too quickly? (skip by BACKSPACE) Or by manipulating the jukebox right before that?

TypeError: ranking is not iterable
    at Function.handleEndRound (file:///app/server/trakman/src/services/RoundsService.ts:233:23)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at processImmediate (node:internal/timers:449:9)
    at Object.callback (file:///app/server/trakman/src/Listeners.ts:199:9)
xadll commented 7 months ago

The cup mod works fine for me so far.

xadll commented 7 months ago

/xlist ?, /xlist _, /xlist -, /xlist !, /xlist ;, /xlist :, /xlist +, /xlist @, ... - this kind of xlist arguments will cause the controller to crash.

<INFO> [17 Jan 2024 14:56:22] (ChatService.ts:78) streda.veteran|XadL»»» (xadlik) used command /xlist with params ?
SyntaxError: Unexpected token '<', "
 <!DOCTYPE "... is not valid JSON
    at JSON.parse (<anonymous>)
    at Response.json (file:///app/server/trakman/node_modules/node-fetch/src/body.js:149:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Function.searchForMap (file:///app/server/trakman/src/TMXFetcher.ts:227:19)
    at Object.callback (file:///app/server/trakman/plugins/ui/dynamic_components/TMXSearchWindow.component.ts:57:18)
<FATAL> [17 Jan 2024 14:56:22] (Logger.ts:88) Unhandled rejection occured: 
    Unexpected token '<', "
 <!DOCTYPE "... is not valid JSON
    SyntaxError: Unexpected token '<', "
    <!DOCTYPE "... is not valid JSON
        at JSON.parse (<anonymous>)
        at Response.json (file:///app/server/trakman/node_modules/node-fetch/src/body.js:149:15)
        at processTicksAndRejections (node:internal/process/task_queues:95:5)
        at Function.searchForMap (file:///app/server/trakman/src/TMXFetcher.ts:227:19)
        at Object.callback (file:///app/server/trakman/plugins/ui/dynamic_components/TMXSearchWindow.component.ts:57:18)
 App [Trakman:0] exited with code [1] via signal [SIGINT]
 App [Trakman:0] starting in -fork mode-
 App [Trakman:0] online
wsrvn commented 7 months ago

ill look into the /xlist issue;

errors in your first comment seem to be coming from the mapservice issues i mentioned right above, which we'll probably work on soon-ish (this weekend? maybe).

felacek commented 7 months ago

Regarding the map queue: removeFromJukebox which is called by remove does not remove unforced (aka not explicitly jukeboxed) maps from the queue, I'll rewrite it a bit.

felacek commented 7 months ago

As for the 'ranking not iterable' bug, this is why it happens. image

Caused by this in ClientSocket.ts image

I think it would be good just to try calling GetCurrentRanking again because perhaps the server is in some transitional state between podium screen and the game and just doesn't answer in time?