Commit eb43a5c8 authored by nanahira's avatar nanahira

lint

parent cfb22b15
Pipeline #43204 passed with stages
in 48 seconds
...@@ -15,8 +15,10 @@ export const TRANSLATIONS = { ...@@ -15,8 +15,10 @@ export const TRANSLATIONS = {
left_game: 'quited game', left_game: 'quited game',
disconnect_from_game: 'disconnected from the game', disconnect_from_game: 'disconnected from the game',
reconnect_to_game: 'reconnected to the game', reconnect_to_game: 'reconnected to the game',
reconnect_kicked: "You are kicked out because you're logged in on other devices.", reconnect_kicked:
pre_reconnecting_to_room: 'You will be reconnected to your previous game. Please pick your previous deck.', "You are kicked out because you're logged in on other devices.",
pre_reconnecting_to_room:
'You will be reconnected to your previous game. Please pick your previous deck.',
deck_incorrect_reconnect: 'Please pick your previous deck.', deck_incorrect_reconnect: 'Please pick your previous deck.',
reconnect_failed: 'Reconnect failed.', reconnect_failed: 'Reconnect failed.',
reconnecting_to_room: 'Reconnecting to server...', reconnecting_to_room: 'Reconnecting to server...',
...@@ -37,7 +39,8 @@ export const TRANSLATIONS = { ...@@ -37,7 +39,8 @@ export const TRANSLATIONS = {
disconnect_from_game: '断开了连接', disconnect_from_game: '断开了连接',
reconnect_to_game: '重新连接了', reconnect_to_game: '重新连接了',
reconnect_kicked: '你的账号已经在其他设备登录,你被迫下线。', reconnect_kicked: '你的账号已经在其他设备登录,你被迫下线。',
pre_reconnecting_to_room: '你有未完成的对局,即将重新连接,请选择你在本局决斗中使用的卡组并准备。', pre_reconnecting_to_room:
'你有未完成的对局,即将重新连接,请选择你在本局决斗中使用的卡组并准备。',
deck_incorrect_reconnect: '请选择你在本局决斗中使用的卡组。', deck_incorrect_reconnect: '请选择你在本局决斗中使用的卡组。',
reconnect_failed: '重新连接失败。', reconnect_failed: '重新连接失败。',
reconnecting_to_room: '正在重新连接到服务器……', reconnecting_to_room: '正在重新连接到服务器……',
......
...@@ -17,7 +17,10 @@ export class PlayerStatusNotify { ...@@ -17,7 +17,10 @@ export class PlayerStatusNotify {
const room = event.room; const room = event.room;
if (client.pos === NetPlayerType.OBSERVER) { if (client.pos === NetPlayerType.OBSERVER) {
// 观战者离开 // 观战者离开
await room.sendChat(`${client.name} #{quit_watch}`, ChatColor.LIGHTBLUE); await room.sendChat(
`${client.name} #{quit_watch}`,
ChatColor.LIGHTBLUE,
);
} else { } else {
// 玩家离开 // 玩家离开
await room.sendChat(`${client.name} #{left_game}`, ChatColor.LIGHTBLUE); await room.sendChat(`${client.name} #{left_game}`, ChatColor.LIGHTBLUE);
......
...@@ -300,7 +300,7 @@ export class Reconnect { ...@@ -300,7 +300,7 @@ export class Reconnect {
// 清理旧客户端 // 清理旧客户端
oldClient.roomName = undefined; oldClient.roomName = undefined;
oldClient.pos = -1; oldClient.pos = -1;
// kick reconnect 的区别:通知旧客户端被踢(不 await) // kick reconnect 的区别:通知旧客户端被踢(不 await)
oldClient oldClient
.sendChat('#{reconnect_kicked}', ChatColor.RED) .sendChat('#{reconnect_kicked}', ChatColor.RED)
......
...@@ -32,7 +32,11 @@ import { OcgcoreWorkerOptions } from './ocgcore-worker-options'; ...@@ -32,7 +32,11 @@ import { OcgcoreWorkerOptions } from './ocgcore-worker-options';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { calculateDuelOptions } from '../utility/calculate-duel-options'; import { calculateDuelOptions } from '../utility/calculate-duel-options';
import initSqlJs from 'sql.js'; import initSqlJs from 'sql.js';
import { YGOProMessages, YGOProMsgResponseBase, YGOProMsgRetry } from 'ygopro-msg-encode'; import {
YGOProMessages,
YGOProMsgResponseBase,
YGOProMsgRetry,
} from 'ygopro-msg-encode';
const { OcgcoreScriptConstants } = _OcgcoreConstants; const { OcgcoreScriptConstants } = _OcgcoreConstants;
......
...@@ -6,7 +6,11 @@ export const canIncreaseTime = (gameMsg: number, response?: Buffer) => { ...@@ -6,7 +6,11 @@ export const canIncreaseTime = (gameMsg: number, response?: Buffer) => {
case OcgcoreCommonConstants.MSG_SELECT_UNSELECT_CARD: case OcgcoreCommonConstants.MSG_SELECT_UNSELECT_CARD:
return false; return false;
case OcgcoreCommonConstants.MSG_SELECT_CHAIN: case OcgcoreCommonConstants.MSG_SELECT_CHAIN:
return response != null && response.length >= 4 && response.readInt32LE(0) !== -1; return (
response != null &&
response.length >= 4 &&
response.readInt32LE(0) !== -1
);
case OcgcoreCommonConstants.MSG_SELECT_IDLECMD: { case OcgcoreCommonConstants.MSG_SELECT_IDLECMD: {
if (response == null || response.length < 4) { if (response == null || response.length < 4) {
return false; return false;
......
...@@ -7,4 +7,3 @@ import { ...@@ -7,4 +7,3 @@ import {
export const isUpdateMessage = (message: YGOProMsgBase) => export const isUpdateMessage = (message: YGOProMsgBase) =>
message instanceof YGOProMsgUpdateData || message instanceof YGOProMsgUpdateData ||
message instanceof YGOProMsgUpdateCard; message instanceof YGOProMsgUpdateCard;
...@@ -46,4 +46,3 @@ export const shuffleDecksBySeed = (decks: YGOProDeck[], seed: number[]) => { ...@@ -46,4 +46,3 @@ export const shuffleDecksBySeed = (decks: YGOProDeck[], seed: number[]) => {
return cloned; return cloned;
}); });
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment