Skip to content

Commit 0d0b46d

Browse files
committed
archdrawquiz 평가기준 변경
명예의 전당 점수 연동 및 archdrawquiz 100점 만점으로 평가기준 수정
1 parent 264fa96 commit 0d0b46d

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

backend/core/socket_server.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,16 +299,17 @@ async def draw_submit(sid, data):
299299
room = draw_rooms[room_id]
300300
player = next((p for p in room['players'] if p['sid'] == sid), None)
301301
if player:
302-
# [수정: 클라이언트 점수 검증] 체크리스트 기반으로 서버가 직접 점수 계산
302+
# [수정 2026-03-05] 100점 만점 체계로 변경
303+
# 체크리스트 60점 + 시간보너스 10점 + 완료보너스 20점 + 콤보보너스 10점
303304
checks = data.get('checks', [])
304305
hit = sum(1 for c in checks if c.get('ok'))
305306
total = len(checks) if checks else 1
306307
ratio = hit / total
307-
# 점수 공식: 체크 40점 + 달성보너스 100점 + (남은시간 × 2) + (콤보 × 20)
308-
# 단, 클라이언트가 보낸 timeLeft·combo 는 참고값 — 최대치 클램핑으로 어뷰징 방지
309-
time_bonus = min(data.get('time_left', 0), 90) * 2 # 최대 180점 (90초 기준)
310-
combo_bonus = min(data.get('combo', 0), 10) * 20 # 최대 200점 (콤보 10x 상한)
311-
pts = hit * 40 + (100 if ratio >= 0.8 else 0) + time_bonus + combo_bonus
308+
check_score = round((hit / total) * 60) # 최대 60점
309+
time_bonus = round((min(data.get('time_left', 0), 90) / 90) * 10) # 최대 10점
310+
complete_bonus = 20 if ratio == 1.0 else 0 # 전부 통과 시 +20점
311+
combo_bonus = min(data.get('combo', 0), 5) * 2 # 최대 10점 (5콤보 상한)
312+
pts = check_score + time_bonus + complete_bonus + combo_bonus
312313

313314
player['score'] += pts
314315
player['last_pts'] = pts

frontend/src/features/wars/minigames/ArchDrawQuiz.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ import { useGameStore } from '@/stores/game'
415415
import { useAuthStore } from '@/stores/auth' // [추가: 2026-03-03] 유저 연동 복구
416416
import { useDrawSocket } from '../composables/useDrawSocket'
417417
import { addBattleRecord } from '../useBattleRecord.js'
418+
import axios from 'axios'
418419
419420
const router = useRouter()
420421
const ds = useDrawSocket()
@@ -1051,6 +1052,21 @@ function saveResultAndExit() {
10511052
if (myScore.value > oppScore.value) addBattleRecord(name, 'win')
10521053
else if (myScore.value < oppScore.value) addBattleRecord(name, 'lose')
10531054
else addBattleRecord(name, 'draw')
1055+
1056+
// [2026-03-05] 명예의 전당 연동: Wars 점수 제출
1057+
if (auth.isLoggedIn) {
1058+
axios.post('/api/core/wars/submit-score/', {
1059+
game_type: 'arch_draw',
1060+
score: myScore.value,
1061+
submitted_data: {
1062+
mission_title: curQ.value?.title || '',
1063+
checks_passed: checkItems.value.filter(c => c.ok).length,
1064+
checks_total: checkItems.value.length,
1065+
combo: combo.value,
1066+
result: myScore.value > oppScore.value ? 'win' : myScore.value === oppScore.value ? 'draw' : 'lose',
1067+
}
1068+
}).catch(err => console.warn('[Wars] ArchDraw Score submit failed:', err.message))
1069+
}
10541070
}
10551071
10561072
function exitGame() {

0 commit comments

Comments
 (0)