Ban if vouchers over a certain threshold

This commit is contained in:
maru committed 2024-04-28 20:59:53 -04:00
1 parent bc8084b70b
commit e184e9da91
2 files changed
+16

No files matched your search

+7
View File
@@ -39,6 +39,13 @@ func Update(uuid []byte, slot int, save any) error {
return fmt.Errorf("client version out of date")
}
if save.VoucherCounts["0"] > 300 ||
save.VoucherCounts["1"] > 150 ||
save.VoucherCounts["2"] > 100 ||
save.VoucherCounts["3"] > 10 {
db.UpdateAccountBanned(uuid, true)
}
err = db.UpdateAccountStats(uuid, save.GameStats, save.VoucherCounts)
if err != nil {
return fmt.Errorf("failed to update account stats: %s", err)