Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map the playerId to the UserId #91

Open
mwishoff opened this issue May 25, 2019 · 2 comments
Open

Map the playerId to the UserId #91

mwishoff opened this issue May 25, 2019 · 2 comments

Comments

@mwishoff
Copy link

Is there a way to map which player(playerId?) did the action in 'replay.game.events'? I see they use m_userId's there instead of playerId's. Any input would be helpful.

@amartin916
Copy link
Contributor

the m_userid can be found from the m_syncLobbyState->m_lobbyState->m_slots section from the init data

https://github.com/Blizzard/s2protocol/blob/master/docs/flags/initdata.md

@ipax77
Copy link

ipax77 commented Jul 18, 2019

I did some analyzes with a 1v1 +1Observer Direct Strike replay:

--init

"m_slots": [
…
{
"m_teamId": 1,
"m_control": 2,
"m_userId": 1,
"m_observe": 0,
"m_workingSetSlotId": 1,
"m_tandemId": 1
…
},
{
"m_teamId": 0,
"m_control": 2,
"m_userId": 2,
"m_observe": 0,
"m_workingSetSlotId": 15,
"m_tandemId": 2
…
},
{
"m_teamId": 0,
"m_control": 0,
"m_userId": null,
"m_observe": 1,
"m_workingSetSlotId": 14,
"m_tandemId": null
…
}

--details

"m_playerList": [
{
"m_teamId": 1,
"m_observe": 0,
"m_workingSetSlotId": 1,
"m_control": 2,
…
},
{
"m_teamId": 0,
"m_observe": 0,
"m_workingSetSlotId": 15,
"m_control": 2,
…
}

--gameevents

'_userid': {'m_userId': 1},
'_userid': {'m_userId': 2},

--trackerevents

'm_playerId': 1,
'm_playerId': 2,

So you can map the details.["m_playerList"].["m_workingSetSlotId"] with init.["m_slots"].["m_workingSetSlotId"] to get the m_userId from init and use it for gameevents and trackerevents.

Is there an other way without touching the init information (E.g. just get the Index from details.["m_playerList"])?

(Decoded) Replay
analyzes.zip

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

No branches or pull requests

3 participants