From e4637ddf366231de52c05d0092ff8ea8583a1601 Mon Sep 17 00:00:00 2001 From: maride Date: Sun, 6 Oct 2019 15:53:20 +0200 Subject: Correctly deliver timestamp and not bool; fix 'flagTries' raise problem --- src/challenge.go | 6 ++++-- src/http.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/challenge.go b/src/challenge.go index f0028ca..0203378 100644 --- a/src/challenge.go +++ b/src/challenge.go @@ -17,7 +17,8 @@ type StrippedChallenge struct { Name string `json:"name"` Description string `json:"description"` Category string `json:"category"` - FoundFlag bool `json:"foundFlag"` + FoundFlag int64 `json:"foundFlag"` + FlagTries uint `json:"flagTries"` ContainsLaunchable bool `json:"ContainsLaunchable"` IPAddress string `json:"IPAddress"` } @@ -27,7 +28,8 @@ func stripChallenge(c Challenge) (StrippedChallenge) { Name: c.Name, Description: c.Description, Category: c.Category, - FoundFlag: c.FoundFlag != time.Unix(0, 0), + FoundFlag: c.FoundFlag.Unix(), + FlagTries: c.FlagTries, ContainsLaunchable: c.Container != "", IPAddress: getAddressForChallengeContainer(c.Container), } diff --git a/src/http.go b/src/http.go index 6ad5b5e..6feeb33 100644 --- a/src/http.go +++ b/src/http.go @@ -236,7 +236,7 @@ func submitFlagHandler(w http.ResponseWriter, r *http.Request) { correctFlag = true } else { // ow, bummer :( - challenge.FlagTries++ + challenges[index].FlagTries++ } break } -- cgit 1.4.1