Include ID and dependancy in zqds file
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
53e70b1eba
commit
1313f2caf9
|
@ -7,11 +7,13 @@ import (
|
|||
)
|
||||
|
||||
type ChallengeZQDS struct {
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Category string `json:"category"`
|
||||
Points int64 `json:"points"`
|
||||
State string `json:"state"`
|
||||
LockedBy []int64 `json:"locked_by,omitempty"`
|
||||
FirstBloodBonus []float64 `json:"first_blood_bonus,omitempty"`
|
||||
Description string `json:"description"`
|
||||
Flags []string `json:"flags,omitempty"`
|
||||
|
@ -43,12 +45,22 @@ func GenZQDSSessionFile(c *settings.ChallengeInfo, s *settings.Settings) (*Sessi
|
|||
}
|
||||
|
||||
for _, ex := range exos {
|
||||
state := "visible"
|
||||
lockedby := []int64{}
|
||||
|
||||
if ex.Depend != nil {
|
||||
state = "locked"
|
||||
lockedby = append(lockedby, *ex.Depend)
|
||||
}
|
||||
|
||||
challenges = append(challenges, &ChallengeZQDS{
|
||||
ID: ex.Id,
|
||||
Name: ex.Title,
|
||||
Type: "first_blood",
|
||||
Category: th.Name,
|
||||
Points: ex.Gain,
|
||||
State: "visible",
|
||||
State: state,
|
||||
LockedBy: lockedby,
|
||||
FirstBloodBonus: []float64{
|
||||
float64(ex.Gain) * (1 + s.FirstBlood),
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue