netserver/HWProto.hs
changeset 1334 b58afaadf7ae
parent 1333 b0b0510eb82d
child 1335 c795cbc752c1
equal deleted inserted replaced
1333:b0b0510eb82d 1334:b58afaadf7ae
    55 	if null (room client) then
    55 	if null (room client) then
    56 		(noChangeClients, noChangeRooms, answerQuit)
    56 		(noChangeClients, noChangeRooms, answerQuit)
    57 	else if isMaster client then
    57 	else if isMaster client then
    58 		(noChangeClients, removeRoom (room client), answerQuit ++ answerAbandoned) -- core disconnects clients on ROOMABANDONED answer
    58 		(noChangeClients, removeRoom (room client), answerQuit ++ answerAbandoned) -- core disconnects clients on ROOMABANDONED answer
    59 	else
    59 	else
    60 		(noChangeClients, noChangeRooms, answerQuit ++ (answerQuitInform $ nick client))
    60 		(noChangeClients, modifyRoom clRoom{teams = filter (\t -> teamowner t /= nick client) $ teams clRoom}, answerQuit ++ (answerQuitInform $ nick client) ++ answerRemoveClientTeams)
       
    61 	where
       
    62 		clRoom = roomByName (room client) rooms
       
    63 		answerRemoveClientTeams = map (\tn -> (othersInRoom, ["REMOVE_TEAM", teamname tn])) $ filter (\t -> teamowner t == nick client) $ teams clRoom
    61 
    64 
    62 
    65 
    63 -- check state and call state-dependent commmand handlers
    66 -- check state and call state-dependent commmand handlers
    64 handleCmd client clients rooms cmd =
    67 handleCmd client clients rooms cmd =
    65 	if null (nick client) || protocol client == 0 then
    68 	if null (nick client) || protocol client == 0 then