Added support for Casual and Wingman games.#7
Conversation
- Added TypeScript as a dependency in both package.json files. - Updated game event handling in rgame.ts to use destructured body from request. - Changed localhost URI to 127.0.0.1 in gamestate_integration_stats.cfg. - TODO: Need to fix new game starting at the end of a game
…witcher in the navbar
davidaf3
left a comment
There was a problem hiding this comment.
Except for those minor comments, everything LGTM. Thank you for your contribution!
| * Gets all matches for a specific game mode, ordered by date | ||
| * @param mode the game mode to filter by | ||
| * @return promise that resolves to the list of matches | ||
| /** |
There was a problem hiding this comment.
Can you remove this double comment?
| "dependencies": { | ||
| "express": "^4.21.1", | ||
| "sqlite3": "^5.1.7", | ||
| "typescript": "*", |
There was a problem hiding this comment.
Can you move typescript to devDependencies?
| } */ | ||
| if (!currentMatch.over) { | ||
| // matchService.deleteMatch(currentMatch.id); | ||
| matchService.forceMatchEnd(currentMatch.id); |
There was a problem hiding this comment.
This can cause issues if the user leaves the match and rejoins later. If we force the match to end, a new match will be created when the user rejoins. If we keep the match running, the user will have to manually end the match through the UI, but we don't risk losing data.
| app.get('/match', async (_req, res) => { | ||
| try { | ||
| const matches = await matchService.findAll(); | ||
| const mode = _req.query.mode as string || null; |
There was a problem hiding this comment.
I had named _req with an underscore because I wasn't using the parameter, but now that we are using it, we can rename it to just req.
| /** | ||
| * Closes the current round | ||
| */ | ||
| export function closeCurrentRound(): void { |
There was a problem hiding this comment.
Are we using this function anywhere?
| @@ -0,0 +1,9 @@ | |||
| /** | |||
| * Used for prettier naming of gamemodes, since Wingman decided to be silly and get called scrimcomp2v2. | |||
There was a problem hiding this comment.
scrimcomp2v2 just rolls off the tongue, hahaha
I will look into resolving these soon! |
Here's support for the two other round-based gamemode.
Noteworthy changes:
I tried to follow your coding patterns. Hope it can be used :)