Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Any way to find a players rank? #33

Closed
TheFlyingVoid opened this issue Jul 2, 2017 · 10 comments
Closed

Any way to find a players rank? #33

TheFlyingVoid opened this issue Jul 2, 2017 · 10 comments

Comments

@TheFlyingVoid
Copy link

I have been looking through the docs and I can't seem to find anything leading to players ranks. Is there any way of finding a players rank and if not is it possible to implement in the future?

@TheFlyingVoid TheFlyingVoid changed the title Any way to find a users rank? Any way to find a players rank? Jul 2, 2017
@saul
Copy link
Owner

saul commented Jul 2, 2017

I'm not sure it is possible - the ranks are sent via Steam network channels and not the in-game network channels, so it's not recorded in the demo.

@saul saul closed this as completed Jul 2, 2017
@luastoned
Copy link

What about the CCSUsrMsg_ServerRankUpdate protobuf?

@saul
Copy link
Owner

saul commented Jul 3, 2017

Potentially... I think if you listen for that message, you should be able to find the player whose rank has changed by comparing xuid_lo from PlayerInfo with account_id from the message.

Let me know how you get on.

@saul saul reopened this Jul 3, 2017
@saul
Copy link
Owner

saul commented Jul 9, 2017

Will assume that this resolved your issue

@saul saul closed this as completed Jul 9, 2017
@luastoned
Copy link

I don't think the issue is resolved (as noone has replied with a patch or working code).
How would one go about listening for that message anyway? I don't see any net related things exposed?

@saul
Copy link
Owner

saul commented Jul 10, 2017

    demoFile.userMessages.on('ServerRankUpdate', um => {
      console.log('Player rank updates:');
      for (let update of um.rankUpdate) {
        let player = demoFile.players.find(player => player.userInfo.xuid.getLowBits() == update.accountId);
        console.log(`> ${player.name}: ${update.rankOld} -> ${update.rankNew}`);
      }
    });

@thecatontheflat
Copy link
Contributor

thecatontheflat commented Nov 7, 2019

Doesn't seem to work. Does it mean this message is not always sent?

@master117
Copy link

The rank is only sent at the end of MM matches, and only those recorded by gotv.

@thecatontheflat
Copy link
Contributor

Thank you for the reply! I do check the MM match recorded by GOTV though.

http://replay192.valve.net/730/003377779566117388614_0320438711.dem.bz2

@saul
Copy link
Owner

saul commented Nov 10, 2019

I think the API has changed slightly since I posted that comment. See the below code (tested on your demo and works):

    demoFile.userMessages.on("ServerRankUpdate", um => {
      console.log("Player rank updates:");
      for (const update of um.rankUpdate) {
        const player = demoFile.players.find(
          player =>
            player.userInfo &&
            player.userInfo.xuid.getLowBits() === update.accountId
        );
        if (!player) console.log(`> (unknown player ${update.accountId})`);
        else
          console.log(
            `> ${player.name}: ${update.rankOld} -> ${update.rankNew}`
          );
      }
    });

Outputs:

Player rank updates:
> GundelGaukeley2: 11 -> 11   
> Frezzz chlenix.exe: 10 -> 10
> ็: 10 -> 10
> Cerberus: 9 -> 9
> d0h: 8 -> 8
> Comrade Gamer: 10 -> 10     
> Tor: 10 -> 10
> twitch.tv/jacus_minecraft_cs: 10 -> 10
> Łukasz Borzym: 9 -> 10
> (unknown player 396707352)

@saul saul reopened this Feb 28, 2021
@saul saul closed this as completed Feb 28, 2021
Repository owner locked and limited conversation to collaborators Feb 28, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

5 participants