How to use the steamid.fromIndividualAccountID function in steamid

To help you get started, we’ve selected a few steamid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DoctorMcKay / node-steam-user / components / friends.js View on Github external
SteamUser.prototype._handlerManager.add('PlayerClient.NotifyFriendNicknameChanged#1', function(body) {
	let sid = SteamID.fromIndividualAccountID(body.accountid);
	this.emit('nickname', sid, body.nickname || null);
	if (!body.nickname) {
		// removal
		delete this.myNicknames[sid.getSteamID64()];
	} else {
		this.myNicknames[sid.getSteamID64()] = body.nickname;
	}
});
github DoctorMcKay / node-globaloffensive / handlers.js View on Github external
handlers[Language.PlayersProfile] = function(body) {
	let proto = decodeProto(Protos.CMsgGCCStrike15_v2_PlayersProfile, body);

	if (!proto.account_profiles[0]) {
		return;
	}

	let profile = proto.account_profiles[0];

	let sid = SteamID.fromIndividualAccountID(profile.account_id);

	this.emit('playersProfile', profile);
	this.emit('playersProfile#' + sid.getSteamID64(), profile);
};
github DoctorMcKay / node-steam-user / components / chatroom.js View on Github external
	state.members_in_voice = state.members_in_voice.map(m => SteamID.fromIndividualAccountID(m));
	return state;
github DoctorMcKay / node-steam-user / components / pubfiles.js View on Github external
}, false, function(body) {
		var results = {};
		var invalidSid = SteamID.fromIndividualAccountID(0).getSteamID64();

		(body.publishedfiledetails || []).forEach(function(item) {
			if (!item.publishedfileid) {
				return;
			}

			for (var i in item) {
				if (item.hasOwnProperty(i) && item[i] && typeof item[i] === 'object' && item[i].constructor.name == 'Long') {
					item[i] = item[i].toString();
				}
			}

			if (typeof item.creator === 'string' && item.creator != invalidSid) {
				item.creator = new SteamID(item.creator);
			} else {
				item.creator = null;
github DoctorMcKay / node-steam-user / components / chatroom.js View on Github external
} else if (key == 'timestamp' || key.match(/^time_/) || key.match(/_timestamp$/)) {
			if (val === 0) {
				obj[key] = null;
			} else if (val !== null) {
				obj[key] = new Date(val * 1000);
			}
		} else if (key == 'clanid' && typeof val === 'number') {
			let id = new SteamID();
			id.universe = SteamID.Universe.PUBLIC;
			id.type = SteamID.Type.CLAN;
			id.instance = SteamID.Instance.ALL;
			id.accountid = val;
			obj[key] = id;
		} else if ((key == 'accountid' || key.match(/^accountid_/) || key.match(/_accountid$/)) && (typeof val === 'number' || val === null)) {
			let newKey = key == 'accountid' ? 'steamid' : key.replace('accountid_', 'steamid_').replace('_accountid', '_steamid');
			obj[newKey] = val === 0 || val === null ? null : SteamID.fromIndividualAccountID(val);
			delete obj[key];
		} else if (key.includes('avatar_sha')) {
			let url = null;
			if (obj[key] && obj[key].length) {
				url = "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/chaticons/";
				url += obj[key][0].toString(16) + '/';
				url += obj[key][1].toString(16) + '/';
				url += obj[key][2].toString(16) + '/';
				url += obj[key].toString('hex') + '_256.jpg';
			}

			obj[key.replace('avatar_sha', 'avatar_url')] = url;
		} else if (key.match(/^can_/) && obj[key] === null) {
			obj[key] = false;
		} else if (isDataObject(val)) {
			obj[key] = preProcessObject(val);
github BeepIsla / csgo-crash-exploit / helpers / Helper.js View on Github external
}

				token = b.readInt8(position + lookahead);
			} while (v7 < 35);

			if (backup < 0) {
				break;
			}

			position += lookahead;

			if (v5 === 0) {
				continue;
			}

			results.push(SteamID.fromIndividualAccountID(v5));
		}

		return results;
	}
github DoctorMcKay / node-steam-user / components / friends.js View on Github external
			body.nicknames.forEach(player => nicks[SteamID.fromIndividualAccountID(player.accountid).getSteamID64()] = player.nickname);
github DoctorMcKay / node-steam-user / components / chatroom.js View on Github external
body.messages = body.messages.map((msg) => {
				msg.sender = SteamID.fromIndividualAccountID(msg.sender);
				msg.server_timestamp = new Date(msg.server_timestamp * 1000);
				msg.ordinal = msg.ordinal || 0;
				msg.message_bbcode_parsed = parseBbCode(msg.message);
				msg.deleted = !!msg.deleted;
				if (msg.server_message) {
					msg.server_message.steamid_param = msg.server_message.accountid_param ? SteamID.fromIndividualAccountID(msg.server_message.accountid_param) : null;
					delete msg.server_message.accountid_param;
				}
				return msg;
			});
github DoctorMcKay / node-steam-user / components / chatroom.js View on Github external
output.sessions = output.sessions.map((session) => {
				return {
					"steamid_friend": SteamID.fromIndividualAccountID(session.accountid_friend),
					"time_last_message": session.last_message ? new Date(session.last_message * 1000) : null,
					"time_last_view": session.last_view ? new Date(session.last_view * 1000) : null,
					"unread_message_count": session.unread_message_count
				};
			});

steamid

Exposes a SteamID object class for easy SteamID management

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis