gameServer/EngineInteraction.hs
changeset 10343 fe9853dea6c4
parent 10067 8df84ec62600
child 10460 8dcea9087d75
equal deleted inserted replaced
10342:16122539d2ea 10343:fe9853dea6c4
    65         lft = foldr l Nothing
    65         lft = foldr l Nothing
    66         l m n = let m' = B.head $ B.tail m; tst = flip Set.member in
    66         l m n = let m' = B.head $ B.tail m; tst = flip Set.member in
    67                       if not $ tst timedMessages m' then n
    67                       if not $ tst timedMessages m' then n
    68                         else if '+' /= m' then Just Nothing else Just . Just . B.pack . Base64.encode . BW.unpack $ m
    68                         else if '+' /= m' then Just Nothing else Just . Just . B.pack . Base64.encode . BW.unpack $ m
    69         isNonEmpty = (/=) '+' . B.head . B.tail
    69         isNonEmpty = (/=) '+' . B.head . B.tail
    70         legalMessages = Set.fromList $ "M#+LlRrUuDdZzAaSjJ,sNpPwtghbc12345" ++ slotMessages
    70         legalMessages = Set.fromList $ "M#+LlRrUuDdZzAaSjJ,sNpPwtgfhbc12345" ++ slotMessages
    71         slotMessages = "\128\129\130\131\132\133\134\135\136\137\138"
    71         slotMessages = "\128\129\130\131\132\133\134\135\136\137\138"
    72         timedMessages = Set.fromList $ "+LlRrUuDdZzAaSjJ,NpPwtgc12345" ++ slotMessages
    72         timedMessages = Set.fromList $ "+LlRrUuDdZzAaSjJ,NpPwtgfc12345" ++ slotMessages
    73 
    73 
    74 replayToDemo :: [TeamInfo]
    74 replayToDemo :: [TeamInfo]
    75         -> Map.Map B.ByteString B.ByteString
    75         -> Map.Map B.ByteString B.ByteString
    76         -> Map.Map B.ByteString [B.ByteString]
    76         -> Map.Map B.ByteString [B.ByteString]
    77         -> [B.ByteString]
    77         -> [B.ByteString]