gameServer/Actions.hs
changeset 1953 fd9c8e3c734d
parent 1931 ffe420e9e61a
child 1972 e7a7c5eb5d86
equal deleted inserted replaced
1952:aed76eabb846 1953:fd9c8e3c734d
    94 		roomClients = IntSet.elems $ playersIDs room
    94 		roomClients = IntSet.elems $ playersIDs room
    95 		room = rooms ! 0
    95 		room = rooms ! 0
    96 
    96 
    97 
    97 
    98 processAction (clID, serverInfo, clients, rooms) SendServerMessage = do
    98 processAction (clID, serverInfo, clients, rooms) SendServerMessage = do
    99 	writeChan (sendChan $ clients ! clID) $ ["SERVER_MESSAGE", serverMessage serverInfo]
    99 	writeChan (sendChan $ clients ! clID) $ ["SERVER_MESSAGE", message serverInfo]
   100 	return (clID, serverInfo, clients, rooms)
   100 	return (clID, serverInfo, clients, rooms)
       
   101 	where
       
   102 		client = clients ! clID
       
   103 		message = if clientProto client < 25 then
       
   104 			serverMessageForOldVersions
       
   105 			else
       
   106 			serverMessageForOldVersions
   101 
   107 
   102 
   108 
   103 processAction (clID, serverInfo, clients, rooms) (ProtocolError msg) = do
   109 processAction (clID, serverInfo, clients, rooms) (ProtocolError msg) = do
   104 	writeChan (sendChan $ clients ! clID) ["ERROR", msg]
   110 	writeChan (sendChan $ clients ! clID) ["ERROR", msg]
   105 	return (clID, serverInfo, clients, rooms)
   111 	return (clID, serverInfo, clients, rooms)