j0k3r / worldcup-slack-bot

WorldCupBot will notify a Slack channel/group for every match during a FIFA World Cup
MIT License
40 stars 29 forks source link

Add VAR support #9

Open andyworsley opened 6 years ago

andyworsley commented 6 years ago

Event type 71 seems to be VAR activity. It may be for several things like: incident being investigated, incident referred for review, final referee decision etc. Quite hard to reverse engineer.

From some examples I've seen, potentially these are:

// VAR
const VAR_INCIDENT_GOAL = 1;
const VAR_INCIDENT_NO_GOAL = 2; // Maybe?
const VAR_INCIDENT_PENALTY = 3;
const VAR_INCIDENT_NO_PENALTY = 4;
const VAR_INCIDENT_RED_CARD = 5; // Maybe?
const VAR_INCIDENT_NO_RED_CARD = 6;

const VAR_REASON_OFFSIDE = 1; // Maybe?
const VAR_REASON_FOUL = 5; // Maybe?
const VAR_REASON_HANDBALL = 6; // Maybe?

const VAR_STATUS_WATCHING = 0;
const VAR_STATUS_REVIEW = 1;
const VAR_STATUS_ONFIELD_REVIEW = 2;
const VAR_STATUS_VAR_DECISION = 3;
const VAR_STATUS_ONFIELD_DECISION = 4;

const VAR_RESULT_GOAL_AWARDED = 1;
const VAR_RESULT_GOAL_DISALLOWED = 2; // Maybe?
const VAR_RESULT_PENALTY_AWARDED = 3;
const VAR_RESULT_PENALTY_REVERSED = 4;
const VAR_RESULT_YELLOW_CARD = 7; // Or at least, no red card
const VAR_RESULT_NO_CHANGE = 9;
andyworsley commented 6 years ago

Iran-Spain - Goal VAR check for offside

<Event Type 15 = OFFSIDE>
<Event Type 71>
"VarDetail": {
"Incident": 2,
"Reason": 1,
"Status": 1,
"Result": 9
},
<Event Type 71>
"VarDetail": {
"Incident": 0,
"Reason": 0,
"Status": 3,
"Result": 9
},
<Event Type 14 = FREE KICK>
"VarDetail": {
"Incident": 0,
"Reason": 0,
"Status": 0,
"Result": 9
},

Australia-France - France awarded penalty after VAR review

<Event Type 30 = ?>
<Event Type 71>
"VarDetail": {
"Incident": 4,
"Reason": 5,
"Status": 1,
"Result": 9
},
<Event Type 71>
"VarDetail": {
"Incident": 4,
"Reason": 5,
"Status": 2,
"Result": 9
},
<Event Type 71>
"VarDetail": {
"Incident": 4,
"Reason": 5,
"Status": 4,
"Result": 3
},
<Event Type 72 = Penalty foul>
<Event Type 2 = Yellow card>
<Event Type 41 = Goal from penalty>

Australia - Penalty awarded after VAR review

<Event Type 72 = PENALTY - must have been put in retrospectively>
<Event Type 71>
"VarDetail": {
"Incident": 4,
"Reason": 6,
"Status": 1,
"Result": 9
},
<Event Type 71>
"VarDetail": {
"Incident": 4,
"Reason": 6,
"Status": 2,
"Result": 9
},
<Event Type 71>
"VarDetail": {
"Incident": 4,
"Reason": 6,
"Status": 4,
"Result": 3
},
<Event Type 2 = Yellow Card>
<Event Type 41 = Goal from Penalty>

Brazil-Costa Rica 39'

<Event Type 15 = OFFSIDE>
<Event Type 71>
"VarDetail": {
"Incident": 4,
"Reason": 5,
"Status": 1,
"Result": 9
},
<Event Type 14 = FREE KICK>
<Event Type 71>
VarDetail": {
"Incident": 0,
"Reason": 0,
"Status": 3,
"Result": 9
},

Brazil-Costa Rica penalty decision reversed - 78'

<Event Type 72 = PENALTY  must have occurred, but was removed from the timeline after?!>
<Event Type 71>
"VarDetail": {
"Incident": 3,
"Reason": 5,
"Status": 1,
"Result": 9
},
<Event Type 71>
"VarDetail": {
"Incident": 3,
"Reason": 5,
"Status": 2,
"Result": 9
},
<Event Type 71>
"VarDetail": {
"Incident": 3,
"Reason": 5,
"Status": 4,
"Result": 4
},

Nigeria-Iceland - Penalty missed by referee, but awarded after appeal and VAR review

<Event Type 72 - Added retrospectively?>
<Event Type 71>
"VarDetail": {
"Incident": 4,
"Reason": 5,
"Status": 1,
"Result": 9
}
<Event Type 71>
"VarDetail": {
"Incident": 4,
"Reason": 5,
"Status": 2,
"Result": 9
},
<Event Type 71>
"VarDetail": {
"Incident": 4,
"Reason": 5,
"Status": 4,
"Result": 3
},
j0k3r commented 6 years ago

Why not, that might be a good idea

oltodo commented 6 years ago

Is there an example of cancelled goal?

j0k3r commented 6 years ago

Cancelled goal by VAR? I don't know.

kyzn commented 5 years ago

Nigeria vs South Korea, (Own) Goal is not cancelled after VAR (reviewed for handball)

34 (own goal)

71
"VarDetail": {
"Incident": 1,
"Reason": 3,
"Status": 1,
"Result": 9
},

71
"VarDetail": {
"Incident": 0,
"Reason": 0,
"Status": 3,
"Result": 9
},
erikcas commented 1 year ago

pretty cool. Will test that in current wc