33 Commits
Author SHA1 Message Date
zeex64 ece3aa5f0d Merge pull request #277 from DreadHeadHippy/plex-link
Music: link a Plex account, with now-playing, album art and transport controls
2026-10-17 01:53:14 -05:00
AyeZeeBB 4c07f2493b Menu: a full screen layout for controllers beside the window, and the pages regrouped
The ReSkate menu now has two styles, switched with View / F11 or the buttons in its top bar
and saved with the profile (`ui fullscreen`):
- Window: the mouse menu as before, with a side rail of pages in groups.
- Full screen: made for a controller, in the pause menu's look. Pages across the top (LB / RB),
  each page's sections as the ONLINE page's tabs (LT / RT), button prompts at the bottom, the
  pause menu's sounds, and the pause menu's own Multiplayer pages as ONLINE.

The pages are regrouped: HOME (quick switches and a tile for each page), MAP, BUILD, SKATER
(freecam, first person, cheats), SANDBOX (once Trainer), ADDONS (drone, Board Break, Road
Rash, Hall of Meat, grind exits, music), ONLINE, PROGRESS, MODS, SETTINGS, DEVELOPER.

Full screen, every shared control is drawn for a pad: switches and option rows changed with
left / right one step a press, sliders as steppers that repeat when held, rows of buttons,
and pages that scroll with the right stick. Search boxes and typed values stay in the window.
A pad press takes the menu's focus back and hides the pointer until the mouse moves.

Also: map pictures in the map picker (official loading screens, a mod's icon) with a search
box in the window, Splash and Tutorial Island left out of it; number boxes beside the
window's sliders; the binds in groups, with an action bind to open the menu (`menu`); a menu
size for each style (`ui scalefull`); the time of day stepping from the one last asked for.
2026-10-16 23:37:33 -05:00
DreadHeadHippy 4e4ff152e2 Music: link a Plex account, with now-playing, album art and transport controls 2026-10-16 23:26:16 -04:00
AyeZeeBB 719cba1166 Freezes and crashes: the game's threads no longer wait on ReSkate's slow work
Players reported the game hanging for about a second while skating. A
profile showed the memory line in the log walking every heap
(HeapSummary) on the client thread, 0.5 to 2 s every two minutes. An
audit of everything that runs on the game's update and render threads
found more of the same, and Sentry's top crashes had causes of ours.

Freezes:
- Memory log line: no heap walk or thread snapshot; the GPU part and the
  write happen on a thread of their own.
- Profile database: synchronous=NORMAL in WAL mode. A save is still kept
  when the game crashes; every play event no longer waits for the disk
  inside the game's hooks.
- ReSkate's own preferences and values (menu clicks, session sliders,
  Discord) are saved by a background writer in order; reads see a value
  until it is saved.
- Input: the foreground window and the keyboard are sampled on a thread
  of their own (GetAncestor and GetAsyncKeyState stalled the client tick
  40-50 ms when another program held Windows' lock); flight input uses
  the sample; ClipCursor at most twice a second while a menu has the
  pointer.
- Hooks installed while the game runs go in one transaction per place
  (HookBatch): throwdowns, remote players, the party, Hall of Meat.
- Off the update thread: the host's map package lookup (one table read in
  the background, not the Mods folder per offer), the trainer's map file
  and settings save, Board Break's settings save, mod music playlists and
  their covers, the Spotify station covers.
- Off the render thread: the Modding page's and the deck card's Mods
  folder reads. The overlay's three startup waits share five seconds.
- Less work per frame: Steam names reused while one a frame is asked
  again, 2 friends a tick, steam_api64.dll checked once per process,
  cosmetic names read in place rather than a system call per character,
  an outfit load no longer copies the inventory per slot, the throwdown
  type scan runs at background priority over resident memory, the Board
  Break deck label is kept a minute.

Crashes:
- Render-resource pool: the metadata fields are written to the state
  owner only. The other renderer is 0x2daa00 bytes, and +0x11aae28 is far
  past its end (store_field crash; heap corruption in every release).
- Other players' skateboard effects: a stale skateboard component is no
  longer followed, and the joint lookup is walked with a bound first (an
  endless loop in reused memory ended in GameStall).
- Launcher: Oodle decodes into the buffer it asks for with corrupt data
  possible, and its assertions no longer stop the process (heap corruption
  in the store-copy scan; a breakpoint in oo2core).

