mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
fix(channelserver): handle silently discarded errors across handlers
Replace ~17 instances of '_ =' / '_ :=' with proper error checks that log warnings or send fail ACKs. Affected handlers: cafe, distitem, data, guild, guild_board, guild_cooking, guild_scout, house, mercenary, misc, and rengoku. Also resolves all pre-existing lint issues: unchecked bf.Seek in tests, unused filtered slice in svc_festa, unused mock fields, and unused signserver test helper.
This commit is contained in:
@@ -176,9 +176,13 @@ func dumpSaveData(s *Session, data []byte, suffix string) {
|
||||
func handleMsgMhfLoaddata(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgMhfLoaddata)
|
||||
if _, err := os.Stat(filepath.Join(s.server.erupeConfig.BinPath, "save_override.bin")); err == nil {
|
||||
data, _ := os.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, "save_override.bin"))
|
||||
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||
return
|
||||
data, readErr := os.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, "save_override.bin"))
|
||||
if readErr != nil {
|
||||
s.logger.Error("Failed to read save_override.bin", zap.Error(readErr))
|
||||
} else {
|
||||
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
data, err := s.server.charRepo.LoadColumn(s.charID, "savedata")
|
||||
|
||||
Reference in New Issue
Block a user