-
Notifications
You must be signed in to change notification settings - Fork 80
/
player.js
35 lines (29 loc) · 1.1 KB
/
player.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var CSGO = require("../index"),
util = require("util"),
protos = require("steam-resources");
CSGO.CSGOClient.prototype.playerProfileRequest = function(accountId, req_level, callback) {
callback = callback || null;
if (!this._gcReady) {
if (this.debug) {
util.log("GC not ready");
}
return null;
}
if (this.debug) {
util.log("Sending player profile request");
}
var payload = new protos.GC.CSGO.Internal.CMsgGCCStrike15_v2_ClientRequestPlayersProfile({
account_id: accountId,
request_level: req_level || 32
});
this._gc.send({msg: protos.GC.CSGO.Internal.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientRequestPlayersProfile, proto: {}},
payload.toBuffer(), callback);
};
var handlers = CSGO.CSGOClient.prototype._handlers;
handlers[protos.GC.CSGO.Internal.ECsgoGCMsg.k_EMsgGCCStrike15_v2_PlayersProfile] = function onPlayerProfileResponse(message) {
var playerProfileResponse = protos.GC.CSGO.Internal.CMsgGCCStrike15_v2_PlayersProfile.decode(message);
if (this.debug) {
util.log("Received player profile");
}
this.emit("playerProfile", playerProfileResponse);
};