A node.js library for parsing modern (protobuf) Source 1 demo files.
- Counter-Strike: Global Offensive
- Entity updates, server classes, data tables (including instance baselines)
- Both perspectives (GOTV and client-side recorded)
- User messages
- String tables
- Game events
- User commands
- Console commands
npm install --save demofile
Generate documentation to ./docs/
:
npm run generate-docs
Print all player information to console:
var demofile = require('demofile');
var fs = require('fs');
fs.readFile('test.dem', function (err, buffer) {
var demo = new demofile.DemoFile();
demo.stringTables.on('update', e => {
if (e.table.name === 'userinfo' && e.userData != null) {
console.log('Player info updated:');
console.log(e.entryIndex, e.userData);
}
});
demo.parse(buffer);
});
- ✨ Added entities
isHandleSet
to determine if a networked entity handle is set (the game uses(1 << 21) - 1
to mean empty )
- ✨ Added entities
getByHandle
to find an entity from a given networked entity handle (e.g., from m_hMyWeapons)
- ✨ Added entities
baselineupdate
event which is fired whenever theinstancebaseline
string table is updated with new properties.
- ✨ The
dem_StringTables
command, which holds additional string table data on client-side recorded demos, is now parsed - ⚡ String table
postcreate
is now fired aftersvc_CreateStringTable
anddem_StringTables
are parsed
- ✨ Added entities
datatablesready
event which is fired when data tables have been parsed.
- ✨ Added entity
postcreate
event which is fired after an entity has been created and all of its properties parsed.
- ✨ Added string table
postcreate
event which is fired after a new stringtable's entries have been populated
- 🐛 Fixed retrieving properties on entities whose server class has no instance baseline
- ✨ Instance baselines are now parsed and used by
Entity#getProp
- 🐛 Fixed stringtable updates affecting all entries in the table
- 📇 Removed
node-protobuf
un-used dependency
- ⚡ Each tick is now parsed on a separate process tick.
- ⚡ Game event callbacks are now fired at the end of the tick.
- 🐛 Fixed Vector props decoding to
undefined
.
- 🎉 Initial release.