feat: Ref 호환 접속 제한과 벌점 초기화 구현
실행 중인 프로필에서만 접속 벌점을 누적하고 제한 임계값과 대상 경로를 Ref 순서에 맞춘다. 자기 턴 명령 성공 시 순간 점수를 같은 flush에서 초기화하며 월간 누적 감쇠는 유지한다. 제한 중 메인 자동 갱신과 실시간 구독을 중지하고 수동 갱신 성공 시 복구한다.
This commit is contained in:
@@ -8,6 +8,7 @@ import type { BattleSimTransport } from './battleSim/transport.js';
|
||||
import type { FlushStore } from './auth/flushStore.js';
|
||||
import type { RedisAccessTokenStore } from './auth/accessTokenStore.js';
|
||||
import type { AccountIconSource } from './auth/accountIconSource.js';
|
||||
import type { ProfileStatusSource } from './auth/profileStatusSource.js';
|
||||
import type { ContentImageUploadStore } from './services/remoteContentImageStore.js';
|
||||
|
||||
export interface GameProfile {
|
||||
@@ -99,6 +100,9 @@ export interface GameApiContext {
|
||||
flushStore: FlushStore;
|
||||
gameTokenSecret: string;
|
||||
accountIconSource?: AccountIconSource;
|
||||
// Runtime context always supplies this. Partial router fixtures may omit it;
|
||||
// access scoring then fails open and never penalizes a test-only request.
|
||||
profileStatusSource?: ProfileStatusSource;
|
||||
}
|
||||
|
||||
export const createGameApiContext = (options: {
|
||||
@@ -118,6 +122,7 @@ export const createGameApiContext = (options: {
|
||||
flushStore: FlushStore;
|
||||
gameTokenSecret: string;
|
||||
accountIconSource?: AccountIconSource;
|
||||
profileStatusSource: ProfileStatusSource;
|
||||
}): GameApiContext => {
|
||||
return {
|
||||
requestId: options.requestId,
|
||||
@@ -137,5 +142,6 @@ export const createGameApiContext = (options: {
|
||||
flushStore: options.flushStore,
|
||||
gameTokenSecret: options.gameTokenSecret,
|
||||
...(options.accountIconSource ? { accountIconSource: options.accountIconSource } : {}),
|
||||
profileStatusSource: options.profileStatusSource,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user