netserver/HWProto.hs
changeset 1391 735f6d43780b
parent 1385 ca72264f921a
child 1396 abb28dcb6d0d
equal deleted inserted replaced
1390:914fa66aec05 1391:735f6d43780b
   236 		clRoom = roomByName (room client) rooms
   236 		clRoom = roomByName (room client) rooms
   237 
   237 
   238 handleCmd_inRoom client _ _ ["GAMEMSG", msg] =
   238 handleCmd_inRoom client _ _ ["GAMEMSG", msg] =
   239 	(noChangeClients, noChangeRooms, [(othersInRoom, ["GAMEMSG", msg])])
   239 	(noChangeClients, noChangeRooms, [(othersInRoom, ["GAMEMSG", msg])])
   240 
   240 
       
   241 handleCmd_inRoom client clients rooms ["KICK", kickNick] =
       
   242 	if isMaster client then
       
   243 		if noSuchClient || (kickClient == client) then
       
   244 			(noChangeClients, noChangeRooms, [])
       
   245 		else
       
   246 			(modifyClient kickClient{forceQuit = True}, noChangeRooms, [])
       
   247 	else
       
   248 		(noChangeClients, noChangeRooms, [])
       
   249 	where
       
   250 		clRoom = roomByName (room client) rooms
       
   251 		noSuchClient = isNothing findClient
       
   252 		kickClient = fromJust findClient
       
   253 		findClient = find (\t -> ((room t) == (room client)) && ((nick t) == kickNick)) $ clients
       
   254 
   241 handleCmd_inRoom _ _ _ _ = (noChangeClients, noChangeRooms, answerBadCmd)
   255 handleCmd_inRoom _ _ _ _ = (noChangeClients, noChangeRooms, answerBadCmd)