Timings (Send performance timings):
- A frame of half a second or more in a level is sent as game.freeze:
  where the time went (ReSkate's tick, the game's frame, or outside it),
  whether the renderer kept presenting, and ReSkate's busiest zones.
- Closing the game sends the level session it was in.

Music after a connection drop:
- Spotify device: an account Spotify could not be reached with is kept and
  tried again (3 s doubling to a minute); a session that drops is taken
  up again. Only an account Spotify refuses is asked for anew.
- YouTube playlist pictures that could not be fetched are tried again,
  from 30 s to 10 minutes apart.
2026-10-15 18:10:53 -05:00
AyeZeeBB 84940ee571 Stations: songs get their own names back before a map change, and the names shown no longer pile up
While a Spotify, YouTube Music or External Audio station is on, a song of
the game's is made to read as the track that is playing.
Crash on changing map
- The game keeps each song in its registry under its artist and title, and
  takes it out by them when its bundle unloads. A song that read as
  Spotify's was looked for under Spotify's words and not found, so its own
  entry stayed behind, pointing at an asset that was freed. Registering the
  song again for the next map read that asset (Skate.exe+0x3dd1db0 from
  0x43e260, joining a session with a station on).
- Before a level transition every such song is given its own artist and
  title back, and none is held on to: they are the old map's.
Memory
- The artist and title a song is made to read were copied afresh on every
  call, and kept. That is once a track, but every frame while the station's
  song cannot be made to read (its asset gone after a map change, or 64
  songs shown already): two copies a frame for as long as the station was
  on. Each text is now kept once.
Memory log
- The "Memory:" line also says how much is in the process's heaps (what
  ReSkate, the Spotify library and Windows' libraries allocate, apart from
  the game's own pools) and how many threads and handles there are, and it
  is written every two minutes as well as when memory moves by a quarter of
  a gigabyte.
2026-10-13 19:08:38 -05:00
AyeZeeBB 9f93c3cbb2 Shader tables: mods' are merged as in 2.0.7 again, and the game's song scorer stays within its list
Shader tables
- Reverts a61f82c ("Shader crash fix"). Since 2.0.8 a mod's own shader
  programs were copied into the merged table, and the tables that cosmetic
  bundles carry were merged across mods. Each such bundle then held other
  mods' programs, and the game built them as the bundle loaded, before the
  files with their compiled variants were there. That was 2.0.8's most
  reported crash (Skate.exe+0x3f86da6, some forty machines in ten minutes).
  2.0.9's guard passed such a program over, and the same players then
  crashed a little later in cosmetic loading (+0x3f7bb65, +0x16fe1a6,
  +0x3dc07ed).
- Whatever crash a61f82c fixed comes back with this for the mods that
  needed it.
- The guard stays.

Music
- The game's read of one song for its scorer (0x14f23a0) is replaced by the
  same read with the check it lacks: a place past the end of the playlist
  asset's songs has no song, which the game already answers with 0. 2.0.9's
  check in music_select_next_hook looked at what the queue held before the
  game was asked and did not see these; the game asked for places such as
  0xd570 and crashed reading them (7 reports on 6 machines).
- Said in the log the first eight times.

Not confirmed in game: neither change has been run by a player who was
crashing.
2026-10-13 18:44:15 -05:00
AyeZeeBB 83f148390a Spotify device and streams: secure connections of their own, not Windows'
nder Wine and Proton the Spotify device signed in but was never taken up
by Spotify as a device to play on: librespot never logged "active device
is ...", nothing could be started on it, and after a minute and a half its
control connection failed ("Websocket connection failed: Remote sent after
having closed"). Its HTTPS and websocket went through Windows' security
layer, which there is Wine's own.
librespot and reqwest are now built with rustls and its built-in
certificate authorities (rustls-tls-webpki-roots, ring) in place of
native-tls, so the same code makes the connections on Windows and under
Proton. This covers the Spotify device, online radio and anything else
fetched through the helper. Not yet confirmed on Proton.
Cargo.lock changes with it. ReSkate.dll is about 2.5 MB larger.
2026-10-13 18:05:06 -05:00
AyeZeeBB f356c1eafd Music screen: large playlists no longer empty it, and two logs say why things fail
Music screen: large playlists no longer empty it, and two logs say why things fail
Music screen
- The screen's list was turned down whole, and came up empty (the game's own
  Featured row too), once it held more than 1,024 songs: a few large YouTube
  Music, Spotify or local playlists went over that. The most is now 2,000
  songs and 16,384 places in playlists (music_ui_most_songs,
  music_ui_most_places); 2,000 because the screen's own table of songs is
  read only up to 2,048.
