netserver/HWProto.hs
changeset 892 dfe97199f17e
parent 891 701f86df9b4c
child 893 149244d86bf1
equal deleted inserted replaced
891:701f86df9b4c 892:dfe97199f17e
     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, [ClientInfo], [String])
     6 handleCmd :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> [String] -> ([ClientInfo], [String])
     7 
     7 
     8 handleCmd client clients _ ("QUIT":xs) =
     8 handleCmd client clients _ ("QUIT":xs) =
     9 	if null (room client) then
     9 	if null (room client) then
    10 		(True, [client], ["QUIT"])
    10 		([client], ["QUIT"])
    11 	else
    11 	else
    12 		(True, clients, ["QUIT " ++ nick client])
    12 		(clients, ["QUIT", nick client])
    13 
    13 
    14 handleCmd client _ _ _ = (False, [client], ["Bad command"])
    14 handleCmd client _ _ _ = ([client], ["Bad command"])