equal
deleted
inserted
replaced
59 let jRoomClients = map (client irnc) $ roomClients irnc jRI |
59 let jRoomClients = map (client irnc) $ roomClients irnc jRI |
60 let nicks = map nick jRoomClients |
60 let nicks = map nick jRoomClients |
61 let owner = find isMaster jRoomClients |
61 let owner = find isMaster jRoomClients |
62 let chans = map sendChan (cl : jRoomClients) |
62 let chans = map sendChan (cl : jRoomClients) |
63 let isBanned = host cl `elem` roomBansList jRoom |
63 let isBanned = host cl `elem` roomBansList jRoom |
|
64 let hasTeamsInGame = (isJust $ gameInfo jRoom) && (or . map (\t -> teamowner t == nick cl) . teamsAtStart . fromJust $ gameInfo jRoom) |
64 return $ |
65 return $ |
65 if isNothing maybeRI then |
66 if isNothing maybeRI then |
66 [Warning $ loc "No such room"] |
67 [Warning $ loc "No such room"] |
67 else if (not sameProto) && (not $ isAdministrator cl) then |
68 else if (not sameProto) && (not $ isAdministrator cl) then |
68 [Warning $ loc "Room version incompatible to your hedgewars version"] |
69 [Warning $ loc "Room version incompatible to your hedgewars version"] |
85 ++ [sendStateFlags cl jRoomClients | not $ null jRoomClients] |
86 ++ [sendStateFlags cl jRoomClients | not $ null jRoomClients] |
86 ++ answerFullConfig cl jRoom |
87 ++ answerFullConfig cl jRoom |
87 ++ answerTeams cl jRoom |
88 ++ answerTeams cl jRoom |
88 ++ watchRound cl jRoom chans |
89 ++ watchRound cl jRoom chans |
89 ++ [AnswerClients [sendChan cl] ["CHAT", "[greeting]", greeting jRoom] | greeting jRoom /= ""] |
90 ++ [AnswerClients [sendChan cl] ["CHAT", "[greeting]", greeting jRoom] | greeting jRoom /= ""] |
|
91 ++ if hasTeamsInGame then ["EM", toEngineMsg $ 'G' `B.cons` nick cl] else [] |
90 |
92 |
91 where |
93 where |
92 sendStateFlags cl clients = AnswerClients [sendChan cl] . concat . intersperse [""] . filter (not . null) . concat $ |
94 sendStateFlags cl clients = AnswerClients [sendChan cl] . concat . intersperse [""] . filter (not . null) . concat $ |
93 [f "+r" ready, f "-r" unready, f "+g" ingame, f "-g" inroomlobby] |
95 [f "+r" ready, f "-r" unready, f "+g" ingame, f "-g" inroomlobby] |
94 where |
96 where |