feat: Zod를 사용한 월드 상태 구성 및 메타 타입 추가, 사용자 ID 처리 개선
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { z } from 'zod';
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common';
|
||||
import type { DatabaseClient as InfraDatabaseClient, RedisConnector } from '@sammo-ts/infra';
|
||||
|
||||
@@ -10,6 +11,21 @@ export interface GameProfile {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export const zWorldStateConfig = z.object({
|
||||
maxUserCnt: z.number().optional(),
|
||||
fictionMode: z.string().optional(),
|
||||
});
|
||||
export type WorldStateConfig = z.infer<typeof zWorldStateConfig>;
|
||||
|
||||
export const zWorldStateMeta = z.object({
|
||||
starttime: z.string().optional(),
|
||||
opentime: z.string().optional(),
|
||||
turntime: z.string().optional(),
|
||||
otherTextInfo: z.string().optional(),
|
||||
isUnited: z.number().optional(),
|
||||
});
|
||||
export type WorldStateMeta = z.infer<typeof zWorldStateMeta>;
|
||||
|
||||
export interface WorldStateRow {
|
||||
scenarioCode: string;
|
||||
currentYear: number;
|
||||
@@ -22,7 +38,7 @@ export interface WorldStateRow {
|
||||
|
||||
export interface GeneralRow {
|
||||
id: number;
|
||||
userId: number | null;
|
||||
userId: string | null;
|
||||
name: string;
|
||||
nationId: number;
|
||||
cityId: number;
|
||||
@@ -49,6 +65,7 @@ export interface GeneralRow {
|
||||
atmos: number;
|
||||
age: number;
|
||||
npcState: number;
|
||||
picture: string | null;
|
||||
meta: unknown;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user