From 60156a40b2984c320eaf9ddb0c7704d1f8e40f93 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 24 Jan 2024 16:44:12 +0900 Subject: [PATCH 1/6] fix(reversi/backend): refactor and fixes --- packages/backend/src/core/ReversiService.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/core/ReversiService.ts b/packages/backend/src/core/ReversiService.ts index 84721b2217..186ec6d7b1 100644 --- a/packages/backend/src/core/ReversiService.ts +++ b/packages/backend/src/core/ReversiService.ts @@ -120,7 +120,9 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { if (invitations.includes(targetUser.id)) { await this.redisClient.zrem(`reversi:matchSpecific:${me.id}`, targetUser.id); - const game = await this.matched(targetUser.id, me.id); + const game = await this.matched(targetUser.id, me.id, { + noIrregularRules: false, + }); return game; } @@ -166,7 +168,9 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { const invitorId = invitations[Math.floor(Math.random() * invitations.length)]; await this.redisClient.zrem(`reversi:matchSpecific:${me.id}`, invitorId); - const game = await this.matched(invitorId, me.id); + const game = await this.matched(invitorId, me.id, { + noIrregularRules: false, + }); return game; } @@ -214,10 +218,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit { @bindThis public async matchAnyUserCancel(user: MiUser) { - const redisPipeline = this.redisClient.pipeline(); - redisPipeline.zrem('reversi:matchAny', user.id); - redisPipeline.zrem('reversi:matchAny', user.id + ':noIrregularRules'); - await redisPipeline.exec(); + await this.redisClient.zrem('reversi:matchAny', user.id, user.id + ':noIrregularRules'); } @bindThis From 4de14fb5cf8c0aa2078ebbedc242a65e042ded54 Mon Sep 17 00:00:00 2001 From: Srgr0 <66754887+Srgr0@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:11:52 +0900 Subject: [PATCH 2/6] Create deploy-test-environment.yml (#13079) --- .github/workflows/deploy-test-environment.yml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/deploy-test-environment.yml diff --git a/.github/workflows/deploy-test-environment.yml b/.github/workflows/deploy-test-environment.yml new file mode 100644 index 0000000000..cd7a8f328e --- /dev/null +++ b/.github/workflows/deploy-test-environment.yml @@ -0,0 +1,66 @@ +name: Deploy test environment + +on: + push: + workflow_dispatch: + inputs: + repository: + description: 'Repository to deploy (optional)' + required: false + branch: + description: 'Branch to deploy (optional)' + required: false + +jobs: + deploy-test-environment: + runs-on: ubuntu-latest + steps: + - name: Set environment variable (for tput command & pnpm) + run: | + echo "TERM=xterm" >> $GITHUB_ENV + REPOSITORY=${{ github.event.inputs.repository || github.repository }} + echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV + BRANCH=${{ github.event.inputs.branch || github.ref_name }} + echo "BRANCH=$BRANCH" >> $GITHUB_ENV + + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ env.REPOSITORY }} + ref: ${{ env.BRANCH }} + + - name: Get the latest commit SHA + run: | + SHA=$(git log -1 --format="%H") + echo "SHA=$SHA" >> $GITHUB_ENV + + - name: Start cloudflare tunnel (quick) + run: | + wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb + sudo dpkg -i cloudflared-linux-amd64.deb + sudo cloudflared tunnel --metrics localhost:55555 --url localhost:3000 > /dev/null 2>&1 & + sleep 15 + TUNNEL_RESPONSE=$(curl http://localhost:55555/quicktunnel) + TUNNEL_DOMAIN=$(echo $TUNNEL_RESPONSE | grep -o '"hostname":"[^"]*' | grep -o '[^"]*$') + echo "::add-mask::$TUNNEL_DOMAIN" + echo "TUNNEL_DOMAIN=$TUNNEL_DOMAIN" >> $GITHUB_ENV + + - name: Install misskey + run: | + wget https://raw.githubusercontent.com/joinmisskey/bash-install/v4/misskey-install.sh + wget https://raw.githubusercontent.com/joinmisskey/bash-install/v4/testenv_githubactions.txt + sed -i "s/host=127.0.0.1/host=$TUNNEL_DOMAIN/g" testenv_githubactions.txt + sed -i "s|git_repository=https://github.com/misskey-dev/misskey|git_repository=https://github.com/$REPOSITORY|g" testenv_githubactions.txt + sed -i "s|git_branch=master|git_branch=$BRANCH|g" testenv_githubactions.txt + sudo chmod 555 ./misskey-install.sh + sudo bash -x ./misskey-install.sh -c ./testenv_githubactions.txt + + - name: Post tunnel info to Discord + run: | + CURRENT_TIME=$(TZ=Asia/Tokyo date +'%Y-%m-%d %H:%M:%S JST') + COMMIT_URL="https://github.com/$REPOSITORY/commit/$SHA" + curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"==============================\nURL: https://$TUNNEL_DOMAIN\nRepository: $REPOSITORY\nBranch: $BRANCH\nCommit: $COMMIT_URL\nTime: $CURRENT_TIME\n==============================\"}" ${{ secrets.DISCORD_WEBHOOK_URL }} + + - name: Wait + run: | + timeout 3600 tail -f /var/log/syslog || true From b33cfc2876a6c4d3e1cb28c585a738ef0da59d25 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 24 Jan 2024 17:13:58 +0900 Subject: [PATCH 3/6] test From 4553d6426bfa6a54754d5cf477d04782d5e05860 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 24 Jan 2024 17:31:34 +0900 Subject: [PATCH 4/6] Revert "Create deploy-test-environment.yml (#13079)" This reverts commit 4de14fb5cf8c0aa2078ebbedc242a65e042ded54. --- .github/workflows/deploy-test-environment.yml | 66 ------------------- 1 file changed, 66 deletions(-) delete mode 100644 .github/workflows/deploy-test-environment.yml diff --git a/.github/workflows/deploy-test-environment.yml b/.github/workflows/deploy-test-environment.yml deleted file mode 100644 index cd7a8f328e..0000000000 --- a/.github/workflows/deploy-test-environment.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Deploy test environment - -on: - push: - workflow_dispatch: - inputs: - repository: - description: 'Repository to deploy (optional)' - required: false - branch: - description: 'Branch to deploy (optional)' - required: false - -jobs: - deploy-test-environment: - runs-on: ubuntu-latest - steps: - - name: Set environment variable (for tput command & pnpm) - run: | - echo "TERM=xterm" >> $GITHUB_ENV - REPOSITORY=${{ github.event.inputs.repository || github.repository }} - echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV - BRANCH=${{ github.event.inputs.branch || github.ref_name }} - echo "BRANCH=$BRANCH" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@v4 - with: - repository: ${{ env.REPOSITORY }} - ref: ${{ env.BRANCH }} - - - name: Get the latest commit SHA - run: | - SHA=$(git log -1 --format="%H") - echo "SHA=$SHA" >> $GITHUB_ENV - - - name: Start cloudflare tunnel (quick) - run: | - wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb - sudo dpkg -i cloudflared-linux-amd64.deb - sudo cloudflared tunnel --metrics localhost:55555 --url localhost:3000 > /dev/null 2>&1 & - sleep 15 - TUNNEL_RESPONSE=$(curl http://localhost:55555/quicktunnel) - TUNNEL_DOMAIN=$(echo $TUNNEL_RESPONSE | grep -o '"hostname":"[^"]*' | grep -o '[^"]*$') - echo "::add-mask::$TUNNEL_DOMAIN" - echo "TUNNEL_DOMAIN=$TUNNEL_DOMAIN" >> $GITHUB_ENV - - - name: Install misskey - run: | - wget https://raw.githubusercontent.com/joinmisskey/bash-install/v4/misskey-install.sh - wget https://raw.githubusercontent.com/joinmisskey/bash-install/v4/testenv_githubactions.txt - sed -i "s/host=127.0.0.1/host=$TUNNEL_DOMAIN/g" testenv_githubactions.txt - sed -i "s|git_repository=https://github.com/misskey-dev/misskey|git_repository=https://github.com/$REPOSITORY|g" testenv_githubactions.txt - sed -i "s|git_branch=master|git_branch=$BRANCH|g" testenv_githubactions.txt - sudo chmod 555 ./misskey-install.sh - sudo bash -x ./misskey-install.sh -c ./testenv_githubactions.txt - - - name: Post tunnel info to Discord - run: | - CURRENT_TIME=$(TZ=Asia/Tokyo date +'%Y-%m-%d %H:%M:%S JST') - COMMIT_URL="https://github.com/$REPOSITORY/commit/$SHA" - curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"==============================\nURL: https://$TUNNEL_DOMAIN\nRepository: $REPOSITORY\nBranch: $BRANCH\nCommit: $COMMIT_URL\nTime: $CURRENT_TIME\n==============================\"}" ${{ secrets.DISCORD_WEBHOOK_URL }} - - - name: Wait - run: | - timeout 3600 tail -f /var/log/syslog || true From ef8eaf8e8958f283bf1e82d38207f5ad53a31311 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 24 Jan 2024 20:29:05 +0900 Subject: [PATCH 5/6] New Crowdin updates (#13080) * New translations ja-jp.yml (Chinese Traditional) * New translations ja-jp.yml (Chinese Traditional) --- locales/zh-TW.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 6c183fe75c..59f2ed6d2d 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -2482,6 +2482,11 @@ _reversi: freeMatch: "自由對戰" lookingForPlayer: "正在搜尋對手" gameCanceled: "對弈已被取消" + shareToTlTheGameWhenStart: "在遊戲開始時將對弈資訊發布到時間軸" + iStartedAGame: "對弈開始了! #MisskeyReversi" + opponentHasSettingsChanged: "對手更改了設定" + allowIrregularRules: "允許異常規則(完全自由)" + disallowIrregularRules: "不允許異常規則" _offlineScreen: title: "離線-無法連接伺服器" header: "無法連接伺服器" From 5342692b1e9b2b96d5b87668151c3d06298db742 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 24 Jan 2024 20:31:05 +0900 Subject: [PATCH 6/6] 2024.2.0-beta.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 16f2fdda43..77c7b92270 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2024.2.0-beta.6", + "version": "2024.2.0-beta.7", "codename": "nasubi", "repository": { "type": "git",