73 [Warning "REMOVE_TEAM: no such team"] |
73 [Warning "REMOVE_TEAM: no such team"] |
74 else |
74 else |
75 if not $ nick client == teamowner team then |
75 if not $ nick client == teamowner team then |
76 [ProtocolError "Not team owner!"] |
76 [ProtocolError "Not team owner!"] |
77 else |
77 else |
78 if not $ gameinprogress room then |
78 [RemoveTeam teamName] |
79 [ModifyRoom (\r -> r{teams = filter (\t -> teamName /= teamname t) $ teams r}), |
|
80 AnswerOthersInRoom ["REMOVE_TEAM", teamName]] |
|
81 else |
|
82 [] |
|
83 {- else |
|
84 (noChangeClients, |
|
85 modifyRoom clRoom{ |
|
86 teams = filter (\t -> teamName /= teamname t) $ teams clRoom, |
|
87 leftTeams = teamName : leftTeams clRoom, |
|
88 roundMsgs = roundMsgs clRoom |> rmTeamMsg |
|
89 }, |
|
90 answerOthersRoom ["GAMEMSG", rmTeamMsg]) -} |
|
91 where |
79 where |
92 client = clients IntMap.! clID |
80 client = clients IntMap.! clID |
93 room = rooms IntMap.! (roomID client) |
81 room = rooms IntMap.! (roomID client) |
94 noSuchTeam = isNothing findTeam |
82 noSuchTeam = isNothing findTeam |
95 team = fromJust findTeam |
83 team = fromJust findTeam |
96 findTeam = find (\t -> teamName == teamname t) $ teams room |
84 findTeam = find (\t -> teamName == teamname t) $ teams room |
97 rmTeamMsg = toEngineMsg $ 'F' : teamName |
|
98 |
85 |
99 |
86 |
100 handleCmd_inRoom clID clients rooms ["HH_NUM", teamName, numberStr] = |
87 handleCmd_inRoom clID clients rooms ["HH_NUM", teamName, numberStr] = |
101 if not $ isMaster client then |
88 if not $ isMaster client then |
102 [ProtocolError "Not room master"] |
89 [ProtocolError "Not room master"] |