about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/challenge.go6
-rw-r--r--src/http.go2
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
 				}