refactor(channelserver): migrate inline queries to helpers and define named constants

Migrate 6 character data handlers to use the existing loadCharacterData
and saveCharacterData helpers, eliminating duplicate inline SQL:
- LoadFavoriteQuest, SaveFavoriteQuest, LoadDecoMyset, LoadMezfesData,
  LoadHunterNavi, GetEquipSkinHist

Define named constants replacing magic numbers across handlers:
- Achievement trophy tiers, broadcast/message types, diva phase
  durations, RP accrual rates, kill log layout, semaphore bases,
  quest stage/loading screen IDs

Update anti-patterns doc with accurate line counts, evidence-based
softlock analysis, and revised refactoring priorities.
This commit is contained in:
Houmgaor
2026-02-20 19:46:57 +01:00
parent 24ccc167fe
commit bf983966a0
12 changed files with 224 additions and 121 deletions

View File

@@ -327,12 +327,18 @@ func (s *Session) getObjectId() uint32 {
return uint32(s.objectID)<<16 | uint32(s.objectIndex)
}
// Semaphore ID base values
const (
semaphoreBaseDefault = uint32(0x000F0000)
semaphoreBaseAlt = uint32(0x000E0000)
)
// GetSemaphoreID returns the semaphore ID held by the session, varying by semaphore mode.
func (s *Session) GetSemaphoreID() uint32 {
if s.semaphoreMode {
return 0x000E0000 + uint32(s.semaphoreID[1])
return semaphoreBaseAlt + uint32(s.semaphoreID[1])
} else {
return 0x000F0000 + uint32(s.semaphoreID[0])
return semaphoreBaseDefault + uint32(s.semaphoreID[0])
}
}