# HG changeset patch # User unc0rr # Date 1231969177 0 # Node ID d5e131005516e621821dba44b354c12079f6f225 # Parent b6d609815378f2366a517a91995d34be95379562 Don't send empty JOINED message diff -r b6d609815378 -r d5e131005516 netserver/HWProto.hs --- a/netserver/HWProto.hs Wed Jan 14 19:31:23 2009 +0000 +++ b/netserver/HWProto.hs Wed Jan 14 21:39:37 2009 +0000 @@ -243,7 +243,10 @@ (modifyClient client{room = roomName}, modifyRoom clRoom{playersIn = 1 + playersIn clRoom}, (answerJoined $ nick client) ++ answerNicks ++ answerReady ++ (answerNotReady $ nick client) ++ answerFullConfig clRoom ++ answerAllTeams (protocol client) clRoom ++ watchRound) where noSuchRoom = isNothing $ find (\room -> roomName == name room && roomProto room == protocol client) rooms - answerNicks = answerClientOnly $ ["JOINED"] ++ (map nick $ sameRoomClients) + answerNicks = if not $ null sameRoomClients then + answerClientOnly $ ["JOINED"] ++ (map nick $ sameRoomClients) + else + [] answerReady = concatMap (\c -> answerClientOnly [if isReady c then "READY" else "NOT_READY", nick c]) sameRoomClients sameRoomClients = filter (\ci -> room ci == roomName) clients clRoom = roomByName roomName rooms