'In room' state stub
authorunc0rr
Thu, 01 May 2008 15:26:09 +0000
changeset 897 35d91fa3753b
parent 896 93df8ac94382
child 898 344ba7dba23d
'In room' state stub
netserver/HWProto.hs
--- a/netserver/HWProto.hs	Thu May 01 15:24:13 2008 +0000
+++ b/netserver/HWProto.hs	Thu May 01 15:26:09 2008 +0000
@@ -66,6 +66,11 @@
 
 handleCmd_noRoom client _ rooms _ = (client, rooms, [client], ["ERROR", "Bad command or incorrect parameter"])
 
+-- 'inRoom' clients state command handlers
+handleCmd_inRoom :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> [String] -> (ClientInfo, [RoomInfo], [ClientInfo], [String])
+
+handleCmd_inRoom client _ rooms _ = (client, rooms, [client], ["ERROR", "Bad command or incorrect parameter"])
+
 -- state-independent comman handlers	
 handleCmd :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> [String] -> (ClientInfo, [RoomInfo], [ClientInfo], [String])
 
@@ -79,5 +84,7 @@
 handleCmd client clients rooms cmd =
 	if null (nick client) || protocol client == 0 then
 		handleCmd_noInfo client clients rooms cmd
+	else if null (room client) then
+		handleCmd_noRoom client clients rooms cmd
 	else
-		handleCmd_noRoom client clients rooms cmd
+		handleCmd_inRoom client clients rooms cmd