- The rows of the player's playlists are counted as they are registered and
  held under that: with no room left, the rest of a playlist is left out of
  its list (it still plays) and the screen is never empty for it.
- A row whose "artist - title" is longer than the screen takes is left out;
  one such row turned the whole list down as well.
- Said in the log: how many songs were left unlisted, and, should the list
  still be turned down, what it held.
Logs
- Spotify device: librespot's own warnings and errors are written at the
  warning level again; only the rest of what it says stays at debug. A
  player whose Spotify connects and stays silent had nothing to send.
- Multiplayer: a message turned down with "Join code, sender identity, or
  multiplayer protocol did not match" now says which of the three it was,
  its size and first bytes, and whether it came from a dedicated server.
2026-10-13 17:38:50 -05:00
AyeZeeBB 86aa8d38fb Music: local files, online radio, equaliser, queue, and a Music page in the menu
Sources
- Local Files: add a folder of music from the setup page (MP3, M4A, AAC, Ogg,
  FLAC, WAV; up to 200 songs a folder, 12 folders). Names and covers come from
  the files' tags. Each folder is a tile in its own row.
- Online Radio: find stations by name (radio-browser.info) or add a stream's
  address (MP3, AAC, .pls, .m3u; no HLS). Each station is a tile in its own
  row; the track name follows what the station sends. Up to 24.
- Both are decoded by the library built into the DLL (SpotifyHelper), which
  now plays files and HTTP streams as well as a program's output, reads tags
  and embedded pictures, and accepts MPEG-2 ADTS from AAC stations.

Sound
- Five-band equaliser (60 Hz, 250 Hz, 1 kHz, 4 kHz, 12 kHz) and loudness
  levelling, applied to every source on its way into the game.
- Loudness, the speakers option, the equaliser and levelling are now kept in
  music-settings.json between sessions.

Setup page
- Remade in the mod's own colours and type, with numbered steps per source.
- Queue pinned to the right: now playing, the playlist's songs with covers,
  find, and press to jump. Spotify's own queue shows once signed in.
- Cards for Local files and Online radio; equaliser and levelling under Sound.

In game
- MUSIC page in the menu: player and queue, sound settings, source status and
  a button for the setup page.
- "Loading song..." notice in the corner for songs that take a moment, with a
  switch to hide it. Presses made while a song is loading no longer restart it.
- The Spotify row is hidden when Spotify is not in use.
- Console: "spotify ..." is now "music ..." (music, music setup, music gain,
  music through, music spotify client|login|logout).

Logs
- The music sources' working lines (traces, per-song and per-bind lines,
  librespot's own) are debug only; stack captures are skipped unless debug
  logging is on. Grind exits: the per-pop line is debug only too.
- A "Pace:" line when the game takes the sound faster or slower than real
  time, to find why music sounds fast after tabbing back in.

Chat filter
- A run of digits is a number, not a word spelled with look-alikes: a race
  time such as 2:55.0 is no longer masked.
2026-10-12 16:03:35 -05:00
AyeZeeBB 48a9cb8f5b Music: Spotify, YouTube Music and External Audio through the in-game player
Three outside sources can now be played through the game's own music
player. Each has its own row in the music screen, shown only when it is
set up, with tiles that behave like the game's playlists: track name,
cover, pause, next, and pressing a row to start that track.

How the sound gets in
- The game's song decoder is hooked. While one of these tiles is on, the
  audio of the game song behind it (its "carrier") is replaced, block by
  block, with the outside source's audio. The game's volume, fades and
  pausing still apply.
