added roundstats with eco info, switched to avatar hash

This commit is contained in:
2021-10-17 03:52:20 +02:00
parent 7f5a2f8956
commit fd8c026a8e
35 changed files with 4187 additions and 160 deletions

View File

@@ -18,8 +18,8 @@ type Player struct {
ID uint64 `json:"steamid,string"`
// Name holds the value of the "name" field.
Name string `json:"name,omitempty"`
// AvatarURL holds the value of the "avatar_url" field.
AvatarURL string `json:"avatar_url,omitempty"`
// Avatar holds the value of the "avatar" field.
Avatar string `json:"avatar,omitempty"`
// VanityURL holds the value of the "vanity_url" field.
VanityURL string `json:"vanity_url,omitempty"`
// VanityURLReal holds the value of the "vanity_url_real" field.
@@ -81,7 +81,7 @@ func (*Player) scanValues(columns []string) ([]interface{}, error) {
values[i] = new(sql.NullBool)
case player.FieldID, player.FieldVacCount:
values[i] = new(sql.NullInt64)
case player.FieldName, player.FieldAvatarURL, player.FieldVanityURL, player.FieldVanityURLReal, player.FieldAuthCode:
case player.FieldName, player.FieldAvatar, player.FieldVanityURL, player.FieldVanityURLReal, player.FieldAuthCode:
values[i] = new(sql.NullString)
case player.FieldVacDate, player.FieldSteamUpdated, player.FieldSharecodeUpdated, player.FieldProfileCreated:
values[i] = new(sql.NullTime)
@@ -112,11 +112,11 @@ func (pl *Player) assignValues(columns []string, values []interface{}) error {
} else if value.Valid {
pl.Name = value.String
}
case player.FieldAvatarURL:
case player.FieldAvatar:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field avatar_url", values[i])
return fmt.Errorf("unexpected type %T for field avatar", values[i])
} else if value.Valid {
pl.AvatarURL = value.String
pl.Avatar = value.String
}
case player.FieldVanityURL:
if value, ok := values[i].(*sql.NullString); !ok {
@@ -212,8 +212,8 @@ func (pl *Player) String() string {
builder.WriteString(fmt.Sprintf("id=%v", pl.ID))
builder.WriteString(", name=")
builder.WriteString(pl.Name)
builder.WriteString(", avatar_url=")
builder.WriteString(pl.AvatarURL)
builder.WriteString(", avatar=")
builder.WriteString(pl.Avatar)
builder.WriteString(", vanity_url=")
builder.WriteString(pl.VanityURL)
builder.WriteString(", vanity_url_real=")