gameServer/Utils.hs
author sheepluva
Sat, 28 Apr 2012 09:25:30 +0200
changeset 6946 576c453822bf
parent 6541 08ed346ed341
child 6981 045e8162c9cd
permissions -rw-r--r--
fix for issue #186 ("Screen gets messed up when selecting Hand Drawn Map")
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4295
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
     1
{-# LANGUAGE OverloadedStrings #-}
1804
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
     2
module Utils where
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
     3
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
     4
import Data.Char
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
     5
import Data.Word
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
     6
import qualified Data.Map as Map
2304
a6e733ad0366 Implement filtering in server
unc0rr
parents: 2150
diff changeset
     7
import qualified Data.Set as Set
6191
190a8e5d9956 Case-insensitive comparison of nicks
unc0rr
parents: 6068
diff changeset
     8
import qualified Data.Char as Char
1917
c94045b70142 - Better ip2string implementation
unc0rr
parents: 1804
diff changeset
     9
import Numeric
c94045b70142 - Better ip2string implementation
unc0rr
parents: 1804
diff changeset
    10
import Network.Socket
1964
dc9ea05c9d2f - Another way of defining official server
unc0rr
parents: 1953
diff changeset
    11
import System.IO
1917
c94045b70142 - Better ip2string implementation
unc0rr
parents: 1804
diff changeset
    12
import qualified Data.List as List
2349
ba7a0813c532 Some fixes suggested by hlint
unc0rr
parents: 2310
diff changeset
    13
import Control.Monad
1804
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    14
import qualified Codec.Binary.Base64 as Base64
5030
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
    15
import qualified Data.ByteString.Lazy as BL
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
    16
import qualified Text.Show.ByteString as BS
4295
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    17
import qualified Data.ByteString.Char8 as B
6191
190a8e5d9956 Case-insensitive comparison of nicks
unc0rr
parents: 6068
diff changeset
    18
import qualified Data.ByteString.UTF8 as UTF8
4295
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    19
import qualified Data.ByteString as BW
6541
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
    20
import Data.Maybe
4975
31da8979e5b1 Use Data.TConfig to read and store server config in hedgewars.ini (a little bit of hate to the author for not exporting Conf type)
unc0rr
parents: 4972
diff changeset
    21
-------------------------------------------------
1804
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    22
import CoreTypes
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    23
1917
c94045b70142 - Better ip2string implementation
unc0rr
parents: 1804
diff changeset
    24
4295
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    25
sockAddr2String :: SockAddr -> IO B.ByteString
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    26
sockAddr2String (SockAddrInet _ hostAddr) = liftM B.pack $ inet_ntoa hostAddr
1917
c94045b70142 - Better ip2string implementation
unc0rr
parents: 1804
diff changeset
    27
sockAddr2String (SockAddrInet6 _ _ (a, b, c, d) _) =
4295
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    28
    return $ B.pack $ (foldr1 (.)
4932
f11d80bac7ed - Take into account hlint suggestions
unc0rr
parents: 4921
diff changeset
    29
        $ List.intersperse (':':)
f11d80bac7ed - Take into account hlint suggestions
unc0rr
parents: 4921
diff changeset
    30
        $ concatMap (\n -> (\(a0, a1) -> [showHex a0, showHex a1]) $ divMod n 65536) [a, b, c, d]) []
1917
c94045b70142 - Better ip2string implementation
unc0rr
parents: 1804
diff changeset
    31
1804
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    32
maybeRead :: Read a => String -> Maybe a
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    33
maybeRead s = case reads s of
2867
9be6693c78cb - Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents: 2747
diff changeset
    34
    [(x, rest)] | all isSpace rest -> Just x
9be6693c78cb - Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents: 2747
diff changeset
    35
    _         -> Nothing
1804
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    36
4295
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    37
teamToNet :: TeamInfo -> [B.ByteString]
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    38
teamToNet team =
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    39
        "ADD_TEAM"
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    40
        : teamname team
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    41
        : teamgrave team
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    42
        : teamfort team
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    43
        : teamvoicepack team
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    44
        : teamflag team
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    45
        : teamowner team
5030
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
    46
        : (showB . difficulty $ team)
4295
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    47
        : hhsInfo
2867
9be6693c78cb - Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents: 2747
diff changeset
    48
    where
4932
f11d80bac7ed - Take into account hlint suggestions
unc0rr
parents: 4921
diff changeset
    49
        hhsInfo = concatMap (\(HedgehogInfo n hat) -> [n, hat]) $ hedgehogs team
1804
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    50
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    51
modifyTeam :: TeamInfo -> RoomInfo -> RoomInfo
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    52
modifyTeam team room = room{teams = replaceTeam team $ teams room}
2867
9be6693c78cb - Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents: 2747
diff changeset
    53
    where
9be6693c78cb - Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents: 2747
diff changeset
    54
    replaceTeam _ [] = error "modifyTeam: no such team"
4932
f11d80bac7ed - Take into account hlint suggestions
unc0rr
parents: 4921
diff changeset
    55
    replaceTeam tm (t:ts) =
f11d80bac7ed - Take into account hlint suggestions
unc0rr
parents: 4921
diff changeset
    56
        if teamname tm == teamname t then
f11d80bac7ed - Take into account hlint suggestions
unc0rr
parents: 4921
diff changeset
    57
            tm : ts
2867
9be6693c78cb - Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents: 2747
diff changeset
    58
        else
4932
f11d80bac7ed - Take into account hlint suggestions
unc0rr
parents: 4921
diff changeset
    59
            t : replaceTeam tm ts
1804
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    60
4295
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    61
illegalName :: B.ByteString -> Bool
5269
e32fc0fcaad0 Implement testing for illegal characters
unc0rr
parents: 5060
diff changeset
    62
illegalName s = B.null s || B.all isSpace s || isSpace (B.head s) || isSpace (B.last s) || B.any isIllegalChar s
e32fc0fcaad0 Implement testing for illegal characters
unc0rr
parents: 5060
diff changeset
    63
    where
e32fc0fcaad0 Implement testing for illegal characters
unc0rr
parents: 5060
diff changeset
    64
        isIllegalChar c = c `List.elem` "$()*+?[]^{|}"
2150
45b695f3a7b9 Forbid room names and nicknames consisting only of space characters
unc0rr
parents: 2113
diff changeset
    65
4295
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
    66
protoNumber2ver :: Word16 -> B.ByteString
4569
a835465b4fd2 Convert function to a map
unc0rr
parents: 4337
diff changeset
    67
protoNumber2ver v = Map.findWithDefault "Unknown" v vermap
a835465b4fd2 Convert function to a map
unc0rr
parents: 4337
diff changeset
    68
    where
a835465b4fd2 Convert function to a map
unc0rr
parents: 4337
diff changeset
    69
        vermap = Map.fromList [
4936
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    70
            (17, "0.9.7-dev")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    71
            , (19, "0.9.7")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    72
            , (20, "0.9.8-dev")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    73
            , (21, "0.9.8")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    74
            , (22, "0.9.9-dev")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    75
            , (23, "0.9.9")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    76
            , (24, "0.9.10-dev")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    77
            , (25, "0.9.10")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    78
            , (26, "0.9.11-dev")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    79
            , (27, "0.9.11")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    80
            , (28, "0.9.12-dev")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    81
            , (29, "0.9.12")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    82
            , (30, "0.9.13-dev")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    83
            , (31, "0.9.13")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    84
            , (32, "0.9.14-dev")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    85
            , (33, "0.9.14")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    86
            , (34, "0.9.15-dev")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    87
            , (35, "0.9.14.1")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    88
            , (37, "0.9.15")
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    89
            , (38, "0.9.16-dev")
5880
a6573cc5903e Add 0.9.16 and 0.9.17-dev version info to server
unc0rr
parents: 5269
diff changeset
    90
            , (39, "0.9.16")
a6573cc5903e Add 0.9.16 and 0.9.17-dev version info to server
unc0rr
parents: 5269
diff changeset
    91
            , (40, "0.9.17-dev")
6370
fb9aeddcb046 Make server know release version
unc0rr
parents: 6191
diff changeset
    92
            , (41, "0.9.17")
fb9aeddcb046 Make server know release version
unc0rr
parents: 6191
diff changeset
    93
            , (42, "0.9.18-dev")
4936
d65d438acd23 Merge MAP, MAPGEN and SEED params into one on room join, so engine isn't spawned three times for a preview. Not tested as I'm unable to see my rooms (why?)
unc0rr
parents: 4932
diff changeset
    94
            ]
1804
4e78ad846fb6 New game server:
unc0rr
parents:
diff changeset
    95
4921
2efad3acbb74 Fix build of official server
unc0rr
parents: 4904
diff changeset
    96
askFromConsole :: B.ByteString -> IO B.ByteString
1964
dc9ea05c9d2f - Another way of defining official server
unc0rr
parents: 1953
diff changeset
    97
askFromConsole msg = do
4921
2efad3acbb74 Fix build of official server
unc0rr
parents: 4904
diff changeset
    98
    B.putStr msg
2867
9be6693c78cb - Unbreak support for client versions prior to 0.9.13-dev
unc0rr
parents: 2747
diff changeset
    99
    hFlush stdout
4921
2efad3acbb74 Fix build of official server
unc0rr
parents: 4904
diff changeset
   100
    B.getLine
4295
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
   101
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
   102
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
   103
unfoldrE :: (b -> Either b (a, b)) -> b -> ([a], b)
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
   104
unfoldrE f b  =
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
   105
    case f b of
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
   106
        Right (a, new_b) -> let (a', b') = unfoldrE f new_b in (a : a', b')
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
   107
        Left new_b       -> ([], new_b)
1f5604cd99be This revision should, in theory, correctly merge 0.9.14 and tip, so that future merges of 0.9.14 should work properly
nemo
parents: 4242
diff changeset
   108
5030
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
   109
showB :: (BS.Show a) => a -> B.ByteString
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
   110
showB = B.concat . BL.toChunks . BS.show
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
   111
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
   112
readInt_ :: (Num a) => B.ByteString -> a
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
   113
readInt_ str =
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
   114
  case B.readInt str of
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
   115
       Just (i, t) | B.null t -> fromIntegral i
42746c5d4a80 Changed the standard show function to Text.Show.ByteString, and misc.
EJ <eivind.jahren@gmail.com>
parents: 4975
diff changeset
   116
       _                      -> 0 
5060
7d0f6e5b1c1c Hide last two octets of IP address from usual users
unc0rr
parents: 5030
diff changeset
   117
7d0f6e5b1c1c Hide last two octets of IP address from usual users
unc0rr
parents: 5030
diff changeset
   118
cutHost :: B.ByteString -> B.ByteString
7d0f6e5b1c1c Hide last two octets of IP address from usual users
unc0rr
parents: 5030
diff changeset
   119
cutHost = B.intercalate "." .  flip (++) ["*","*"] . List.take 2 . B.split '.'
6191
190a8e5d9956 Case-insensitive comparison of nicks
unc0rr
parents: 6068
diff changeset
   120
190a8e5d9956 Case-insensitive comparison of nicks
unc0rr
parents: 6068
diff changeset
   121
caseInsensitiveCompare :: B.ByteString -> B.ByteString -> Bool
190a8e5d9956 Case-insensitive comparison of nicks
unc0rr
parents: 6068
diff changeset
   122
caseInsensitiveCompare a b = f a == f b
190a8e5d9956 Case-insensitive comparison of nicks
unc0rr
parents: 6068
diff changeset
   123
    where
190a8e5d9956 Case-insensitive comparison of nicks
unc0rr
parents: 6068
diff changeset
   124
        f = map Char.toUpper . UTF8.toString
6541
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   125
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   126
roomInfo n r 
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   127
    | isRestrictedJoins r = []
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   128
    | otherwise = [
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   129
        showB $ isJust $ gameInfo r,
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   130
        name r,
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   131
        showB $ playersIn r,
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   132
        showB $ length $ teams r,
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   133
        n,
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   134
        Map.findWithDefault "+rnd+" "MAP" (mapParams r),
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   135
        head (Map.findWithDefault ["Default"] "SCHEME" (params r)),
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   136
        head (Map.findWithDefault ["Default"] "AMMO" (params r))
08ed346ed341 Send full room info on room add and update events. Less(?) traffic, but current frontend doesn't behave good with this change to server.
unc0rr
parents: 6370
diff changeset
   137
        ]