# HG changeset patch # User unc0rr # Date 1296068658 -10800 # Node ID c91364bf6a69ea9422354e5256c8c53b1bbbcb1d # Parent adf64662b6a876a3610964b246d08c68b2441574 Send teams info on join diff -r adf64662b6a8 -r c91364bf6a69 gameServer/HWProtoLobbyState.hs --- a/gameServer/HWProtoLobbyState.hs Tue Jan 25 22:23:08 2011 +0300 +++ b/gameServer/HWProtoLobbyState.hs Wed Jan 26 22:04:18 2011 +0300 @@ -16,13 +16,14 @@ import HandlerUtils import RoomsAndClients -{-answerAllTeams protocol teams = concatMap toAnswer teams +answerAllTeams cl = concatMap toAnswer where + clChan = sendChan cl toAnswer team = - [AnswerThisClient $ teamToNet protocol team, - AnswerThisClient ["TEAM_COLOR", teamname team, teamcolor team], - AnswerThisClient ["HH_NUM", teamname team, show $ hhnum team]] --} + [AnswerClients [clChan] $ teamToNet team, + AnswerClients [clChan] ["TEAM_COLOR", teamname team, teamcolor team], + AnswerClients [clChan] ["HH_NUM", teamname team, B.pack . show $ hhnum team]] + handleCmd_lobby :: CmdHandler @@ -91,6 +92,7 @@ ] ++ (map (readynessMessage cl) jRoomClients) ++ (answerFullConfig cl $ params jRoom) + ++ (answerTeams cl jRoom) where readynessMessage cl c = AnswerClients [sendChan cl] [if isReady c then "READY" else "NOT_READY", nick c] @@ -101,6 +103,8 @@ where (leftConfigPart, rightConfigPart) = partition (\(p, _) -> p /= "MAP") $ Map.toList params + answerTeams cl jRoom = let f = if gameinprogress jRoom then teamsAtStart else teams in answerAllTeams cl $ f jRoom + {-