node-globaloffensive icon indicating copy to clipboard operation
node-globaloffensive copied to clipboard

More stats for player profiles

Open Samapa opened this issue 1 year ago • 4 comments

Hey,

More of a question than an issue. I am not sure if its even possible. But the getPlayerProfile call seems to display a view shallow depth of stats. Really only usable stat is the rank_id and account_id. Everything else seems to just return null.

Is there any plans to add more methods to get detailed player stats. Using the steam web api I can fetch limited wepon kills and such, this is also a limited result, but it would make sense to get all the leaderboard data, demos from your matches, demos from matches being played at pro tournoments, live game data, rank information, kill and wepon information like total_headshot_kills_ak47 or something. Surely its accessable from the game controller, im not smart enough to work out how to use the proto messages to get this.

Samapa avatar Jun 18 '24 10:06 Samapa

If someone wanted to implement this and send a pull request, I'd be open to accepting it, but I don't have time to do that myself at the moment.

DoctorMcKay avatar Jun 18 '24 22:06 DoctorMcKay

Thank you! I'll see if I can learn how to do it myself. But if you beat me to it that's ok, and I totally get you're busy, so whenever it's possible.

Samapa avatar Jun 18 '24 22:06 Samapa

Ok im honestly not smart enough to work out what the response would be. For reference, I added this to your index.js:

GlobalOffensive.prototype.clientDeepStats = function(steamid, callback, err) {
	if (typeof steamid == 'string') {
		steamid = new SteamID(steamid);
	}

	this._send(Language.ClientDeepStats, Protos.CMsgGCCStrike15_ClientDeepStats, {
		account_id: steamid.accountid,
		range: {
			start: 0,
			end: 100
		},
		matches: []
	});

	if (err) {
		throws.once('GC responded with' + err);
	} else {
		this.once('playersProfile#' + steamid.getSteamID64(), callback);
	}
};

then used the CSGOcli.clientDeepStats to get a result from my node api. It just continually loads, going to guess I wasnt sending the correct infromation via the proto. I got the matches & range from the CMsgGCCStrike15_ClientDeepStats struct.

If I could work out what the GC sends back or what it requires for each proto then maybe I could use your repository to make methods for what I need, but I honestly have no idea where to start.

Samapa avatar Jun 19 '24 05:06 Samapa

Is there any plans to add more methods to get detailed player stats. Using the steam web api I can fetch limited wepon kills and such, this is also a limited result, but it would make sense to get all the leaderboard data, demos from your matches, demos from matches being played at pro tournoments, live game data, rank information, kill and wepon information like total_headshot_kills_ak47 or something. Surely its accessable from the game controller, im not smart enough to work out how to use the proto messages to get this.

You can get ranking information, if the user is in the steam bots friendlist:

PlayersProfileProfile(account_id=457082742, ranking=PlayerRankingInfo(account_id=457082742, rank_id=0, wins=347, rank_type_id=6), commendation=PlayerCommendationInfo(cmd_friendly=47, cmd_teaching=42, cmd_leader=41), medals=PlayerMedalsInfo(display_items_defidx=[874, 4906, 4873, 996, 987, 4819, 4759, 4799, 4737, 4703, 4674, 4553, 4626, 1377, 970], featured_display_item_defidx=874), player_level=35, player_cur_xp=327683846, rankings=[PlayerRankingInfo(account_id=457082742, rank_id=9, wins=266, rank_type_id=7), PlayerRankingInfo(account_id=457082742, rank_id=0, wins=4, rank_type_id=10), PlayerRankingInfo(account_id=457082742, rank_id=5725, wins=108, rank_type_id=11, rank_window_stats=3342880)])

tom-jm69 avatar Jan 14 '25 20:01 tom-jm69