Skip to content

Commit

Permalink
games: Abbreviated game name in single player games
Browse files Browse the repository at this point in the history
  • Loading branch information
PartMan7 committed Jan 13, 2025
1 parent 09b54fe commit 6c45387
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ps/commands/games.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const gameCommands = Object.entries(Games).map(([_gameId, Game]): PSCommand => {
throw new ChatError($T('GAME.ALREADY_JOINED'));
}
}
const id = Game.meta.players === 'single' ? message.author.id : generateId();
const id = Game.meta.players === 'single' ? `${Game.meta.abbr}-${message.author.id}` : generateId();
const game = new Game.instance({ id, meta: Game.meta, room: message.target, $T, args, by: message.author });
if (game.meta.players === 'many') {
message.reply(`/notifyrank all, ${Game.meta.name}, A game of ${Game.meta.name} has been created!,${gameId}signup`);
Expand Down
1 change: 1 addition & 0 deletions src/ps/games/mastermind/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export const meta = {
id: GamesList.Mastermind,
aliases: ['mm'],
players: 'single',
abbr: 'mm',
} as const;

0 comments on commit 6c45387

Please sign in to comment.