Compare commits

..

No commits in common. "7bfd9dfba7acbfd2cca1005af1ef7737aa82ca58" and "df92ff8b6fcbaae0e3bccda4bb104e391751fc61" have entirely different histories.

5 changed files with 6 additions and 22 deletions

View File

@ -18,6 +18,8 @@
package daily
import (
"log"
"github.com/pagefaultgames/rogueserver/db"
"github.com/pagefaultgames/rogueserver/defs"
)
@ -26,7 +28,7 @@ import (
func Rankings(category, page int) ([]defs.DailyRanking, error) {
rankings, err := db.FetchRankings(category, page)
if err != nil {
return rankings, err
log.Print("failed to retrieve rankings")
}
return rankings, nil

View File

@ -18,6 +18,8 @@
package daily
import (
"log"
"github.com/pagefaultgames/rogueserver/db"
)
@ -25,7 +27,7 @@ import (
func RankingPageCount(category int) (int, error) {
pageCount, err := db.FetchRankingPageCount(category)
if err != nil {
return pageCount, err
log.Print("failed to retrieve ranking page count")
}
return pageCount, nil

View File

@ -50,10 +50,6 @@ func Clear(uuid []byte, slot int, seed string, save defs.SessionSaveData) (Clear
waveCompleted--
}
if save.Score >= 20000 {
db.SetAccountBanned(uuid, true)
}
err = db.AddOrUpdateAccountDailyRun(uuid, save.Score, waveCompleted)
if err != nil {
log.Printf("failed to add or update daily run record: %s", err)

View File

@ -42,13 +42,6 @@ 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.SetAccountBanned(uuid, true)
}
err = db.UpdateAccountStats(uuid, save.GameStats, save.VoucherCounts)
if err != nil {
return fmt.Errorf("failed to update account stats: %s", err)

View File

@ -145,15 +145,6 @@ func UpdateAccountStats(uuid []byte, stats defs.GameStats, voucherCounts map[str
return nil
}
func SetAccountBanned(uuid []byte, banned bool) error {
_, err := handle.Exec("UPDATE accounts SET banned = ? WHERE uuid = ?", banned, uuid)
if err != nil {
return err
}
return nil
}
func FetchAndClaimAccountCompensations(uuid []byte) (map[int]int, error) {
var compensations = make(map[int]int)