fix: repair existing test failures
This commit is contained in:
@@ -301,6 +301,7 @@ const zNpcPossessGeneral = z
|
||||
ownerLegacyPenalty: zRecord.optional(),
|
||||
generalId: z.number().int().positive(),
|
||||
tokenNonce: z.number().int().nonnegative(),
|
||||
acceptedGameAt: z.string().refine(isCanonicalIsoTimestamp).optional(),
|
||||
})
|
||||
.strict();
|
||||
|
||||
|
||||
@@ -460,6 +460,7 @@ export const possessNpcGeneral = async (options: {
|
||||
acceptedAt: Date;
|
||||
}): Promise<{ ok: true; generalId: number }> => {
|
||||
const { db, world, worldState, userId, generalId, acceptedAt } = options;
|
||||
// queue 대기 중 만료된 token도 enqueue 시점에는 유효했으므로 저장된 논리 수락 시각으로 다시 검증한다.
|
||||
const tokenAcceptedAt = truncateToSeconds(acceptedAt);
|
||||
requireNpcPossessionWorld(worldState);
|
||||
await lockNpcPossession(db, userId);
|
||||
|
||||
@@ -294,7 +294,9 @@ async function handleNpcPossessGeneral(
|
||||
throw new Error('NPC possession world state is missing.');
|
||||
}
|
||||
const operationalAcceptedAt = await resolveCommandAcceptedAt(db, command);
|
||||
const acceptedAt = ctx.world.getGameNow(operationalAcceptedAt);
|
||||
const acceptedAt = command.acceptedGameAt
|
||||
? new Date(command.acceptedGameAt)
|
||||
: ctx.world.getGameNow(operationalAcceptedAt);
|
||||
try {
|
||||
return {
|
||||
type: 'npcPossessGeneral',
|
||||
|
||||
Reference in New Issue
Block a user