Skip to content

Added support for Casual and Wingman games.#7

Open
LucasionGS wants to merge 17 commits into
davidaf3:masterfrom
LucasionGS:master
Open

Added support for Casual and Wingman games.#7
LucasionGS wants to merge 17 commits into
davidaf3:masterfrom
LucasionGS:master

Conversation

@LucasionGS

@LucasionGS LucasionGS commented May 15, 2025

Copy link
Copy Markdown

Here's support for the two other round-based gamemode.

Noteworthy changes:

  • Support for separated Competitive, Wingman, and casual stats with the click of a select in the Nav bar
  • Prettified name system for modes as Wingman has a strange machine name
  • Default image for when a map doesn't have a bundled image
  • TypeScript as a dependency, as before it relied on having it installed globally
  • Changed script and CFG to use 127.0.0.1 over localhost for more reliability
  • Added tray functionality to easily run the app in the background, without rendering the window. (Triggered on close, reopenable through tray)
    • When in the tray mode, the window isn't running and will be recreated entirely on reopen. This is to minimize resource use.

I tried to follow your coding patterns. Hope it can be used :)

@davidaf3 davidaf3 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for those minor comments, everything LGTM. Thank you for your contribution!

Comment thread restapi/models/match.ts
* 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
/**

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this double comment?

Comment thread restapi/package.json
"dependencies": {
"express": "^4.21.1",
"sqlite3": "^5.1.7",
"typescript": "*",

@davidaf3 davidaf3 Jun 24, 2025

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move typescript to devDependencies?

Comment thread restapi/routes/rgame.ts
} */
if (!currentMatch.over) {
// matchService.deleteMatch(currentMatch.id);
matchService.forceMatchEnd(currentMatch.id);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread restapi/routes/rmatch.ts
app.get('/match', async (_req, res) => {
try {
const matches = await matchService.findAll();
const mode = _req.query.mode as string || null;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scrimcomp2v2 just rolls off the tongue, hahaha

@LucasionGS

Copy link
Copy Markdown
Author

Except for those minor comments, everything LGTM. Thank you for your contribution!

I will look into resolving these soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants