Fix repeated weapon story unlock notifications by sending only changed stories in diffs

This commit is contained in:
Ilya Groshev
2026-04-16 14:36:05 +03:00
parent a61ae6b93e
commit 0ab2589277
17 changed files with 260 additions and 150 deletions
@@ -170,3 +170,13 @@ func BuildDiffFromTablesOrdered(tables map[string]string, order []string) map[st
}
return diff
}
func AddWeaponStoryDiff(diff map[string]*pb.DiffData, user store.UserState, weaponIds []int32) {
if len(weaponIds) == 0 {
return
}
diff["IUserWeaponStory"] = &pb.DiffData{
UpdateRecordsJson: WeaponStoryRecordsForIds(user, weaponIds),
DeleteKeysJson: "[]",
}
}