mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
refactor(channelserver): extract UserRepository for users table access
Centralizes all 31 direct users-table SQL queries from 11 handler files into a single UserRepository, following the same pattern as CharacterRepository and GuildRepository. The only excluded query is the sign_sessions JOIN in handleMsgSysLogin which spans multiple tables.
This commit is contained in:
@@ -41,8 +41,8 @@ func handleMsgSysCastBinary(s *Session, p mhfpacket.MHFPacket) {
|
||||
)
|
||||
if pkt.BroadcastType == BroadcastTypeStage && pkt.MessageType == BinaryMessageTypeData && len(pkt.RawDataPayload) == timerPayloadSize {
|
||||
if tmp.ReadUint16() == timerSubtype && tmp.ReadUint8() == timerFlag {
|
||||
var timer bool
|
||||
if err := s.server.db.QueryRow(`SELECT COALESCE(timer, false) FROM users WHERE id=$1`, s.userID).Scan(&timer); err != nil {
|
||||
timer, err := s.server.userRepo.GetTimer(s.userID)
|
||||
if err != nil {
|
||||
s.logger.Error("Failed to get timer setting", zap.Error(err))
|
||||
}
|
||||
if timer {
|
||||
|
||||
Reference in New Issue
Block a user