Skip to content

Conversation

@thechrisnixon
Copy link
Contributor

The side value in the JSON payload mismatches the docs. Update to have side be '1', '2', or '3'.

However, is '3' the right value for spec?

{
  winner: { side: '2', team: 'team1' },
  team1: {
    series_score: 1,
    score: 13,
    score_ct: 0,
    score_t: 0,
    players: [],
    id: '',
    name: 'Team Blue'
  },
  team2: {
    series_score: 0,
    score: 9,
    score_ct: 0,
    score_t: 0,
    players: [],
    id: '',
    name: 'Team Red'
  },
  map_number: 0,
  matchid: 18,
  event: 'map_result'
}

@thechrisnixon thechrisnixon force-pushed the fix-side-enum-event-docs branch from 0ff3730 to dff8624 Compare August 25, 2024 02:25
@thechrisnixon thechrisnixon force-pushed the fix-side-enum-event-docs branch from dff8624 to 6615e6d Compare August 25, 2024 02:30
@shobhit-pathak
Copy link
Owner

Hey!

I think there is some confusion here.

For round end, we set the Winner like this:

int ctTeamNum = reverseTeamSides["CT"] == matchzyTeam1 ? 1 : 2;
int tTeamNum = reverseTeamSides["TERRORIST"] == matchzyTeam1 ? 1 : 2;
Winner winner = new(@event.Winner == 3 ? ctTeamNum.ToString() : tTeamNum.ToString(), t1score > t2score ? "team1" : "team2");

But for map/series end, we set the Winner like this:

var mapResultEvent = new MapResultEvent
{
    MatchId = liveMatchId,
    MapNumber = currentMapNumber,
    Winner = new Winner(t1score > t2score && reverseTeamSides["CT"] == matchzyTeam1 ? "3" : "2", team1SeriesScore > team2SeriesScore ? "team1" : "team2"),
    StatsTeam1 = new MatchZyStatsTeam(matchzyTeam1.id, matchzyTeam1.teamName, team1SeriesScore, t1score, 0, 0, new List<StatsPlayer>()),
    StatsTeam2 = new MatchZyStatsTeam(matchzyTeam2.id, matchzyTeam2.teamName, team2SeriesScore, t2score, 0, 0, new List<StatsPlayer>())
};

So for map/series end 3 is CT, 2 is T
But for round-end, 1 is CT and 2 is T

@thechrisnixon
Copy link
Contributor Author

That is not lining up with what I'm seeing with respect to the round_end events. For example here is what I saw with a friend. This is round 12 he was T side (team2) and I was CT (team1). Note, winner: { side: '2', team: 'team2' } and the score is 7-5 my buddy is winning on Team Red.

{
  reason: 9,
  winner: { side: '2', team: 'team2' },
  team1: {
    series_score: 0,
    score: 5,
    score_ct: 0,
    score_t: 0,
    players: [ [Object] ],
    id: '',
    name: 'Team Blue'
  },
  team2: {
    series_score: 0,
    score: 7,
    score_ct: 0,
    score_t: 0,
    players: [ [Object] ],
    id: '',
    name: 'Team Red'
  },
  round_time: 0,
  round_number: 12,
  map_number: 0,
  matchid: 18,
  event: 'round_end'
}

Then sides switch so my buddy (team2) is now on CT side. He wins round 13 (score goes 8-5) but winner: { side: '2', team: 'team2' }. Based on what you said side should be '1' which would mean CT. I think it's pointing to which team won (team1 vs team2) instead of (CT vs T)

{
  reason: 8,
  winner: { side: '2', team: 'team2' },
  team1: {
    series_score: 0,
    score: 5,
    score_ct: 0,
    score_t: 0,
    players: [ [Object] ],
    id: '',
    name: 'Team Blue'
  },
  team2: {
    series_score: 0,
    score: 8,
    score_ct: 0,
    score_t: 0,
    players: [ [Object] ],
    id: '',
    name: 'Team Red'
  },
  round_time: 0,
  round_number: 13,
  map_number: 0,
  matchid: 18,
  event: 'round_end'
}

@michihupf
Copy link
Contributor

I have always wanted to know. Why are the team identifiers different at all? Why not just use the CS# values?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants