Implement LIST command
authorunc0rr
Sun, 04 May 2008 14:21:47 +0000
changeset 903 d4e5d8cbe449
parent 902 3cc10f0aae37
child 904 a573c949e61c
Implement LIST command
netserver/HWProto.hs
--- a/netserver/HWProto.hs	Sun May 04 14:07:26 2008 +0000
+++ b/netserver/HWProto.hs	Sun May 04 14:21:47 2008 +0000
@@ -37,6 +37,9 @@
 -- 'noRoom' clients state command handlers
 handleCmd_noRoom :: Handle -> [ClientInfo] -> [RoomInfo] -> [String] -> ([ClientInfo], [RoomInfo], [Handle], [String])
 
+handleCmd_noRoom clhandle clients rooms ("LIST":[]) =
+		(clients, rooms, [clhandle], ["ROOMS"] ++ map (\r -> name r) rooms)
+
 handleCmd_noRoom clhandle clients rooms ("CREATE":newRoom:roomPassword:[]) =
 	if haveSameRoom then
 		(clients, rooms, [clhandle], ["WARNING", "There's already a room with that name"])