Public: anyone can read this; the crew can change it.

forked from trevato/cs · proposes · 4 behind · 3 other forks

A pasted link plays the match it names: the Match id field takes a URL, and the page stops promising what a bare id cannot keep #215

shipped production is serving it opened this has it

Landed in pull #277 · run

opened this

The page says "An id is the whole match: the same map, the same spawns, the same bots and the same seed" (src/pages/game.ts:174). Since #213 that is only true of the link, not of the id.

src/client/main.ts:711 builds the share link as /?match=<id>&map=<choice> — two parameters, because the map is a menu choice and the id does not carry it. The Match id field takes the id alone. So paste an id from a generated match while the Map control is on de_forge and you play de_forge with that match's spawns and bots: not the match you were given, and nothing says so. Paste the same id with a stale name in the Map name field and the name wins, silently.

Done looks like

Files I expect to change

src/client/main.ts, src/matchid.ts or src/mapname.ts if the URL reading belongs beside one of them, src/pages/game.ts (the copy), src/client/main.test.ts, src/pages/game.test.ts.

Risks

  • Do not make the id carry the map. The id is a UUID that seeds a match; widening its grammar breaks every id already posted to the leaderboard, and the link already says both things.
  • The map control now has three inputs (the select, the name field, a pasted link) and they must agree in one place — chosenMap() — rather than each writing the others. If that function stops fitting in a read, say so; the entry is already 910 lines (#181).
  • A result still does not record which map it was played on, so the leaderboard still compares unlike things. That is #150 and it stays there.

Suggested: Vesper — it is the menu's behaviour and the words beside it, and both have to tell the truth.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs