From dbc7e7e0ba3993d9d1d62531dd6c152d8e3c181b Mon Sep 17 00:00:00 2001 From: Hamcha Date: Fri, 28 Jun 2019 11:20:52 +0200 Subject: [PATCH] Tell players their picks when the draft is over --- draftbot/go.mod | 2 +- draftbot/go.sum | 8 ++------ draftbot/session.go | 9 +++++++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/draftbot/go.mod b/draftbot/go.mod index bb6e287..512528f 100644 --- a/draftbot/go.mod +++ b/draftbot/go.mod @@ -5,6 +5,6 @@ go 1.12 require ( git.fromouter.space/Artificiale/moa v0.0.1-p2 git.fromouter.space/mcg/cardgage v0.0.4 - git.fromouter.space/mcg/draft v0.0.2 + git.fromouter.space/mcg/draft v0.0.3 github.com/go-kit/kit v0.8.0 ) diff --git a/draftbot/go.sum b/draftbot/go.sum index c5bbc45..2d60590 100644 --- a/draftbot/go.sum +++ b/draftbot/go.sum @@ -1,14 +1,10 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= git.fromouter.space/Artificiale/moa v0.0.1-p2 h1:KhoRQeYCFIpHZEucrXz142O5zfSsyExyhuPSazCrt6I= git.fromouter.space/Artificiale/moa v0.0.1-p2/go.mod h1:dHYul6vVMwDCzre18AFs6NmI22yeI7AE0iQC1jFEQi0= -git.fromouter.space/mcg/cardgage v0.0.1-p2 h1:u65ofEmtDHHQ8nbai97DW9kcrYa4x0I3NHv2oXhw8dI= -git.fromouter.space/mcg/cardgage v0.0.1-p2/go.mod h1:vCmJ9HRdRGSWg2YQW9oNG7geYACdgWYmzL+zZdrsYhQ= -git.fromouter.space/mcg/cardgage v0.0.2 h1:u3Wz+UJx0wEix7vlqMlDX9Kg8nplCy8A0+nIKdNNPp0= -git.fromouter.space/mcg/cardgage v0.0.2/go.mod h1:vCmJ9HRdRGSWg2YQW9oNG7geYACdgWYmzL+zZdrsYhQ= git.fromouter.space/mcg/cardgage v0.0.4 h1:LHMUeNMh0QiMkM3TgsLe9l5sDmanQrej6UiWSVTb67c= git.fromouter.space/mcg/cardgage v0.0.4/go.mod h1:vCmJ9HRdRGSWg2YQW9oNG7geYACdgWYmzL+zZdrsYhQ= -git.fromouter.space/mcg/draft v0.0.2 h1:OT1uztgfCZnZCOg3uOtjQKH2WdwRAxNdYr4KXklVgXY= -git.fromouter.space/mcg/draft v0.0.2/go.mod h1:QQmDm9FgAZL3b2/pIDd4Eo608SxMiCQQe5vIybe/CDY= +git.fromouter.space/mcg/draft v0.0.3 h1:+Bq7cMPuBH6c8UCexaegJjc/UbFTE1+mAikcuvjtW+c= +git.fromouter.space/mcg/draft v0.0.3/go.mod h1:QQmDm9FgAZL3b2/pIDd4Eo608SxMiCQQe5vIybe/CDY= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= diff --git a/draftbot/session.go b/draftbot/session.go index 33eea2d..47a0ae9 100644 --- a/draftbot/session.go +++ b/draftbot/session.go @@ -195,6 +195,15 @@ func (s *session) handlePicks() { Type: "draft-finish", Message: "No more packs, the draft is over!", } + // Send each player their deck + for pname, pdata := range s.Players { + s.messages <- room.Message{ + To: pname, + Type: "draft-picks", + Data: draft.Pack(pdata.Picks).IDs(), + Message: fmt.Sprintf("Your picks are: %s", pdata.Picks), + } + } return } // Something is wrong!