123 caseInsensitiveCompare a b = upperCase a == upperCase b |
125 caseInsensitiveCompare a b = upperCase a == upperCase b |
124 |
126 |
125 upperCase :: B.ByteString -> B.ByteString |
127 upperCase :: B.ByteString -> B.ByteString |
126 upperCase = UTF8.fromString . map Char.toUpper . UTF8.toString |
128 upperCase = UTF8.fromString . map Char.toUpper . UTF8.toString |
127 |
129 |
128 roomInfo :: B.ByteString -> RoomInfo -> [B.ByteString] |
130 roomInfo :: Word16 -> B.ByteString -> RoomInfo -> [B.ByteString] |
129 roomInfo n r = [ |
131 roomInfo p n r |
|
132 | p < 46 = [ |
130 showB $ isJust $ gameInfo r, |
133 showB $ isJust $ gameInfo r, |
131 name r, |
134 name r, |
132 showB $ playersIn r, |
135 showB $ playersIn r, |
133 showB $ length $ teams r, |
136 showB $ length $ teams r, |
134 n, |
137 n, |
135 Map.findWithDefault "+rnd+" "MAP" (mapParams r), |
138 Map.findWithDefault "+rnd+" "MAP" (mapParams r), |
136 head (Map.findWithDefault ["Default"] "SCHEME" (params r)), |
139 head (Map.findWithDefault ["Default"] "SCHEME" (params r)), |
137 head (Map.findWithDefault ["Default"] "AMMO" (params r)) |
140 head (Map.findWithDefault ["Default"] "AMMO" (params r)) |
138 ] |
141 ] |
139 |
142 | otherwise = [ |
|
143 showB $ isJust $ gameInfo r, |
|
144 name r, |
|
145 showB $ playersIn r, |
|
146 showB $ length $ teams r, |
|
147 n, |
|
148 Map.findWithDefault "+rnd+" "MAP" (mapParams r), |
|
149 head (Map.findWithDefault ["Normal"] "SCRIPT" (params r)), |
|
150 head (Map.findWithDefault ["Default"] "SCHEME" (params r)), |
|
151 head (Map.findWithDefault ["Default"] "AMMO" (params r)) |
|
152 ] |
140 |
153 |
141 answerFullConfigParams :: |
154 answerFullConfigParams :: |
142 ClientInfo |
155 ClientInfo |
143 -> Map.Map B.ByteString B.ByteString |
156 -> Map.Map B.ByteString B.ByteString |
144 -> Map.Map B.ByteString [B.ByteString] |
157 -> Map.Map B.ByteString [B.ByteString] |