node-cs2
v2.0.1
Published
Modern CS2/CS:GO Game Coordinator integration with latest GameTracking-CS2 protobuf definitions. Includes support for highlight_reel, variations, and all modern CS2 fields.
Maintainers
Readme
node-cs2
Modern CS2/CS:GO Game Coordinator integration with the latest GameTracking-CS2 protobuf definitions. This package provides a simple API for interacting with the Counter-Strike 2 and CS:GO Game Coordinator, with full support for all modern CS2 features.
What's New in This Fork
This fork addresses critical issues with the original globaloffensive package and adds comprehensive support for modern CS2 features:
Latest GameTracking-CS2 Protobuf Definitions
- All protobuf files updated from the latest GameTracking-CS2 repository
- Future-proof with current CS2 game definitions
- Comprehensive field support for all modern CS2 items
Fixed Missing Fields
highlight_reelsupport in stickers, keychains, and variationsmusicindex- Music kit supportentindex- Entity index supportpetindex- Pet/companion supportstyle- Style variations supportupgrade_level- Item upgrade level support
New Array Support
variations- Complete new array for item variations- Enhanced stickers array with all new fields
- Enhanced keychains array with all new fields
Enhanced Handler Logic
- Updated
handlers.jsto process all new fields - Proper field mapping and null handling
- 100% backward compatible with existing code
Critical Bug Fixes
Missing highlight_reel Field
Problem: The original package was missing the highlight_reel field in inspect responses, causing incomplete data for items with highlight reels.
Solution: Updated protobuf definitions and enhanced handlers to properly capture and return highlight_reel data.
// Before (missing data)
{
keychains: [
{
slot: 0,
sticker_id: 36,
offset_x: 3.445085287094116,
// highlight_reel: MISSING!
}
]
}
// After (complete data)
{
keychains: [
{
slot: 0,
sticker_id: 36,
offset_x: 3.445085287094116,
highlight_reel: 67890 // NOW WORKING!
}
]
}Installation
npm install node-cs2Migration from globaloffensive
This package is 100% API compatible with the original globaloffensive package:
// Old
const GlobalOffensive = require('globaloffensive');
// New - just change the require!
const NodeCS2 = require('node-cs2');
// All your existing code works unchanged!
const cs2 = new NodeCS2(steamUser);Usage
const SteamUser = require('steam-user');
const NodeCS2 = require('node-cs2');
const user = new SteamUser();
const cs2 = new NodeCS2(user);
user.logOn({
accountName: 'username',
password: 'password'
});
user.on('loggedOn', () => {
console.log('Logged into Steam');
user.gamesPlayed([730]); // CS2/CS:GO app ID
});
user.on('appLaunched', (appid) => {
if (appid == 730) {
console.log('CS2/CS:GO launched');
cs2.helloGC();
}
});
cs2.on('connectedToGC', () => {
console.log('Connected to CS2/CS:GO Game Coordinator');
});
// Inspect an item with full modern field support
cs2.on('inspectItemInfo', (item) => {
console.log('Item data with all modern fields:', {
defindex: item.defindex,
paintindex: item.paintindex,
paintwear: item.paintwear,
// NEW FIELDS NOW SUPPORTED!
musicindex: item.musicindex,
petindex: item.petindex,
style: item.style,
upgrade_level: item.upgrade_level,
// ARRAYS WITH FULL FIELD SUPPORT
stickers: item.stickers, // includes highlight_reel
keychains: item.keychains, // includes highlight_reel
variations: item.variations // NEW! includes highlight_reel
});
});
// Inspect an item
cs2.inspectItem('76561198057249394', '2569415699', '7115007497');Inspect URL Support
Full support for both masked and unmasked inspect URLs:
// Unmasked URL (requires Steam client) - NOW WITH FULL FIELD SUPPORT!
const unmaskedUrl = 'steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198857794835A45540551473D7523863830991655521';
// Extract parameters and inspect
const match = unmaskedUrl.match(/S(\d+)A(\d+)D(\d+)/);
if (match) {
const [, ownerId, assetId, classId] = match;
cs2.inspectItem(ownerId, assetId, classId);
}Complete Field Support
Basic Item Fields
defindex- Item definition indexpaintindex- Paint/skin indexpaintseed- Paint seedpaintwear- Wear valuerarity- Item rarityquality- Item quality
Modern CS2 Fields
musicindex- Music kit indexentindex- Entity indexpetindex- Pet/companion indexstyle- Style variation indexupgrade_level- Item upgrade level
Arrays with Full Field Support
stickers[]- Sticker applicationskeychains[]- Keychain attachmentsvariations[]- Item variations (NEW!)
Sticker/Keychain/Variation Fields
slot- Attachment slotsticker_id- Sticker/item IDwear- Wear valuescale- Scale factorrotation- Rotation angletint_id- Tint color IDoffset_x,offset_y,offset_z- Position offsetspattern- Pattern indexhighlight_reel- Highlight reel ID (FIXED!)
Development
Building from Source
git clone https://github.com/sak0a/node-cs2.git
cd node-cs2
npm install
npm run generate-protosUpdating Protobuf Definitions
# Copy latest protobuf files from GameTracking-CS2
# Then regenerate:
npm run generate-protosLicense
MIT License - see LICENSE file for details.
Credits
- Original Author: DoctorMcKay - Original
globaloffensivepackage - Protobuf Definitions: SteamDatabase GameTracking-CS2
- Fork Maintainer: sak0a
Issues & Support
If you encounter any issues or need support:
- Check if the issue exists in the original package
- Open an issue on GitHub
- Provide detailed information about your use case
Why Use This Fork?
- Up-to-date with latest CS2 definitions
- Bug fixes for missing fields
- Enhanced functionality with new CS2 features
- 100% compatible with existing code
- Actively maintained with GameTracking-CS2 updates
- Community-driven improvements
