netserver/HWProto.hs
changeset 1442 ef9785d0b392
parent 1412 20746999bc4a
child 1452 8505cbfd9a21
equal deleted inserted replaced
1441:d2a6b02b697b 1442:ef9785d0b392
   217 
   217 
   218 handleCmd_inRoom client _ rooms ["TEAM_COLOR", teamName, newColor] =
   218 handleCmd_inRoom client _ rooms ["TEAM_COLOR", teamName, newColor] =
   219 	if not $ isMaster client then
   219 	if not $ isMaster client then
   220 		(noChangeClients, noChangeRooms, answerNotMaster)
   220 		(noChangeClients, noChangeRooms, answerNotMaster)
   221 	else
   221 	else
   222 		(noChangeClients, modifyRoom $ modifyTeam clRoom team{teamcolor = newColor}, answerTeamColor teamName newColor)
   222 		if noSuchTeam then
       
   223 			(noChangeClients, noChangeRooms, answerBadParam)
       
   224 		else
       
   225 			(noChangeClients, modifyRoom $ modifyTeam clRoom team{teamcolor = newColor}, answerTeamColor teamName newColor)
   223 	where
   226 	where
   224 		noSuchTeam = isNothing findTeam
   227 		noSuchTeam = isNothing findTeam
   225 		team = fromJust findTeam
   228 		team = fromJust findTeam
   226 		findTeam = find (\t -> teamName == teamname t) $ teams clRoom
   229 		findTeam = find (\t -> teamName == teamname t) $ teams clRoom
   227 		clRoom = roomByName (room client) rooms
   230 		clRoom = roomByName (room client) rooms