netserver/HWProto.hs
changeset 1407 b44fbb630fb6
parent 1406 08b9c28419f1
child 1408 fab171a17968
equal deleted inserted replaced
1406:08b9c28419f1 1407:b44fbb630fb6
   126 		(noChangeClients, noChangeRooms, answerCannotCreateRoom)
   126 		(noChangeClients, noChangeRooms, answerCannotCreateRoom)
   127 	else
   127 	else
   128 		if haveSameRoom then
   128 		if haveSameRoom then
   129 			(noChangeClients, noChangeRooms, answerRoomExists)
   129 			(noChangeClients, noChangeRooms, answerRoomExists)
   130 		else
   130 		else
   131 			(modifyClient client{room = newRoom, isMaster = True}, addRoom createRoom{name = newRoom, password = roomPassword, roomProto = (protocol client)}, answerJoined $ nick client)
   131 			(modifyClient client{room = newRoom, isMaster = True}, addRoom createRoom{name = newRoom, password = roomPassword, roomProto = (protocol client)}, (answerJoined $ nick client) ++ (answerNotReady $ nick client))
   132 	where
   132 	where
   133 		haveSameRoom = isJust $ find (\room -> newRoom == name room) rooms
   133 		haveSameRoom = isJust $ find (\room -> newRoom == name room) rooms
   134 
   134 
   135 handleCmd_noRoom client clients rooms ["CREATE", newRoom] =
   135 handleCmd_noRoom client clients rooms ["CREATE", newRoom] =
   136 	handleCmd_noRoom client clients rooms ["CREATE", newRoom, ""]
   136 	handleCmd_noRoom client clients rooms ["CREATE", newRoom, ""]