From 65da786c697bf1bbfefbff2fb70544551a1a54bc Mon Sep 17 00:00:00 2001 From: Tissevert Date: Sat, 11 Jan 2020 21:33:52 +0100 Subject: [PATCH] Relay positive answers to invitations too, to simplify games list handling from client --- src/Automaton.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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