about summary refs log tree commit diff
path: root/src/challenge.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/challenge.go')
-rw-r--r--src/challenge.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/challenge.go b/src/challenge.go
index 0203378..1d0a210 100644
--- a/src/challenge.go
+++ b/src/challenge.go
@@ -23,6 +23,12 @@ type StrippedChallenge struct {
 	IPAddress string `json:"IPAddress"`
 }
 
+type StatsStrippedChallenge struct {
+	Name string `json:"name"`
+	FoundFlag int64 `json:"foundFlag"`
+	FlagTries uint `json:"flagTries"`
+}
+
 func stripChallenge(c Challenge) (StrippedChallenge) {
 	return StrippedChallenge{
 		Name: c.Name,
@@ -34,3 +40,11 @@ func stripChallenge(c Challenge) (StrippedChallenge) {
 		IPAddress: getAddressForChallengeContainer(c.Container),
 	}
 }
+
+func stripChallengeForStatistics(c Challenge) (StatsStrippedChallenge) {
+	return StatsStrippedChallenge{
+		Name: c.Name,
+		FoundFlag: c.FoundFlag.Unix(),
+		FlagTries: c.FlagTries,
+	}
+}