Giter Club home page Giter Club logo

Comments (10)

saul avatar saul commented on August 17, 2024 2
    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}`);
      }
    });

from demofile.

saul avatar saul commented on August 17, 2024 1

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)

from demofile.

saul avatar saul commented on August 17, 2024

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.

from demofile.

luastoned avatar luastoned commented on August 17, 2024

What about the CCSUsrMsg_ServerRankUpdate protobuf?

from demofile.

saul avatar saul commented on August 17, 2024

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.

from demofile.

saul avatar saul commented on August 17, 2024

Will assume that this resolved your issue

from demofile.

luastoned avatar luastoned commented on August 17, 2024

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?

from demofile.

thecatontheflat avatar thecatontheflat commented on August 17, 2024

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

from demofile.

master117 avatar master117 commented on August 17, 2024

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

from demofile.

thecatontheflat avatar thecatontheflat commented on August 17, 2024

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

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

from demofile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.