- Rows are songs of our own registered with the game's music registry
  (copies of a real song's asset with their own artist and title), so no
  game song is borrowed or renamed to list a track.

Spotify
- The game is a Spotify Connect device ("ReSkate"), built on librespot
  and linked into ReSkate.dll (SpotifyHelper/, Rust). Audio, track info
  and controls come straight from Spotify. Needs Premium.
- Optional sign-in through the Web API lists the player's playlists and
  Liked Songs as tiles with their tracks.
- librespot can no longer end the process (it does so on a free account
  and on playback errors); only its thread is stopped.

YouTube Music
- Videos and playlists added by link. yt-dlp is fetched on request into
  <Local AppData>\ReSkate\bin and checked against its published sums;
  decoding is done in the DLL, so no ffmpeg.
- Private and age-restricted songs: cookies.txt or a browser's sign-in,
  with QuickJS fetched as the JavaScript runtime yt-dlp then needs
  (Node.js is used instead when installed).

External Audio
- Any app's sound, captured per process from Windows, with the app's own
  output turned down while it plays through the game.

Setup page
- "spotify setup" opens http://127.0.0.1:8421/: device status, sign-ins,
  YouTube links and tools, the external app, loudness. Loopback only;
  changes are accepted from its own page only.

Also
- Speakers in the world play the tile's audio; grabbing one keeps the
  player on their tile.
- Playlists added while the game runs are sent to the music screen live.
- MUSIC-SETUP.md: setup guide for players.

Building the Spotify device and the YouTube decoder needs cargo; without
it ReSkate.dll builds without them.
2026-10-12 03:16:36 -05:00
AyeZeeBB aa08050c8b Music: Favorites takes playlist 0 on the music player's channels only
The Favorites order fix gave Favorites to any channel that asked for
playlist 0. That is what the music player asks for when Favorites is
chosen, but nothing said another channel could not ask for 0 and mean
something else. The channels the music player's own queues pick songs
for are now remembered as they are seen, and only those are given
Favorites for 0; on any other channel the request goes through as it
came. The channel numbers are still the game's: none is written down.

A channel's binding was logged once per change, except for a channel
past the end of the table, which was logged on every call. Those are no
longer logged at all. The binding line now says whether the channel is
one of the music player's.

The hook on the game's candidate check is removed, with its address: it
changed nothing and only logged.
2026-10-11 10:59:08 -05:00
DeckardDetribine 63b747fd4a fix(music): play favorites sequentially in visible order 2026-10-11 11:32:30 +01:00
DeckardDetribine 4312a08111 fix(music): persist favorites and playlist likes 2026-10-10 17:03:08 +01:00
zeex64 f787733b5c Merge pull request #87 from DeckardDetribine/feature/music-playback-order
Music: preserve playlist order and add a Shuffle option
2026-10-06 16:49:52 -05:00
DeckardDetribine e0b9367e71 fix(music): reload artwork beyond the cache budget 2026-10-06 17:47:06 +01:00
ReSkate local d264ac778c Music: add playlist-order playback toggle 2026-10-06 03:26:37 +01:00
ReSkate local 3db1ef7ca5 Music: release Mods shelf before map unloading 2026-10-06 02:07:26 +01:00
zeex64 2c80bf1b8c Merge branch 'main' into fix/playlist-lookup-crash-guard 2026-10-05 17:00:52 -05:00
zeex64 9f9d611f7d Merge pull request #56 from DeckardDetribine/pr/mod-music-shelf
Music: add a native "Mods" shelf above Featured in the Music Player / Playlist Manager.
2026-10-05 17:00:01 -05:00
ReSkate local bf89ea7038 Music: preserve authored track positioning in mod playlists 2026-10-05 10:53:31 +01:00
ReSkate local 88e033b33f Music: skip the Mods shelf when no mod declares a playlist
Build the Mods shelf only when an enabled mod declares at least one playlist with songs, read from each mod's reskate-music.json. The shelf must be inserted before the native widgets bind, so it cannot wait for Featured rows to hydrate, and it should not publish an empty shelf when there is nothing to show. With no declared mod playlist the native three shelves are left as they are and a music_mods_shelf_skipped event is logged.
2026-10-05 06:51:05 +01:00
ReSkate local 2e6882ede1 Music: guard the playlist lookup against unresolved song entries
The music player's playlist walk loads a song entry, masks it and reads a flag at [rcx+0x14] before it checks the entry's identity. An unresolved or NULL entry makes that read fault and takes the game down while a playlist is built or opened.

Install a 13-byte in-place guard at the reviewed RVA 0x14f80c7 when the music contracts pass. It keeps the original flag test, shrinks the leading mov eax,0 to xor eax,eax, and adds a jrcxz that skips the dereference when the entry is NULL, landing on the loop increment. The site is matched against its contract bytes before anything is written, so an unsupported image is left untouched, and the guard is applied with VirtualProtect and FlushInstructionCache and then made read-only again.

The contract and patch bytes live with the other music contracts in Engine/Game/Build/20260929/local_music.h; the installer is Extension/Music/local_music_safety.{h,cpp}; local_music_ui.cpp invokes it from initialize_music_functions; cmake/Runtime.cmake builds it. A new dingosdk_music_safety_tests (CTest music_safety) pins the contract length, the decoded instructions and the branch target arithmetic without needing the game.
2026-10-05 06:31:13 +01:00
ReSkate local d4d3549799 Music: keep shelf code out of playlist UI module 2026-10-05 05:21:21 +01:00
ReSkate local 96cd684e20 Music: isolate native shelf implementation 2026-10-05 05:20:49 +01:00
ReSkate local 916e281e69 Music: preserve artwork insertion context 2026-10-05 05:15:17 +01:00
ReSkate local 81f3a77a25 Music: isolate shelf helpers from artwork UI hunk 2026-10-05 05:15:06 +01:00
ReSkate local e145a67db9 Music: add a native Mods shelf above Featured
Create independent anchored and tile-list models before native widget binding.
Populate Mods from Featured rows with mod playlist IDs while retaining native
presentation and actions. Leave existing playlist contexts and cosmetic
ownership unchanged.

Document the native UI model flow, verified loader entry points, typed
publication, and inspection workflow for future modders.
2026-10-05 05:04:37 +01:00
ReSkate localandClaude Sonnet 5.5 702e5c74d2 Music: serve mod cover artwork over HTTP/2 cleartext
The game fetches the artwork URL with HTTP/2 cleartext (h2c, prior knowledge), and only from 127.0.0.1. The loopback server spoke HTTP/1.1, so every cover request was answered with an HTTP/1.1 404 and mod playlist/song covers never appeared.

Speak h2c: complete the SETTINGS handshake, read the request header block (HEADERS and CONTINUATION frames), decode :path with a minimal HPACK decoder (static table and Huffman code from RFC 7541 in hpack_tables.h), and serve the matching image as HEADERS plus DATA frames with flow control. Keep the HTTP/1.1 path for other clients. Serve from one stable origin (http://127.0.0.1:47823/music-art/<mod>/<relative>) so the game's HTTP cache is reused, send Cache-Control and an ETag so it stops re-fetching, close gracefully (closing with unread frames queued makes Windows send RST and the client drops the tail), and use a non-blocking listener since several pollers share it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 00:09:51 +01:00
ReSkate local 5a01b1b0de Music: support custom playlist and song cover artwork in mods 2026-10-05 00:09:41 +01:00
DeckardDetribineandClaude Opus 5.5 c7f54b7680 Music: let a mod name a playlist for its songs
A mod that adds songs can ship reskate-music.json
({"schema":1,"playlists":[{"name","songs":["artist - title", ...]}]}). Each
playlist is merged into the game's music screen the way a content-cache
station is, under the id "mod:<mod folder>:<name>", with its songs matched
against the songs the game has registered; entries that match nothing are
ignored and a playlist left empty is dropped. A file of the wrong shape is
logged and skipped.

The file is read by parse_music_playlists in Engine/Vfs/mod_music, which a new
test covers (ids, which entries survive, the limits, and that a malformed
document is refused). The format is described in the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-04 18:12:42 +01:00
DeckardDetribineandClaude Opus 5.5 855e84993a Music: give songs their cover art from the content cache
Song records in the content cache carry a field-10 message (10 artist, 11 title,
12 cdn:/ cover art). Read the art per song and send it as the song's
presentation field 12, resolved to the CDN rendition like a station's art, so
the game's music screen and now-playing toast show covers instead of a black
square. The catalogue test pins one song's art.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-04 18:12:42 +01:00
DeckardDetribineandClaude Sonnet 5.5 2e8bb57d9e Music: show the stations the content cache defines, with their names and art
The music menu listed only the playlists the game's own music assets declare.
The licensed stations (San Van Soundtrack, 80's Mixtape, ...) live in the
content cache's music chunk: a record with the station id (field 1), its tracks
(repeated field 2, "Artist - Title") and a message with its display name and
cdn:/ artwork (field 10, parts 10 and 11). Read them into Catalogs, merge their
membership into the music catalogue (only songs the game registered, so no
unknown id is referenced), and send the name and artwork with each playlist.

The catalogue test pins two stations from the cache.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-04 18:12:42 +01:00
AyeZeeBB ca1d82f636 1.0.0 Release! 2026-10-02 14:40:41 -05:00