netserver/HWProto.hs
changeset 1676 6f6f14a3e0ea
parent 1675 d5e131005516
child 1681 42a7b01943b3
equal deleted inserted replaced
1675:d5e131005516 1676:6f6f14a3e0ea
   179 -- 'no info' state - need to get protocol number and nickname
   179 -- 'no info' state - need to get protocol number and nickname
   180 onLoginFinished client clients =
   180 onLoginFinished client clients =
   181 	if (null $ nick client) || (protocol client == 0) then
   181 	if (null $ nick client) || (protocol client == 0) then
   182 		[]
   182 		[]
   183 	else
   183 	else
   184 		(answerClientOnly $ ["LOBBY:JOINED"] ++ (filter (\n -> (not (null n)) && n /= nick client) $ map nick $ clients)) ++
   184 		answerLobbyNicks ++
   185 		(answerAll ["LOBBY:JOINED", nick client]) ++
   185 		(answerAll ["LOBBY:JOINED", nick client]) ++
   186 		(answerServerMessage client clients)
   186 		(answerServerMessage client clients)
       
   187 	where
       
   188 		lobbyNicks = filter (\n -> (not (null n)) && n /= nick client) $ map nick $ clients
       
   189 		answerLobbyNicks = if not $ null lobbyNicks then
       
   190 					answerClientOnly $ ["LOBBY:JOINED"] ++ lobbyNicks
       
   191 				else
       
   192 					[]
   187 
   193 
   188 handleCmd_noInfo :: CmdHandler
   194 handleCmd_noInfo :: CmdHandler
   189 handleCmd_noInfo client clients _ ["NICK", newNick] =
   195 handleCmd_noInfo client clients _ ["NICK", newNick] =
   190 	if not . null $ nick client then
   196 	if not . null $ nick client then
   191 		(noChangeClients, noChangeRooms, answerNickChosen)
   197 		(noChangeClients, noChangeRooms, answerNickChosen)