mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-24 16:43:37 +01:00
fix(savedata): add recovery hint to integrity check failure log
Admins importing saves from another server instance will hit the hash mismatch error with no guidance. The log message now tells them to set DisableSaveIntegrityCheck=true or null the hash for the specific character via SQL.
This commit is contained in:
@@ -59,7 +59,9 @@ func GetCharacterSaveData(s *Session, charID uint32) (*CharacterSaveData, error)
|
|||||||
if storedHash != nil && !s.server.erupeConfig.DisableSaveIntegrityCheck {
|
if storedHash != nil && !s.server.erupeConfig.DisableSaveIntegrityCheck {
|
||||||
computedHash := sha256.Sum256(saveData.decompSave)
|
computedHash := sha256.Sum256(saveData.decompSave)
|
||||||
if !bytes.Equal(storedHash, computedHash[:]) {
|
if !bytes.Equal(storedHash, computedHash[:]) {
|
||||||
s.logger.Error("Savedata integrity check failed: hash mismatch",
|
s.logger.Error("Savedata integrity check failed: hash mismatch — "+
|
||||||
|
"if this character was imported from another server, set DisableSaveIntegrityCheck=true in config.json "+
|
||||||
|
"or run: UPDATE characters SET savedata_hash = NULL WHERE id = <charID>",
|
||||||
zap.Uint32("charID", charID),
|
zap.Uint32("charID", charID),
|
||||||
zap.Binary("stored_hash", storedHash),
|
zap.Binary("stored_hash", storedHash),
|
||||||
zap.Binary("computed_hash", computedHash[:]),
|
zap.Binary("computed_hash", computedHash[:]),
|
||||||
|
|||||||
Reference in New Issue
Block a user