Also convert teams to complete game config.
authorunc0rr
Sat, 09 Feb 2013 00:11:14 +0400
changeset 8483 d5fd4d7a0bcc
parent 8482 5656a73fe3c3
child 8484 99c14f14f788
Also convert teams to complete game config. The whole feature is still untested at all.
gameServer/EngineInteraction.hs
--- a/gameServer/EngineInteraction.hs	Fri Feb 08 23:38:14 2013 +0400
+++ b/gameServer/EngineInteraction.hs	Sat Feb 09 00:11:14 2013 +0400
@@ -56,6 +56,7 @@
         , mapgenSpecific
         , concatMap teamSetup teams
         , msgs
+        , [em "!"]
         ]
     where
         em = toEngineMsg
@@ -77,12 +78,18 @@
         ammoStr :: B.ByteString
         ammoStr = head . tail $ params Map.! "AMMO"
         ammo = let l = B.length ammoStr `div` 4; ((a, b), (c, d)) = (B.splitAt l . fst &&& B.splitAt l . snd) . B.splitAt (l * 2) $ ammoStr in
-                   map (\(x, y) -> eml [x, " ", y]) $ zip ["eammloadt", "eammprob", "eammdelay", "eammreinf"] [a, b, c, d]
+                   (map (\(x, y) -> eml [x, " ", y]) $ zip ["eammloadt", "eammprob", "eammdelay", "eammreinf"] [a, b, c, d])
+                   ++ [em "eammstore" | scheme !! 14 == "true" || scheme !! 20 == "false"]
+        initHealth = scheme !! 27
         teamSetup :: TeamInfo -> [B.ByteString]
-        teamSetup _ = ammo
+        teamSetup t = 
+                eml ["eaddteam ", teamcolor t, " ", teamowner t, " <hash>"]
+                : em "erdriven"
+                : eml ["efort ", teamfort t]
+                : replicate (hhnum t) (eml ["eaddhh 0 ", initHealth, " hedgehog"])
 
 drawnMapData :: B.ByteString -> [B.ByteString]
-drawnMapData = undefined
+drawnMapData = error "drawnMapData"
 
 schemeParams :: [(B.ByteString, Int)]
 schemeParams = [