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) |