netserver/HWProto.hs
changeset 891 701f86df9b4c
parent 890 1d8c4a5ec622
child 892 dfe97199f17e
equal deleted inserted replaced
890:1d8c4a5ec622 891:701f86df9b4c
     1 module HWProto where
     1 module HWProto where
     2 
     2 
     3 import IO
     3 import IO
     4 import Miscutils
     4 import Miscutils
     5 
     5 
     6 handleCmd :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> String -> (Bool, Bool, [String])
     6 handleCmd :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> [String] -> (Bool, [ClientInfo], [String])
     7 handleCmd _ _ _ ('Q':'U':'I':'T':xs) = (True, False, [])
     7 
       
     8 handleCmd client clients _ ("QUIT":xs) =
       
     9 	if null (room client) then
       
    10 		(True, [client], ["QUIT"])
       
    11 	else
       
    12 		(True, clients, ["QUIT " ++ nick client])
       
    13 
       
    14 handleCmd client _ _ _ = (False, [client], ["Bad command"])