equal
deleted
inserted
replaced
94 |
94 |
95 watchRound = if not $ gameinprogress jRoom then |
95 watchRound = if not $ gameinprogress jRoom then |
96 [] |
96 [] |
97 else |
97 else |
98 [AnswerThisClient ["RUN_GAME"], |
98 [AnswerThisClient ["RUN_GAME"], |
99 AnswerThisClient $ "GAMEMSG" : toEngineMsg "e$spectate 1" : (Foldable.toList $ roundMsgs jRoom)] |
99 AnswerThisClient $ "EM" : toEngineMsg "e$spectate 1" : (Foldable.toList $ roundMsgs jRoom)] |
100 |
100 |
101 answerTeams = if gameinprogress jRoom then |
101 answerTeams = if gameinprogress jRoom then |
102 answerAllTeams (teamsAtStart jRoom) |
102 answerAllTeams (teamsAtStart jRoom) |
103 else |
103 else |
104 answerAllTeams (teams jRoom) |
104 answerAllTeams (teams jRoom) |
122 where |
122 where |
123 client = clients IntMap.! clID |
123 client = clients IntMap.! clID |
124 maybeClient = Foldable.find (\cl -> kickNick == nick cl) clients |
124 maybeClient = Foldable.find (\cl -> kickNick == nick cl) clients |
125 noSuchClient = isNothing maybeClient |
125 noSuchClient = isNothing maybeClient |
126 kickID = clientUID $ fromJust maybeClient |
126 kickID = clientUID $ fromJust maybeClient |
127 -- room = rooms IntMap.! roomID client |
127 |
128 -- roomInfo = if roomID client /= 0 then "room " ++ (name room) else "lobby" |
128 |
|
129 handleCmd_lobby clID clients rooms ["BAN", banNick] = |
|
130 if not $ isAdministrator client then |
|
131 [] |
|
132 else |
|
133 BanClient banNick : handleCmd_lobby clID clients rooms ["KICK", banNick] |
|
134 where |
|
135 client = clients IntMap.! clID |
129 |
136 |
130 |
137 |
131 handleCmd_lobby clID _ _ _ = [ProtocolError "Incorrect command (state: in lobby)"] |
138 handleCmd_lobby clID _ _ _ = [ProtocolError "Incorrect command (state: in lobby)"] |