netserver/HWProto.hs
changeset 891 701f86df9b4c
parent 890 1d8c4a5ec622
child 892 dfe97199f17e
--- a/netserver/HWProto.hs	Wed Apr 30 19:44:54 2008 +0000
+++ b/netserver/HWProto.hs	Wed Apr 30 20:14:09 2008 +0000
@@ -3,5 +3,12 @@
 import IO
 import Miscutils
 
-handleCmd :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> String -> (Bool, Bool, [String])
-handleCmd _ _ _ ('Q':'U':'I':'T':xs) = (True, False, [])
+handleCmd :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> [String] -> (Bool, [ClientInfo], [String])
+
+handleCmd client clients _ ("QUIT":xs) =
+	if null (room client) then
+		(True, [client], ["QUIT"])
+	else
+		(True, clients, ["QUIT " ++ nick client])
+
+handleCmd client _ _ _ = (False, [client], ["Bad command"])