Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

parse live info, CTF

  • Loading branch information...
commit 0a7d4ccace3ea4bb16f581b05b8286f4e5cf6a09 1 parent eff20b3
@dalkvist authored
Showing with 24 additions and 13 deletions.
  1. +24 −13 src/bf3/live.clj
View
37 src/bf3/live.clj
@@ -112,19 +112,30 @@
(map #(Integer/parseInt % 16))
(zipmap [:current :max])))))
flatten (apply hash-map))
- (->> infos
- (#(if (re-find #"rush" (s/lower-case gameMode))
- (vector (take 2 (drop 2 %)) (take 2 (drop 4 %))
- (take 1 (drop (+ 2 (/ l 2)) %))
- (take 1 (drop (+ 3 (/ l 2)) %)))
- (vector (take 2 (drop 1 %)) (take 2 (drop 3 %))
- (take 2 (drop (+ 1 (/ l 2)) %))
- (take 2 (drop (+ 3 (/ l 2)) %)))))
- (map #(reduce str %))
- (map #(if (empty? %) 0 (Integer/parseInt % 16)))
- (partition-all 2)
- (map #(zipmap [:current :max ] %))
- (zipmap [:1 :2])))})
+ (if (re-find #"capturetheflag" (s/lower-case gameMode))
+ (->> infos (#(vector (take 2 (drop 1 %)) (take 2 (drop 3 %))
+ (take 2 (drop 5 %))
+ (take 2 (drop (+ 1 (/ l 2)) %))
+ (take 2 (drop (+ 3 (/ l 2)) %))
+ (take 2 (drop (+ 5 (/ l 2)) %))))
+ (map #(reduce str %))
+ (map #(if (empty? %) 0 (Integer/parseInt % 16)))
+ (partition-all 3)
+ (map #(zipmap [:current :max :max-duration] %))
+ (zipmap [:1 :2]))
+ (->> infos
+ (#(if (re-find #"rush" (s/lower-case gameMode))
+ (vector (take 2 (drop 2 %)) (take 2 (drop 4 %))
+ (take 1 (drop (+ 2 (/ l 2)) %))
+ (take 1 (drop (+ 3 (/ l 2)) %)))
+ (vector (take 2 (drop 1 %)) (take 2 (drop 3 %))
+ (take 2 (drop (+ 1 (/ l 2)) %))
+ (take 2 (drop (+ 3 (/ l 2)) %)))))
+ (map #(reduce str %))
+ (map #(if (empty? %) 0 (Integer/parseInt % 16)))
+ (partition-all 2)
+ (map #(zipmap [:current :max ] %))
+ (zipmap [:1 :2]))))})
(catch Exception e
(println "score error" e)))
postinfo (->> postmode (drop (+ 2 (Integer/parseInt (first (drop 1 postmode)) 16))))
Please sign in to comment.
Something went wrong with that request. Please try again.