Same for lobby
authorunc0rr
Wed, 14 Jan 2009 21:40:59 +0000
changeset 1676 6f6f14a3e0ea
parent 1675 d5e131005516
child 1677 0655bb13af01
Same for lobby
netserver/HWProto.hs
--- a/netserver/HWProto.hs	Wed Jan 14 21:39:37 2009 +0000
+++ b/netserver/HWProto.hs	Wed Jan 14 21:40:59 2009 +0000
@@ -181,9 +181,15 @@
 	if (null $ nick client) || (protocol client == 0) then
 		[]
 	else
-		(answerClientOnly $ ["LOBBY:JOINED"] ++ (filter (\n -> (not (null n)) && n /= nick client) $ map nick $ clients)) ++
+		answerLobbyNicks ++
 		(answerAll ["LOBBY:JOINED", nick client]) ++
 		(answerServerMessage client clients)
+	where
+		lobbyNicks = filter (\n -> (not (null n)) && n /= nick client) $ map nick $ clients
+		answerLobbyNicks = if not $ null lobbyNicks then
+					answerClientOnly $ ["LOBBY:JOINED"] ++ lobbyNicks
+				else
+					[]
 
 handleCmd_noInfo :: CmdHandler
 handleCmd_noInfo client clients _ ["NICK", newNick] =