mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
refactor(channelserver): add numeric column helpers and extract protocol constants
Add readCharacterInt/adjustCharacterInt helpers for single-column integer operations on the characters table. Eliminates fmt.Sprintf SQL construction in handlers_misc.go and replaces inline queries across cafe, kouryou, and mercenary handlers. Second round of protocol constant extraction: adds constants_time.go (secsPerDay, secsPerWeek), constants_raviente.go (register IDs, semaphore constants), and named constants across 14 handler files replacing raw hex/numeric literals. Updates anti-patterns doc to mark #4 (magic numbers) as substantially fixed.
This commit is contained in:
14
server/channelserver/constants_raviente.go
Normal file
14
server/channelserver/constants_raviente.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package channelserver
|
||||
|
||||
// Raviente register type IDs (used in MsgSysLoadRegister / MsgSysNotifyRegister)
|
||||
const (
|
||||
raviRegisterState = uint32(0x40000)
|
||||
raviRegisterSupport = uint32(0x50000)
|
||||
raviRegisterGeneral = uint32(0x60000)
|
||||
)
|
||||
|
||||
// Raviente semaphore constants
|
||||
const (
|
||||
raviSemaphoreStride = 0x10000 // ID spacing between hs_l0* semaphores
|
||||
raviSemaphoreMax = uint16(127) // max players per Raviente semaphore
|
||||
)
|
||||
Reference in New Issue
Block a user