--- a/gameServer/Utils.hs Thu Dec 29 09:40:16 2011 +0100
+++ b/gameServer/Utils.hs Thu Dec 29 23:02:40 2011 +0300
@@ -17,6 +17,7 @@
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.UTF8 as UTF8
import qualified Data.ByteString as BW
+import Data.Maybe
-------------------------------------------------
import CoreTypes
@@ -121,3 +122,16 @@
caseInsensitiveCompare a b = f a == f b
where
f = map Char.toUpper . UTF8.toString
+
+roomInfo n r
+ | isRestrictedJoins r = []
+ | otherwise = [
+ showB $ isJust $ gameInfo r,
+ name r,
+ showB $ playersIn r,
+ showB $ length $ teams r,
+ n,
+ Map.findWithDefault "+rnd+" "MAP" (mapParams r),
+ head (Map.findWithDefault ["Default"] "SCHEME" (params r)),
+ head (Map.findWithDefault ["Default"] "AMMO" (params r))
+ ]