2 Commits

Author SHA1 Message Date
7acd72c74e fix: 게임 업데이트 감지를 game.zip 전체 해시로 변경
All checks were successful
Server CI/CD / lint-and-build (push) Successful in 34s
Server CI/CD / deploy (push) Successful in 52s
A301.exe만 해시하면 Mono 빌드에서 exe가 변경되지 않아
Data 폴더의 스크립트/에셋 변경을 감지하지 못하는 문제 수정.
hashGameExeFromZip → hashFileToHex(game.zip 전체)로 변경.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:40:55 +09:00
b1e89dca1c Revert: 세션명 고유화 제거 (dedicated server와 세션명 불일치 문제)
All checks were successful
Server CI/CD / lint-and-build (push) Successful in 36s
Server CI/CD / deploy (push) Successful in 51s
- dedicated server는 원래 슬롯명으로 Fusion 세션을 시작하므로
  클라이언트도 동일한 세션명을 사용해야 함
- SlotSessionName 필드는 유지 (향후 활용 가능)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 23:38:43 +09:00
2 changed files with 7 additions and 11 deletions

View File

@@ -106,13 +106,9 @@ func (s *Service) RequestEntry(usernames []string, bossID int) (*BossRoom, error
} }
} }
// 세션명에 타임스탬프를 붙여 매 입장마다 고유하게 만듦
// (이전 Fusion 세션이 아직 살아있어도 충돌하지 않음)
uniqueSession := fmt.Sprintf("%s_%d", slot.SessionName, time.Now().UnixNano())
room = &BossRoom{ room = &BossRoom{
SessionName: uniqueSession, SessionName: slot.SessionName,
SlotSessionName: slot.SessionName, // 슬롯 리셋용 원래 이름 보존 SlotSessionName: slot.SessionName,
BossID: bossID, BossID: bossID,
Status: StatusWaiting, Status: StatusWaiting,
MaxPlayers: len(usernames), MaxPlayers: len(usernames),

View File

@@ -151,12 +151,12 @@ func (s *Service) Upload(filename string, body io.Reader, baseURL string) (*Info
} }
} }
fileHash := hashGameExeFromZip(finalPath) // game.zip 전체의 해시를 사용하여 업데이트 감지.
// A301.exe만 해시하면 Mono 빌드에서 exe가 안 바뀌어도
// Data 폴더의 스크립트/에셋 변경을 감지하지 못함.
fileHash := hashFileToHex(finalPath)
if fileHash == "" { if fileHash == "" {
if removeErr := os.Remove(finalPath); removeErr != nil { return nil, fmt.Errorf("파일 해시 계산에 실패했습니다")
log.Printf("WARNING: failed to remove file %s: %v", finalPath, removeErr)
}
return nil, fmt.Errorf("zip 파일에 %s이(가) 포함되어 있지 않습니다", "A301.exe")
} }
info, err := s.repo.GetLatest() info, err := s.repo.GetLatest()