Stop sending an error and simply ignore relay from an unauthenticated player because that should only happen on immediate logout for which there's nothing to do

This commit is contained in:
Tissevert 2019-11-18 17:13:32 +01:00
parent 3bd2829cf2
commit 7a937355d2

View file

@ -57,10 +57,9 @@ broadcast obj = do
relay :: FromClient -> (Message.T -> App.T ()) -> App.T () relay :: FromClient -> (Message.T -> App.T ()) -> App.T ()
relay message f = do relay message f = do
App.debug "Relaying" App.debug "Relaying"
maybe bounce doRelay . Session.player =<< App.session maybe (return ()) doRelay . Session.player =<< App.session
where where
doRelay player = f $ Relay {from = playerID player, message} doRelay player = f $ Relay {from = playerID player, message}
bounce = send (Error "Unidentified client can't relay messages")
receive :: App.T FromClient receive :: App.T FromClient
receive = do receive = do