mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-24 00:23:39 +01:00
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:
@@ -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])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user