about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/challenge.go6
-rw-r--r--src/http.go2
-rw-r--r--src/seed.go5
3 files changed, 8 insertions, 5 deletions
diff --git a/src/challenge.go b/src/challenge.go
index 991e4e5..f0028ca 100644
--- a/src/challenge.go
+++ b/src/challenge.go
@@ -1,10 +1,12 @@
 package main
 
+import "time"
+
 type Challenge struct {
 	Name string
 	Description string
 	Flag string // this should never leave the server
-	FoundFlag bool
+	FoundFlag time.Time
 	FlagTries uint
 	Container string // this could, but is not required as well
 	Category string
@@ -25,7 +27,7 @@ func stripChallenge(c Challenge) (StrippedChallenge) {
 		Name: c.Name,
 		Description: c.Description,
 		Category: c.Category,
-		FoundFlag: c.FoundFlag,
+		FoundFlag: c.FoundFlag != time.Unix(0, 0),
 		ContainsLaunchable: c.Container != "",
 		IPAddress: getAddressForChallengeContainer(c.Container),
 	}
diff --git a/src/http.go b/src/http.go
index 1e60046..6ad5b5e 100644
--- a/src/http.go
+++ b/src/http.go
@@ -232,7 +232,7 @@ func submitFlagHandler(w http.ResponseWriter, r *http.Request) {
 
 					if challenge.Flag == flag {
 						// our user found the flag \o/
-						challenges[index].FoundFlag = true
+						challenges[index].FoundFlag = time.Now()
 						correctFlag = true
 					} else {
 						// ow, bummer :(
diff --git a/src/seed.go b/src/seed.go
index 3dce55f..af14d38 100644
--- a/src/seed.go
+++ b/src/seed.go
@@ -1,12 +1,13 @@
 package main
 
 import (
+	"encoding/json"
 	"flag"
 	"fmt"
 	"github.com/pkg/errors"
 	"io/ioutil"
 	"log"
-	"encoding/json"
+	"time"
 )
 
 var (
@@ -54,7 +55,7 @@ func readSeedFile(path string) ([]Challenge, error) {
 				Name: name,
 				Description: desc,
 				Flag: flag,
-				FoundFlag: false,
+				FoundFlag: time.Unix(0, 0),
 				FlagTries: 0,
 				Container: cont,
 				Category: category,