diff --git a/src/Automaton.hs b/src/Automaton.hs index da1fa4d..cd00b47 100644 --- a/src/Automaton.hs +++ b/src/Automaton.hs @@ -50,8 +50,9 @@ receive invitation@(Message.Invitation {Message.to}) (Just _) = receive answer@(Message.Answer {Message.accept, Message.to}) (Just player) = if accept then do - game <- Game.new (Player.playerID player, to) - Messaging.notifyPlayers game [] + publicGames <- Game.new (Player.playerID player, to) + Messaging.relay answer (Messaging.sendTo [to]) + Messaging.notifyPlayers publicGames else Messaging.relay answer (Messaging.sendTo [to]) receive (Message.Play {Message.move, Message.onGame}) (Just player) = do