···1919 id: text('id')
2020 .primaryKey()
2121 .$defaultFn(() => `gam_${randomUUID()}`),
2222- link_id: text('link_id'), // Four letters, similar to Jackbox
23222424- // Don't bother processing scores before this date:
2323+ name: text('name'),
2424+ winning_team: text('winning_team'),
2525+2626+ // Four letters, similar to a Jackbox invite code
2727+ link_id: text('link_id'),
2828+2929+ // The time the lobby started (or will start), so the game doesn't process scores set before this.
2530 start_time: integer('start_time', { mode: 'timestamp' }),
3131+ end_time: integer('end_time', { mode: 'timestamp' }),
26322733 // Settings
2828- // 0: Before starting, 1: In game, 2: Finished
3434+ // 0: Before starting, 1: In game, 2: Finished, 3: Final Showdown
2935 state: integer('state').default(0).notNull(),
3030- winning_team: text('winning_team'),
31363232- // Square Filling Settings
3333- min_sr: real('min_sr'),
3434- max_sr: real('max_sr'),
3535- min_length: real('min_length'),
3636- max_length: real('max_length'),
3737-3838- // Restrict users that can join
3939- min_rank: integer('min_rank'),
4040- max_rank: integer('max_rank'),
3737+ public: integer('public', { mode: 'boolean' }).notNull().default(true),
41384242- // Only takes effect when game state is 0.
3939+ // Whether or not players are allowed to pick their own team at the start of the game
4340 allow_team_switching: integer('allow_team_switching', { mode: 'boolean' }).default(true),
44414545- // What dictates whether a square is claimed. See more: `lib/server/claimworthy.ts`
4646- claim_condition: text('claim_condition').notNull().default('fc'),
4747- // How to sort scores for reclaims See more: `lib/server/get_best_score.ts`
4848- tiebreaker: text('tiebreaker').notNull().default('score'),
4949-5050- // Whether this game shows up in public listing
5151- public: integer('public', { mode: 'boolean' }).notNull().default(true),
4242+ // All other settings are stored in this json object (See the docs: https://notes.clxxiii.dev/1b23f4b9c82c800499bbd95c9fccbbab)
4343+ options: text('options').notNull().default(JSON.stringify({ min_sr: 4.0, max_sr: 5.0, min_length: 0, max_length: 200 })),
52445345 template_id: text('template_id').references(() => Template.id)
5446});
···199191 pool_id: text('pool_id').references(() => Mappool.id),
200192 map_id: integer('map_id').references(() => Map.id),
201193202202- required_mods: text('') // For tournament mappools and such
194194+ required_mods: text('required_mods') // For tournament mappools and such
203195});
204196205197/**
···285277 mods: text('mods').default(''),
286278 lazer: integer('lazer', { mode: 'boolean' }).notNull(),
287279288288- important: integer('important', {
289289- mode: 'boolean'
290290- }).default(false), // Whether this score appears as a notification
280280+ // Whether this score is sufficient to claim a square
281281+ claimworthy: integer('important', { mode: 'boolean' }).default(false),
282282+283283+ // Whether this score had an effect on the state on the board
284284+ // 0: No Change, 1: Claim, 2: Reclaim, 3: Win
285285+ claim: integer('claim').notNull().default(0),
291286292287 square_id: text('square_id')
293288 .notNull()
···331326 .notNull()
332327 .references(() => User.id),
333328 name: text('name'),
329329+ description: text('description'),
334330335331 data: text('data').notNull()
336332});