gameServer/Utils.hs
changeset 10511 c33b2f001730
parent 10460 8dcea9087d75
child 10524 2bc0ff00e95b
equal deleted inserted replaced
10510:9329dab04490 10511:c33b2f001730
   156         n,
   156         n,
   157         Map.findWithDefault "+rnd+" "MAP" (mapParams r),
   157         Map.findWithDefault "+rnd+" "MAP" (mapParams r),
   158         head (Map.findWithDefault ["Default"] "SCHEME" (params r)),
   158         head (Map.findWithDefault ["Default"] "SCHEME" (params r)),
   159         head (Map.findWithDefault ["Default"] "AMMO" (params r))
   159         head (Map.findWithDefault ["Default"] "AMMO" (params r))
   160         ]
   160         ]
   161     | otherwise = [
   161     | p < 48 = [
   162         showB $ isJust $ gameInfo r,
   162         showB $ isJust $ gameInfo r,
   163         name r,
   163         name r,
   164         showB $ playersIn r,
   164         showB $ playersIn r,
   165         showB $ length $ teams r,
   165         showB $ length $ teams r,
   166         n,
   166         n,
   167         Map.findWithDefault "+rnd+" "MAP" (mapParams r),
   167         Map.findWithDefault "+rnd+" "MAP" (mapParams r),
   168         head (Map.findWithDefault ["Normal"] "SCRIPT" (params r)),
   168         head (Map.findWithDefault ["Normal"] "SCRIPT" (params r)),
   169         head (Map.findWithDefault ["Default"] "SCHEME" (params r)),
   169         head (Map.findWithDefault ["Default"] "SCHEME" (params r)),
   170         head (Map.findWithDefault ["Default"] "AMMO" (params r))
   170         head (Map.findWithDefault ["Default"] "AMMO" (params r))
   171         ]
   171         ]
       
   172     | otherwise = [
       
   173         B.pack roomFlags,
       
   174         name r,
       
   175         showB $ playersIn r,
       
   176         showB $ length $ teams r,
       
   177         n,
       
   178         Map.findWithDefault "+rnd+" "MAP" (mapParams r),
       
   179         head (Map.findWithDefault ["Normal"] "SCRIPT" (params r)),
       
   180         head (Map.findWithDefault ["Default"] "SCHEME" (params r)),
       
   181         head (Map.findWithDefault ["Default"] "AMMO" (params r))
       
   182         ]
       
   183     where
       
   184         roomFlags = concat [
       
   185             "-"
       
   186             , ['g' | isJust $ gameInfo r]
       
   187             , ['p' | B.null $ password r]
       
   188             , ['j' | isRestrictedJoins  r]
       
   189             , ['r' | isRegisteredOnly  r]
       
   190             ]
   172 
   191 
   173 answerFullConfigParams ::
   192 answerFullConfigParams ::
   174             ClientInfo
   193             ClientInfo
   175             -> Map.Map B.ByteString B.ByteString
   194             -> Map.Map B.ByteString B.ByteString
   176             -> Map.Map B.ByteString [B.ByteString]
   195             -> Map.Map B.ByteString [B.ByteString]