diff -r 78167b9ddae0 -r 8505cbfd9a21 netserver/HWProto.hs --- a/netserver/HWProto.hs Fri Oct 31 17:48:17 2008 +0000 +++ b/netserver/HWProto.hs Fri Oct 31 17:53:59 2008 +0000 @@ -12,9 +12,13 @@ where hhsInfo = concatMap (\(HedgehogInfo name hat) -> [name, hat]) $ hedgehogs team -answerServerMessage = [(clientOnly, "SERVER_MESSAGE" : [body])] +answerServerMessage clients = [(clientOnly, "SERVER_MESSAGE" : [mainbody ++ clientsIn])] where - body = serverMessage globalOptions ++ if isDedicated globalOptions then "
Dedicated server
" else "Private server
" + mainbody = serverMessage globalOptions ++ if isDedicated globalOptions then "Dedicated server
" else "Private server
" + clientsIn = "" ++ (show $ length nicks) ++ " clients in: " ++ clientslist ++ "
" + clientslist = if not $ null nicks then foldr1 (\a b -> a ++ ", " ++ b) nicks else "" + nicks = filter (not . null) $ map nick clients + answerBadCmd = [(clientOnly, ["ERROR", "Bad command, state or incorrect parameter"])] answerNotMaster = [(clientOnly, ["ERROR", "You cannot configure room parameters"])] answerBadParam = [(clientOnly, ["ERROR", "Bad parameter"])] @@ -112,8 +116,8 @@ -- 'noRoom' clients state command handlers handleCmd_noRoom :: CmdHandler -handleCmd_noRoom client _ rooms ["LIST"] = - (noChangeClients, noChangeRooms, answerServerMessage ++ (answerRoomsList $ concatMap roomInfo $ sameProtoRooms)) +handleCmd_noRoom client clients rooms ["LIST"] = + (noChangeClients, noChangeRooms, answerServerMessage clients ++ (answerRoomsList $ concatMap roomInfo $ sameProtoRooms)) where roomInfo room = [ name room,