deleted round from db/response

This commit is contained in:
2021-10-09 00:57:05 +02:00
parent 1355dfad8d
commit 15b273f052
11 changed files with 4 additions and 264 deletions

View File

@@ -35,8 +35,6 @@ type Match struct {
MatchResult int `json:"match_result,omitempty"` MatchResult int `json:"match_result,omitempty"`
// MaxRounds holds the value of the "max_rounds" field. // MaxRounds holds the value of the "max_rounds" field.
MaxRounds int `json:"max_rounds,omitempty"` MaxRounds int `json:"max_rounds,omitempty"`
// Rounds holds the value of the "rounds" field.
Rounds int `json:"rounds,omitempty"`
// DemoExpired holds the value of the "demo_expired" field. // DemoExpired holds the value of the "demo_expired" field.
DemoExpired bool `json:"demo_expired,omitempty"` DemoExpired bool `json:"demo_expired,omitempty"`
// DemoParsed holds the value of the "demo_parsed" field. // DemoParsed holds the value of the "demo_parsed" field.
@@ -92,7 +90,7 @@ func (*Match) scanValues(columns []string) ([]interface{}, error) {
values[i] = new([]byte) values[i] = new([]byte)
case match.FieldDemoExpired, match.FieldDemoParsed: case match.FieldDemoExpired, match.FieldDemoParsed:
values[i] = new(sql.NullBool) values[i] = new(sql.NullBool)
case match.FieldID, match.FieldScoreTeamA, match.FieldScoreTeamB, match.FieldDuration, match.FieldMatchResult, match.FieldMaxRounds, match.FieldRounds: case match.FieldID, match.FieldScoreTeamA, match.FieldScoreTeamB, match.FieldDuration, match.FieldMatchResult, match.FieldMaxRounds:
values[i] = new(sql.NullInt64) values[i] = new(sql.NullInt64)
case match.FieldShareCode, match.FieldMap, match.FieldReplayURL: case match.FieldShareCode, match.FieldMap, match.FieldReplayURL:
values[i] = new(sql.NullString) values[i] = new(sql.NullString)
@@ -173,12 +171,6 @@ func (m *Match) assignValues(columns []string, values []interface{}) error {
} else if value.Valid { } else if value.Valid {
m.MaxRounds = int(value.Int64) m.MaxRounds = int(value.Int64)
} }
case match.FieldRounds:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field rounds", values[i])
} else if value.Valid {
m.Rounds = int(value.Int64)
}
case match.FieldDemoExpired: case match.FieldDemoExpired:
if value, ok := values[i].(*sql.NullBool); !ok { if value, ok := values[i].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field demo_expired", values[i]) return fmt.Errorf("unexpected type %T for field demo_expired", values[i])
@@ -255,8 +247,6 @@ func (m *Match) String() string {
builder.WriteString(fmt.Sprintf("%v", m.MatchResult)) builder.WriteString(fmt.Sprintf("%v", m.MatchResult))
builder.WriteString(", max_rounds=") builder.WriteString(", max_rounds=")
builder.WriteString(fmt.Sprintf("%v", m.MaxRounds)) builder.WriteString(fmt.Sprintf("%v", m.MaxRounds))
builder.WriteString(", rounds=")
builder.WriteString(fmt.Sprintf("%v", m.Rounds))
builder.WriteString(", demo_expired=") builder.WriteString(", demo_expired=")
builder.WriteString(fmt.Sprintf("%v", m.DemoExpired)) builder.WriteString(fmt.Sprintf("%v", m.DemoExpired))
builder.WriteString(", demo_parsed=") builder.WriteString(", demo_parsed=")

View File

@@ -25,8 +25,6 @@ const (
FieldMatchResult = "match_result" FieldMatchResult = "match_result"
// FieldMaxRounds holds the string denoting the max_rounds field in the database. // FieldMaxRounds holds the string denoting the max_rounds field in the database.
FieldMaxRounds = "max_rounds" FieldMaxRounds = "max_rounds"
// FieldRounds holds the string denoting the rounds field in the database.
FieldRounds = "rounds"
// FieldDemoExpired holds the string denoting the demo_expired field in the database. // FieldDemoExpired holds the string denoting the demo_expired field in the database.
FieldDemoExpired = "demo_expired" FieldDemoExpired = "demo_expired"
// FieldDemoParsed holds the string denoting the demo_parsed field in the database. // FieldDemoParsed holds the string denoting the demo_parsed field in the database.
@@ -65,7 +63,6 @@ var Columns = []string{
FieldDuration, FieldDuration,
FieldMatchResult, FieldMatchResult,
FieldMaxRounds, FieldMaxRounds,
FieldRounds,
FieldDemoExpired, FieldDemoExpired,
FieldDemoParsed, FieldDemoParsed,
FieldEco, FieldEco,

View File

@@ -156,13 +156,6 @@ func MaxRounds(v int) predicate.Match {
}) })
} }
// Rounds applies equality check predicate on the "rounds" field. It's identical to RoundsEQ.
func Rounds(v int) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldRounds), v))
})
}
// DemoExpired applies equality check predicate on the "demo_expired" field. It's identical to DemoExpiredEQ. // DemoExpired applies equality check predicate on the "demo_expired" field. It's identical to DemoExpiredEQ.
func DemoExpired(v bool) predicate.Match { func DemoExpired(v bool) predicate.Match {
return predicate.Match(func(s *sql.Selector) { return predicate.Match(func(s *sql.Selector) {
@@ -994,82 +987,6 @@ func MaxRoundsLTE(v int) predicate.Match {
}) })
} }
// RoundsEQ applies the EQ predicate on the "rounds" field.
func RoundsEQ(v int) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldRounds), v))
})
}
// RoundsNEQ applies the NEQ predicate on the "rounds" field.
func RoundsNEQ(v int) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldRounds), v))
})
}
// RoundsIn applies the In predicate on the "rounds" field.
func RoundsIn(vs ...int) predicate.Match {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Match(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldRounds), v...))
})
}
// RoundsNotIn applies the NotIn predicate on the "rounds" field.
func RoundsNotIn(vs ...int) predicate.Match {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Match(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldRounds), v...))
})
}
// RoundsGT applies the GT predicate on the "rounds" field.
func RoundsGT(v int) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldRounds), v))
})
}
// RoundsGTE applies the GTE predicate on the "rounds" field.
func RoundsGTE(v int) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldRounds), v))
})
}
// RoundsLT applies the LT predicate on the "rounds" field.
func RoundsLT(v int) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldRounds), v))
})
}
// RoundsLTE applies the LTE predicate on the "rounds" field.
func RoundsLTE(v int) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldRounds), v))
})
}
// DemoExpiredEQ applies the EQ predicate on the "demo_expired" field. // DemoExpiredEQ applies the EQ predicate on the "demo_expired" field.
func DemoExpiredEQ(v bool) predicate.Match { func DemoExpiredEQ(v bool) predicate.Match {
return predicate.Match(func(s *sql.Selector) { return predicate.Match(func(s *sql.Selector) {

View File

@@ -92,12 +92,6 @@ func (mc *MatchCreate) SetMaxRounds(i int) *MatchCreate {
return mc return mc
} }
// SetRounds sets the "rounds" field.
func (mc *MatchCreate) SetRounds(i int) *MatchCreate {
mc.mutation.SetRounds(i)
return mc
}
// SetDemoExpired sets the "demo_expired" field. // SetDemoExpired sets the "demo_expired" field.
func (mc *MatchCreate) SetDemoExpired(b bool) *MatchCreate { func (mc *MatchCreate) SetDemoExpired(b bool) *MatchCreate {
mc.mutation.SetDemoExpired(b) mc.mutation.SetDemoExpired(b)
@@ -292,9 +286,6 @@ func (mc *MatchCreate) check() error {
if _, ok := mc.mutation.MaxRounds(); !ok { if _, ok := mc.mutation.MaxRounds(); !ok {
return &ValidationError{Name: "max_rounds", err: errors.New(`ent: missing required field "max_rounds"`)} return &ValidationError{Name: "max_rounds", err: errors.New(`ent: missing required field "max_rounds"`)}
} }
if _, ok := mc.mutation.Rounds(); !ok {
return &ValidationError{Name: "rounds", err: errors.New(`ent: missing required field "rounds"`)}
}
if _, ok := mc.mutation.DemoExpired(); !ok { if _, ok := mc.mutation.DemoExpired(); !ok {
return &ValidationError{Name: "demo_expired", err: errors.New(`ent: missing required field "demo_expired"`)} return &ValidationError{Name: "demo_expired", err: errors.New(`ent: missing required field "demo_expired"`)}
} }
@@ -406,14 +397,6 @@ func (mc *MatchCreate) createSpec() (*Match, *sqlgraph.CreateSpec) {
}) })
_node.MaxRounds = value _node.MaxRounds = value
} }
if value, ok := mc.mutation.Rounds(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeInt,
Value: value,
Column: match.FieldRounds,
})
_node.Rounds = value
}
if value, ok := mc.mutation.DemoExpired(); ok { if value, ok := mc.mutation.DemoExpired(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{ _spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeBool, Type: field.TypeBool,

View File

@@ -146,19 +146,6 @@ func (mu *MatchUpdate) AddMaxRounds(i int) *MatchUpdate {
return mu return mu
} }
// SetRounds sets the "rounds" field.
func (mu *MatchUpdate) SetRounds(i int) *MatchUpdate {
mu.mutation.ResetRounds()
mu.mutation.SetRounds(i)
return mu
}
// AddRounds adds i to the "rounds" field.
func (mu *MatchUpdate) AddRounds(i int) *MatchUpdate {
mu.mutation.AddRounds(i)
return mu
}
// SetDemoExpired sets the "demo_expired" field. // SetDemoExpired sets the "demo_expired" field.
func (mu *MatchUpdate) SetDemoExpired(b bool) *MatchUpdate { func (mu *MatchUpdate) SetDemoExpired(b bool) *MatchUpdate {
mu.mutation.SetDemoExpired(b) mu.mutation.SetDemoExpired(b)
@@ -478,20 +465,6 @@ func (mu *MatchUpdate) sqlSave(ctx context.Context) (n int, err error) {
Column: match.FieldMaxRounds, Column: match.FieldMaxRounds,
}) })
} }
if value, ok := mu.mutation.Rounds(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeInt,
Value: value,
Column: match.FieldRounds,
})
}
if value, ok := mu.mutation.AddedRounds(); ok {
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
Type: field.TypeInt,
Value: value,
Column: match.FieldRounds,
})
}
if value, ok := mu.mutation.DemoExpired(); ok { if value, ok := mu.mutation.DemoExpired(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeBool, Type: field.TypeBool,
@@ -763,19 +736,6 @@ func (muo *MatchUpdateOne) AddMaxRounds(i int) *MatchUpdateOne {
return muo return muo
} }
// SetRounds sets the "rounds" field.
func (muo *MatchUpdateOne) SetRounds(i int) *MatchUpdateOne {
muo.mutation.ResetRounds()
muo.mutation.SetRounds(i)
return muo
}
// AddRounds adds i to the "rounds" field.
func (muo *MatchUpdateOne) AddRounds(i int) *MatchUpdateOne {
muo.mutation.AddRounds(i)
return muo
}
// SetDemoExpired sets the "demo_expired" field. // SetDemoExpired sets the "demo_expired" field.
func (muo *MatchUpdateOne) SetDemoExpired(b bool) *MatchUpdateOne { func (muo *MatchUpdateOne) SetDemoExpired(b bool) *MatchUpdateOne {
muo.mutation.SetDemoExpired(b) muo.mutation.SetDemoExpired(b)
@@ -1119,20 +1079,6 @@ func (muo *MatchUpdateOne) sqlSave(ctx context.Context) (_node *Match, err error
Column: match.FieldMaxRounds, Column: match.FieldMaxRounds,
}) })
} }
if value, ok := muo.mutation.Rounds(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeInt,
Value: value,
Column: match.FieldRounds,
})
}
if value, ok := muo.mutation.AddedRounds(); ok {
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
Type: field.TypeInt,
Value: value,
Column: match.FieldRounds,
})
}
if value, ok := muo.mutation.DemoExpired(); ok { if value, ok := muo.mutation.DemoExpired(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeBool, Type: field.TypeBool,

View File

@@ -20,7 +20,6 @@ var (
{Name: "duration", Type: field.TypeInt}, {Name: "duration", Type: field.TypeInt},
{Name: "match_result", Type: field.TypeInt}, {Name: "match_result", Type: field.TypeInt},
{Name: "max_rounds", Type: field.TypeInt}, {Name: "max_rounds", Type: field.TypeInt},
{Name: "rounds", Type: field.TypeInt},
{Name: "demo_expired", Type: field.TypeBool, Default: false}, {Name: "demo_expired", Type: field.TypeBool, Default: false},
{Name: "demo_parsed", Type: field.TypeBool, Default: false}, {Name: "demo_parsed", Type: field.TypeBool, Default: false},
{Name: "eco", Type: field.TypeJSON, Nullable: true}, {Name: "eco", Type: field.TypeJSON, Nullable: true},

View File

@@ -49,8 +49,6 @@ type MatchMutation struct {
addmatch_result *int addmatch_result *int
max_rounds *int max_rounds *int
addmax_rounds *int addmax_rounds *int
rounds *int
addrounds *int
demo_expired *bool demo_expired *bool
demo_parsed *bool demo_parsed *bool
eco *struct { eco *struct {
@@ -607,62 +605,6 @@ func (m *MatchMutation) ResetMaxRounds() {
m.addmax_rounds = nil m.addmax_rounds = nil
} }
// SetRounds sets the "rounds" field.
func (m *MatchMutation) SetRounds(i int) {
m.rounds = &i
m.addrounds = nil
}
// Rounds returns the value of the "rounds" field in the mutation.
func (m *MatchMutation) Rounds() (r int, exists bool) {
v := m.rounds
if v == nil {
return
}
return *v, true
}
// OldRounds returns the old "rounds" field's value of the Match entity.
// If the Match object wasn't provided to the builder, the object is fetched from the database.
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (m *MatchMutation) OldRounds(ctx context.Context) (v int, err error) {
if !m.op.Is(OpUpdateOne) {
return v, fmt.Errorf("OldRounds is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, fmt.Errorf("OldRounds requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldRounds: %w", err)
}
return oldValue.Rounds, nil
}
// AddRounds adds i to the "rounds" field.
func (m *MatchMutation) AddRounds(i int) {
if m.addrounds != nil {
*m.addrounds += i
} else {
m.addrounds = &i
}
}
// AddedRounds returns the value that was added to the "rounds" field in this mutation.
func (m *MatchMutation) AddedRounds() (r int, exists bool) {
v := m.addrounds
if v == nil {
return
}
return *v, true
}
// ResetRounds resets all changes to the "rounds" field.
func (m *MatchMutation) ResetRounds() {
m.rounds = nil
m.addrounds = nil
}
// SetDemoExpired sets the "demo_expired" field. // SetDemoExpired sets the "demo_expired" field.
func (m *MatchMutation) SetDemoExpired(b bool) { func (m *MatchMutation) SetDemoExpired(b bool) {
m.demo_expired = &b m.demo_expired = &b
@@ -929,7 +871,7 @@ func (m *MatchMutation) Type() string {
// order to get all numeric fields that were incremented/decremented, call // order to get all numeric fields that were incremented/decremented, call
// AddedFields(). // AddedFields().
func (m *MatchMutation) Fields() []string { func (m *MatchMutation) Fields() []string {
fields := make([]string, 0, 13) fields := make([]string, 0, 12)
if m.share_code != nil { if m.share_code != nil {
fields = append(fields, match.FieldShareCode) fields = append(fields, match.FieldShareCode)
} }
@@ -957,9 +899,6 @@ func (m *MatchMutation) Fields() []string {
if m.max_rounds != nil { if m.max_rounds != nil {
fields = append(fields, match.FieldMaxRounds) fields = append(fields, match.FieldMaxRounds)
} }
if m.rounds != nil {
fields = append(fields, match.FieldRounds)
}
if m.demo_expired != nil { if m.demo_expired != nil {
fields = append(fields, match.FieldDemoExpired) fields = append(fields, match.FieldDemoExpired)
} }
@@ -995,8 +934,6 @@ func (m *MatchMutation) Field(name string) (ent.Value, bool) {
return m.MatchResult() return m.MatchResult()
case match.FieldMaxRounds: case match.FieldMaxRounds:
return m.MaxRounds() return m.MaxRounds()
case match.FieldRounds:
return m.Rounds()
case match.FieldDemoExpired: case match.FieldDemoExpired:
return m.DemoExpired() return m.DemoExpired()
case match.FieldDemoParsed: case match.FieldDemoParsed:
@@ -1030,8 +967,6 @@ func (m *MatchMutation) OldField(ctx context.Context, name string) (ent.Value, e
return m.OldMatchResult(ctx) return m.OldMatchResult(ctx)
case match.FieldMaxRounds: case match.FieldMaxRounds:
return m.OldMaxRounds(ctx) return m.OldMaxRounds(ctx)
case match.FieldRounds:
return m.OldRounds(ctx)
case match.FieldDemoExpired: case match.FieldDemoExpired:
return m.OldDemoExpired(ctx) return m.OldDemoExpired(ctx)
case match.FieldDemoParsed: case match.FieldDemoParsed:
@@ -1110,13 +1045,6 @@ func (m *MatchMutation) SetField(name string, value ent.Value) error {
} }
m.SetMaxRounds(v) m.SetMaxRounds(v)
return nil return nil
case match.FieldRounds:
v, ok := value.(int)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.SetRounds(v)
return nil
case match.FieldDemoExpired: case match.FieldDemoExpired:
v, ok := value.(bool) v, ok := value.(bool)
if !ok { if !ok {
@@ -1167,9 +1095,6 @@ func (m *MatchMutation) AddedFields() []string {
if m.addmax_rounds != nil { if m.addmax_rounds != nil {
fields = append(fields, match.FieldMaxRounds) fields = append(fields, match.FieldMaxRounds)
} }
if m.addrounds != nil {
fields = append(fields, match.FieldRounds)
}
return fields return fields
} }
@@ -1188,8 +1113,6 @@ func (m *MatchMutation) AddedField(name string) (ent.Value, bool) {
return m.AddedMatchResult() return m.AddedMatchResult()
case match.FieldMaxRounds: case match.FieldMaxRounds:
return m.AddedMaxRounds() return m.AddedMaxRounds()
case match.FieldRounds:
return m.AddedRounds()
} }
return nil, false return nil, false
} }
@@ -1234,13 +1157,6 @@ func (m *MatchMutation) AddField(name string, value ent.Value) error {
} }
m.AddMaxRounds(v) m.AddMaxRounds(v)
return nil return nil
case match.FieldRounds:
v, ok := value.(int)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.AddRounds(v)
return nil
} }
return fmt.Errorf("unknown Match numeric field %s", name) return fmt.Errorf("unknown Match numeric field %s", name)
} }
@@ -1316,9 +1232,6 @@ func (m *MatchMutation) ResetField(name string) error {
case match.FieldMaxRounds: case match.FieldMaxRounds:
m.ResetMaxRounds() m.ResetMaxRounds()
return nil return nil
case match.FieldRounds:
m.ResetRounds()
return nil
case match.FieldDemoExpired: case match.FieldDemoExpired:
m.ResetDemoExpired() m.ResetDemoExpired()
return nil return nil

View File

@@ -16,11 +16,11 @@ func init() {
matchFields := schema.Match{}.Fields() matchFields := schema.Match{}.Fields()
_ = matchFields _ = matchFields
// matchDescDemoExpired is the schema descriptor for demo_expired field. // matchDescDemoExpired is the schema descriptor for demo_expired field.
matchDescDemoExpired := matchFields[11].Descriptor() matchDescDemoExpired := matchFields[10].Descriptor()
// match.DefaultDemoExpired holds the default value on creation for the demo_expired field. // match.DefaultDemoExpired holds the default value on creation for the demo_expired field.
match.DefaultDemoExpired = matchDescDemoExpired.Default.(bool) match.DefaultDemoExpired = matchDescDemoExpired.Default.(bool)
// matchDescDemoParsed is the schema descriptor for demo_parsed field. // matchDescDemoParsed is the schema descriptor for demo_parsed field.
matchDescDemoParsed := matchFields[12].Descriptor() matchDescDemoParsed := matchFields[11].Descriptor()
// match.DefaultDemoParsed holds the default value on creation for the demo_parsed field. // match.DefaultDemoParsed holds the default value on creation for the demo_parsed field.
match.DefaultDemoParsed = matchDescDemoParsed.Default.(bool) match.DefaultDemoParsed = matchDescDemoParsed.Default.(bool)
playerFields := schema.Player{}.Fields() playerFields := schema.Player{}.Fields()

View File

@@ -24,7 +24,6 @@ func (Match) Fields() []ent.Field {
field.Int("duration"), field.Int("duration"),
field.Int("match_result"), field.Int("match_result"),
field.Int("max_rounds"), field.Int("max_rounds"),
field.Int("rounds"),
field.Bool("demo_expired").Default(false), field.Bool("demo_expired").Default(false),
field.Bool("demo_parsed").Default(false), field.Bool("demo_parsed").Default(false),
field.JSON("eco", struct { field.JSON("eco", struct {

View File

@@ -66,7 +66,6 @@ type MatchResponse struct {
Duration int `json:"duration"` Duration int `json:"duration"`
MatchResult int `json:"match_result"` MatchResult int `json:"match_result"`
MaxRounds int `json:"max_rounds,omitempty"` MaxRounds int `json:"max_rounds,omitempty"`
Rounds int `json:"rounds"`
Parsed bool `json:"parsed"` Parsed bool `json:"parsed"`
Stats []*StatsResponse `json:"stats"` Stats []*StatsResponse `json:"stats"`
} }
@@ -216,7 +215,6 @@ func getPlayer(w http.ResponseWriter, r *http.Request) {
Duration: iMatch.Duration, Duration: iMatch.Duration,
MatchResult: iMatch.MatchResult, MatchResult: iMatch.MatchResult,
MaxRounds: iMatch.MaxRounds, MaxRounds: iMatch.MaxRounds,
Rounds: iMatch.Rounds,
Parsed: iMatch.DemoParsed, Parsed: iMatch.DemoParsed,
Stats: []*StatsResponse{}, Stats: []*StatsResponse{},
} }
@@ -353,7 +351,6 @@ func getMatch(w http.ResponseWriter, r *http.Request) {
Duration: tMatch.Duration, Duration: tMatch.Duration,
MatchResult: tMatch.MatchResult, MatchResult: tMatch.MatchResult,
MaxRounds: tMatch.MaxRounds, MaxRounds: tMatch.MaxRounds,
Rounds: tMatch.Rounds,
Parsed: tMatch.DemoParsed, Parsed: tMatch.DemoParsed,
Stats: []*StatsResponse{}, Stats: []*StatsResponse{},
} }

View File

@@ -378,7 +378,6 @@ func GCInfoParser(channel chan *csgo.Demo, dl *csgo.DemoMatchLoader, dp *csgo.De
SetID(matchZero.GetMatchid()). SetID(matchZero.GetMatchid()).
AddPlayers(players...). AddPlayers(players...).
SetDate(time.Unix(int64(matchZero.GetMatchtime()), 0).UTC()). SetDate(time.Unix(int64(matchZero.GetMatchtime()), 0).UTC()).
SetRounds(len(matchZero.Roundstatsall)).
SetMaxRounds(int(lastRound.GetMaxRounds())). SetMaxRounds(int(lastRound.GetMaxRounds())).
SetDuration(int(lastRound.GetMatchDuration())). SetDuration(int(lastRound.GetMatchDuration())).
SetShareCode(demo.ShareCode). SetShareCode(demo.ShareCode).