Skip to content

Commit

Permalink
修复更新配置时无法更新当前玩家配置
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperzlib committed Jul 27, 2024
1 parent 9c87474 commit 11269c2
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@hyperzlib/node-reactive-config": "^1.0.1",
"@lemonce3/mitm": "^0.8.2",
"@pondwader/socks5-server": "^1.0.10",
"@types/tampermonkey": "^5.0.3",
"@ungap/structured-clone": "^1.2.0",
"ajv": "^8.17.1",
"chalk": "4",
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion server/coyote/CoyoteController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export class CoyoteController {
public setConfig(config: CoyoteGameConfig) {
const currentConfig = config.find((item) => {
return item.account_id === this.targetPlayer.account_id ||
item.nickname === this.targetPlayer.nickname
item.nickname === this.targetPlayer.nickname ||
item.isMe && this.targetPlayer.isMe;
});
if (!currentConfig) {
logger.error(`未找到 ${this.targetPlayer.nickname} 的配置`);
Expand Down
2 changes: 2 additions & 0 deletions server/gameRecords/Game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface GamePlayerInfo {
account_id: number,
nickname: string,
seat: number,
isMe?: boolean,
};

export interface GameConstructorOptions {
Expand All @@ -22,6 +23,7 @@ export class Game {
account_id: player.account_id,
nickname: player.nickname,
seat: seatList.indexOf(player.account_id),
isMe: player.account_id === meAccountId,
}
});

Expand Down
Empty file.
Empty file added server/http/router.ts
Empty file.
2 changes: 1 addition & 1 deletion server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (!existsSync('config.json5')) {

const config = new ReactiveConfig<ConfigType>('config.json5', {
coyote: []
})
}, { autoInit: false })

config.setLoadFilter((value: any) => {
if (!validator.validateConfig(value)) {
Expand Down

0 comments on commit 11269c2

Please sign in to comment.