gameServer/HWProtoLobbyState.hs
changeset 3645 c0b3f1bb9316
parent 3566 772a46ef8288
child 4242 5e3c5fe2cb14
equal deleted inserted replaced
3644:42c5684289ae 3645:c0b3f1bb9316
    52 
    52 
    53 handleCmd_lobby ["CREATE_ROOM", newRoom, roomPassword]
    53 handleCmd_lobby ["CREATE_ROOM", newRoom, roomPassword]
    54     | illegalName newRoom = return [Warning "Illegal room name"]
    54     | illegalName newRoom = return [Warning "Illegal room name"]
    55     | otherwise = do
    55     | otherwise = do
    56         rs <- allRoomInfos
    56         rs <- allRoomInfos
    57         (ci, irnc) <- ask
    57         cl <- thisClient
    58         let cl =  irnc `client` ci
       
    59         return $ if isJust $ find (\room -> newRoom == name room) rs then 
    58         return $ if isJust $ find (\room -> newRoom == name room) rs then 
    60             [Warning "Room exists"]
    59             [Warning "Room exists"]
    61             else
    60             else
    62             [
    61             [
    63                 AddRoom newRoom roomPassword,
    62                 AddRoom newRoom roomPassword,