dev-labs-bg / sportify

Football match prediction game with simple rules, built on Symfony
GNU Affero General Public License v3.0
33 stars 13 forks source link

Matches ending in penalties #29

Closed aminvakil closed 6 years ago

aminvakil commented 6 years ago

Which score will be result of the match when matches end in 120 minutes or end in penalties? Will the final score be the goals scored by teams in 90 minutes or in 120 minutes or something else?

davidus05 commented 6 years ago

It depends on you: Which is the fairer method?

aminvakil commented 6 years ago

Match result at the end of 120 minutes.If it goes to penalty shooutous then the game must be draw.On Jun 30, 2018 4:03 PM, davidus05 notifications@github.com wrote:It depens on you: Which is the fairer method?

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

davidus05 commented 6 years ago

I think so, too. But can you currently update the match results? I get an error 500 every time and my cron does not work ...

aminvakil commented 6 years ago
in src/Devlabs/SportifyBundle/Services/DataUpdates/Importer.php at line 110  -

                    $homeTeamId = $this->em->getRepository('DevlabsSportifyBundle:ApiMapping')
                        ->getByEntityTypeAndApiObjectId('Team', $footballApi, $apiHomeTeamId)
                        ->getEntityId();
                    $awayTeamId = $this->em->getRepository('DevlabsSportifyBundle:ApiMapping')
                        ->getByEntityTypeAndApiObjectId('Team', $footballApi, $apiAwayTeamId)
                        ->getEntityId();

I get error 500 too and it's because of this line, although it adds matches but it gives me this error.

Edit: It doesn't adds matches anymore.

cmihaylov commented 6 years ago

Here's what the API returns for a match with extra time and penaties:

"result": {
                "goalsHomeTeam": 1,
                "goalsAwayTeam": 1,
                "halfTime": {
                    "goalsHomeTeam": 1,
                    "goalsAwayTeam": 1
                },
                "extraTime": {
                    "goalsHomeTeam": 1,
                    "goalsAwayTeam": 1
                },
                "penaltyShootout": {
                    "goalsHomeTeam": 3,
                    "goalsAwayTeam": 2
                }
            }

Our logic is that we are getting the first two, which is the 90-minute result. This happens in here: https://github.com/dev-labs-bg/sportify/blob/master/src/Devlabs/SportifyBundle/Services/DataUpdates/Parsers/FootballDataOrg.php#L51 If you want, you can modify the logic and get the extraTime result.

In my opinion, the 90-min result is correct one to predict. At least that's what all the bookies (that I know) do.

davidus05 commented 6 years ago

Thanks for the reply, but it would be great that if it would fetch the data at all ... https://github.com/dev-labs-bg/sportify/issues/31

cmihaylov commented 6 years ago

@davidus05 yeah but as I've said in the mentioned issue, in order to identify the problem I need more info on the error/exception that's returned.