fixed vadate always being the first result
This commit is contained in:
@@ -135,7 +135,7 @@ type PlayerResponse struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Avatar string `json:"avatar,omitempty"`
|
||||
VAC bool `json:"vac"`
|
||||
VACDate int64 `json:"vac_date,omitempty"`
|
||||
VACDate int64 `json:"vac_date,omitempty,string"`
|
||||
Tracked bool `json:"tracked"`
|
||||
VanityURL string `json:"vanity_url,omitempty"`
|
||||
MatchStats *MatchStats `json:"match_stats,omitempty"`
|
||||
@@ -492,7 +492,7 @@ func UpdatePlayerFromSteam(players []*ent.Player, db *ent.Client, apiKey string,
|
||||
|
||||
for _, ban := range bans {
|
||||
if ban.NumberOfVACBans > 0 {
|
||||
banDate := time.Now().UTC().AddDate(0, 0, -1*int(bans[0].DaysSinceLastBan))
|
||||
banDate := time.Now().UTC().AddDate(0, 0, -1*int(ban.DaysSinceLastBan))
|
||||
|
||||
lock.Lock()
|
||||
err := db.Player.UpdateOneID(ban.SteamID).SetVacCount(int(ban.NumberOfVACBans)).SetVacDate(banDate).Exec(context.Background())
|
||||
|
Reference in New Issue
Block a user