feat(robot): per-game display names from a wide name corpus
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 48s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m10s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 48s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m10s
Decouple the displayed opponent name from the small pool of durable robot accounts: the disguised auto-match robot now gets a freshly composed name each game, stamped on a new game_players.display_name seat snapshot. The snapshot also captures humans' names, freezing what an opponent sees for the life of a game (a later rename no longer rewrites past games); readers fall back to the account's current name for pre-migration rows. Names come from a wide composed corpus (internal/robot/namevariety.go): Western locales (EN/DE/ES/IT/FR/PT), native Japanese/Chinese names, a gender-agreed Russian pool, and human-style handles. Routing keeps Pick's spirit -- a Russian game draws Cyrillic + <=20% Latin and never a CJK script; an English game the full corpus -- via robot.PickNamed. Loosen account.ValidateDisplayName (and the UI mirror) to admit a trailing run of up to five digits, so "Player2007"-style handles are valid for humans too and the disguised robot stays indistinguishable. Migration 00007 adds game_players.display_name (additive, NOT NULL DEFAULT ''); jet regenerated. Docs (ARCHITECTURE 7, FUNCTIONAL + _ru, PLAN, README) updated.
This commit is contained in:
@@ -12,10 +12,11 @@ import (
|
||||
)
|
||||
|
||||
type GamePlayers struct {
|
||||
GameID uuid.UUID `sql:"primary_key"`
|
||||
Seat int16 `sql:"primary_key"`
|
||||
AccountID *uuid.UUID
|
||||
Score int32
|
||||
HintsUsed int16
|
||||
IsWinner bool
|
||||
GameID uuid.UUID `sql:"primary_key"`
|
||||
Seat int16 `sql:"primary_key"`
|
||||
AccountID *uuid.UUID
|
||||
Score int32
|
||||
HintsUsed int16
|
||||
IsWinner bool
|
||||
DisplayName string
|
||||
}
|
||||
|
||||
@@ -17,12 +17,13 @@ type gamePlayersTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
GameID postgres.ColumnString
|
||||
Seat postgres.ColumnInteger
|
||||
AccountID postgres.ColumnString
|
||||
Score postgres.ColumnInteger
|
||||
HintsUsed postgres.ColumnInteger
|
||||
IsWinner postgres.ColumnBool
|
||||
GameID postgres.ColumnString
|
||||
Seat postgres.ColumnInteger
|
||||
AccountID postgres.ColumnString
|
||||
Score postgres.ColumnInteger
|
||||
HintsUsed postgres.ColumnInteger
|
||||
IsWinner postgres.ColumnBool
|
||||
DisplayName postgres.ColumnString
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
@@ -64,27 +65,29 @@ func newGamePlayersTable(schemaName, tableName, alias string) *GamePlayersTable
|
||||
|
||||
func newGamePlayersTableImpl(schemaName, tableName, alias string) gamePlayersTable {
|
||||
var (
|
||||
GameIDColumn = postgres.StringColumn("game_id")
|
||||
SeatColumn = postgres.IntegerColumn("seat")
|
||||
AccountIDColumn = postgres.StringColumn("account_id")
|
||||
ScoreColumn = postgres.IntegerColumn("score")
|
||||
HintsUsedColumn = postgres.IntegerColumn("hints_used")
|
||||
IsWinnerColumn = postgres.BoolColumn("is_winner")
|
||||
allColumns = postgres.ColumnList{GameIDColumn, SeatColumn, AccountIDColumn, ScoreColumn, HintsUsedColumn, IsWinnerColumn}
|
||||
mutableColumns = postgres.ColumnList{AccountIDColumn, ScoreColumn, HintsUsedColumn, IsWinnerColumn}
|
||||
defaultColumns = postgres.ColumnList{ScoreColumn, HintsUsedColumn, IsWinnerColumn}
|
||||
GameIDColumn = postgres.StringColumn("game_id")
|
||||
SeatColumn = postgres.IntegerColumn("seat")
|
||||
AccountIDColumn = postgres.StringColumn("account_id")
|
||||
ScoreColumn = postgres.IntegerColumn("score")
|
||||
HintsUsedColumn = postgres.IntegerColumn("hints_used")
|
||||
IsWinnerColumn = postgres.BoolColumn("is_winner")
|
||||
DisplayNameColumn = postgres.StringColumn("display_name")
|
||||
allColumns = postgres.ColumnList{GameIDColumn, SeatColumn, AccountIDColumn, ScoreColumn, HintsUsedColumn, IsWinnerColumn, DisplayNameColumn}
|
||||
mutableColumns = postgres.ColumnList{AccountIDColumn, ScoreColumn, HintsUsedColumn, IsWinnerColumn, DisplayNameColumn}
|
||||
defaultColumns = postgres.ColumnList{ScoreColumn, HintsUsedColumn, IsWinnerColumn, DisplayNameColumn}
|
||||
)
|
||||
|
||||
return gamePlayersTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
GameID: GameIDColumn,
|
||||
Seat: SeatColumn,
|
||||
AccountID: AccountIDColumn,
|
||||
Score: ScoreColumn,
|
||||
HintsUsed: HintsUsedColumn,
|
||||
IsWinner: IsWinnerColumn,
|
||||
GameID: GameIDColumn,
|
||||
Seat: SeatColumn,
|
||||
AccountID: AccountIDColumn,
|
||||
Score: ScoreColumn,
|
||||
HintsUsed: HintsUsedColumn,
|
||||
IsWinner: IsWinnerColumn,
|
||||
DisplayName: DisplayNameColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
|
||||
Reference in New Issue
Block a user