mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-07-05 16:02:23 +02:00
Compare commits
No commits in common. "7bfd9dfba7acbfd2cca1005af1ef7737aa82ca58" and "df92ff8b6fcbaae0e3bccda4bb104e391751fc61" have entirely different histories.
7bfd9dfba7
...
df92ff8b6f
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user