fix(bunsik): 요리 창 서버 검증 — 메뉴 고름(cookStart)부터 조리 과정 최소 시간이 지나야 완성 인정

- PlotController.startCook/finishCook: 고른 메뉴 일치, 주문·손 자리, 조리대 거리, Recipes.minTime 확인
- 원격 이벤트만 보내 조리 과정을 건너뛰면 거절(통합 테스트 추가), 쓰지 않게 된 lastCook 제거
- 통합 테스트 822/822, Recipes.spec 101

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-13 16:20:00 +09:00
parent 02df9101bb
commit 2b64bfc392
6 changed files with 90 additions and 13 deletions

View File

@@ -114,7 +114,19 @@ c:update(3)
eq(c.shop.customers[1].state, "waiting", "손님이 앉음")
eq(owner:GetAttribute("Orders"), "Tteokbokki=1", "요리 창에 보여 줄 주문 수")
eq(c:cook("Gimbap"), nil, "주문 없는 메뉴(김밥)는 못 만듦")
eq(c:cook("Tteokbokki"), "Tteokbokki", "고른 메뉴로 조리")
-- 요리 창 세션: 원격 이벤트만 보내 조리 과정을 건너뛰지 못함
eq(c:finishCook("Tteokbokki", 10), nil, "메뉴를 고르지 않고 완성만 보내면 거절")
eq(c:startCook("Gimbap", 10), false, "주문 없는 메뉴로는 시작 못 함")
check(c:startCook("Tteokbokki", 10), "주문 있는 메뉴로 시작")
eq(c:finishCook("Gimbap", 20), nil, "고른 메뉴와 다른 메뉴로 완성하면 거절")
check(c:startCook("Tteokbokki", 10), "다시 시작")
local minT = Recipes.minTime("Tteokbokki", c.shop.stats.cook)
eq(c:finishCook("Tteokbokki", 10 + minT * 0.5), nil, `조리 과정 최소 시간({minT}초)보다 빠르면 거절`)
eq(c:finishCook("Tteokbokki", 10 + minT), nil, "거절된 세션은 다시 못 씀")
eq(owner:GetAttribute("Carry"), 0, "거절되면 접시 없음")
-- (가상 시계를 3초에 맞춰 끝냅니다. 뒤의 식사 시간 검사가 3초 기준)
check(c:startCook("Tteokbokki", 3 - Recipes.expectedTime("Tteokbokki", c.shop.stats.cook)), "다시 시작")
eq(c:finishCook("Tteokbokki", 3), "Tteokbokki", "정상 시간이면 조리")
eq(owner:GetAttribute("Hand"), "Tteokbokki", "손에 든 접시 종류")
eq(owner:GetAttribute("Orders"), "", "주문이 다 채워짐")
eq(owner:GetAttribute("Tut"), 2, "튜토리얼 2단계")
@@ -635,10 +647,12 @@ eq((cookPage:FindFirstChild("Instruction") :: TextLabel).Text, "돌돌 말아요
eq((cookPage:FindFirstChild("Gesture") :: TextLabel).Text, "문질문질!", "문지르기 안내")
eq(kitchen.input("rub", flowK.need), "step", "다 문지름 → 3단계")
check((cookPage:FindFirstChild("Roll", true) :: ImageLabel).Visible, "김밥이 말림")
eq(#ksent, 0, "완성 전에는 서버에 안 보냄")
eq(#ksent, 1, "완성 전에는 시작만 보냄")
eq(kitchen.input("tap", flowK.need), "done", "썰기 끝 → 완성")
eq(ksent[1] and ksent[1][1], "cook", "서버에 cook")
eq(ksent[1] and ksent[1][2], "Gimbap", "고른 메뉴를 보냄")
eq(ksent[1] and ksent[1][1], "cookStart", "메뉴를 고르면 서버에 cookStart")
eq(ksent[1] and ksent[1][2], "Gimbap", "고른 메뉴로 시작")
eq(ksent[2] and ksent[2][1], "cook", "다 만들면 서버에 cook")
eq(ksent[2] and ksent[2][2], "Gimbap", "고른 메뉴를 보냄")
local donePage = kframe:FindFirstChild("DonePage", true) :: Frame
check(donePage.Visible, "완성 화면")
eq((donePage:FindFirstChild("Dish") :: ImageLabel).ImageRectOffset, Icons.OFFSET.Gimbap, "완성 접시 그림")
@@ -683,7 +697,9 @@ for _, m in Economy.MENU_ORDER do
guard += 1
end
eq(kitchen.flow().phase, "done", `{m} 완성`)
eq(ksent[#ksent][1], "cook", `{m} 완성 보냄`)
eq(ksent[#ksent][2], m, `{m} 서버에 보냄`)
eq(ksent[#ksent - 1][1], "cookStart", `{m} 시작 보냄`)
khud.open(nil)
check(not kitchen.isOpen(), `{m} 창 닫기`)
end