Skip to content

Commit

Permalink
enhance(reversi): tweak reversi
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo authored and AyumuNekozuki committed Feb 16, 2024
1 parent 6acd9a6 commit 17ed5f2
Show file tree
Hide file tree
Showing 19 changed files with 395 additions and 135 deletions.
11 changes: 11 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ export interface Locale extends ILocale {
* 添付取り消し
*/
"attachCancel": string;
/**
* ファイルを削除
*/
"deleteFile": string;
/**
* センシティブとして設定
Expand Down Expand Up @@ -9482,6 +9485,10 @@ export interface Locale extends ILocale {
* 投了により
*/
"surrendered": string;
/**
* 時間切れ
*/
"timeout": string;
/**
* 引き分け
*/
Expand Down Expand Up @@ -9534,6 +9541,10 @@ export interface Locale extends ILocale {
* どこでも置けるモード
*/
"canPutEverywhere": string;
/**
* 1ターンの時間制限
*/
"timeLimitForEachTurn": string;
/**
* フリーマッチ
*/
Expand Down
2 changes: 2 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,7 @@ _reversi:
pastTurnOf: "{name}のターン"
surrender: "投了"
surrendered: "投了により"
timeout: "時間切れ"
drawn: "引き分け"
won: "{name}の勝ち"
black: ""
Expand All @@ -2540,5 +2541,6 @@ _reversi:
isLlotheo: "石の少ない方が勝ち(ロセオ)"
loopedMap: "ループマップ"
canPutEverywhere: "どこでも置けるモード"
timeLimitForEachTurn: "1ターンの時間制限"
freeMatch: "フリーマッチ"
lookingForPlayer: "対戦相手を探しています"
18 changes: 18 additions & 0 deletions packages/backend/migration/1705793785675-reversi-3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* SPDX-FileCopyrightText: syuilo and other misskey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class Reversi31705793785675 {
name = 'Reversi31705793785675'

async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "reversi_game" RENAME COLUMN "surrendered" TO "surrenderedUserId"`);
await queryRunner.query(`ALTER TABLE "reversi_game" ADD "timeoutUserId" character varying(32)`);
}

async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "reversi_game" DROP COLUMN "timeoutUserId"`);
await queryRunner.query(`ALTER TABLE "reversi_game" RENAME COLUMN "surrenderedUserId" TO "surrendered"`);
}
}
18 changes: 18 additions & 0 deletions packages/backend/migration/1705794768153-reversi-4.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* SPDX-FileCopyrightText: syuilo and other misskey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class Reversi41705794768153 {
name = 'Reversi41705794768153'

async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "reversi_game" ADD "endedAt" TIMESTAMP WITH TIME ZONE`);
await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."endedAt" IS 'The ended date of the ReversiGame.'`);
}

async down(queryRunner) {
await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."endedAt" IS 'The ended date of the ReversiGame.'`);
await queryRunner.query(`ALTER TABLE "reversi_game" DROP COLUMN "endedAt"`);
}
}
16 changes: 16 additions & 0 deletions packages/backend/migration/1705798904141-reversi-5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: syuilo and other misskey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class Reversi51705798904141 {
name = 'Reversi51705798904141'

async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "reversi_game" ADD "timeLimitForEachTurn" smallint NOT NULL DEFAULT '90'`);
}

async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "reversi_game" DROP COLUMN "timeLimitForEachTurn"`);
}
}
3 changes: 0 additions & 3 deletions packages/backend/src/core/GlobalEventService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ export interface ReversiGameEventTypes {
value: any;
};
log: Reversi.Serializer.Log & { id: string | null };
heatbeat: {
userId: MiUser['id'];
};
started: {
game: Packed<'ReversiGameDetailed'>;
};
Expand Down
Loading

0 comments on commit 17ed5f2

Please sign in to comment.