Skip to content

Commit

Permalink
feat: add sign game whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
starudream committed May 27, 2024
1 parent 76d7013 commit 3bda01e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type Account struct {

Mid string `json:"mid" yaml:"mid"`
SToken string `json:"stoken" yaml:"stoken" table:",ignore"`

SignGameIds []string `json:"sign_game_ids" yaml:"sign_game_ids" table:",ignore"`
}

func AddAccount(account Account) {
Expand Down
5 changes: 5 additions & 0 deletions job/game.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ func SignGameRole(role *miyoushe.GameRole, account config.Account) (record SignG
return
}

if len(account.SignGameIds) > 0 && !slices.Contains(account.SignGameIds, gameId) {
slog.Warn("game id %s not in sign game ids", gameId)
return
}

game := miyoushe.AllGamesById[gameId]

record.GameId = gameId
Expand Down

0 comments on commit 3bda01e

Please sign in to comment.