Skip to content

Parsing Broadcasts

Markus edited this page May 26, 2019 · 3 revisions

Work In Progress ...

This page lists some of my discoveries while trying to parse broadcast data (https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Broadcast).

I attempted to create a fake demo file with the broadcast data. To get the data I used https://github.com/BeepFelix/csgo-broadcast

Getting data

  1. node index.js
  2. In game console: tv_enable 1; tv_broadcast_url "http://localhost:8181/broadcast"
  3. Go into map map de_dust2
  4. Start recording a demo and broadcasting: tv_record bc-test; tv_broadcast 1

Creating the demo

  1. The header needs to be created manually (I copied the first 1077 bytes from a working demo - this also includes the signon command)
  2. It looks like the first 6 bits from 0_start need to be removed, after that follows a net message chunk. First I thought this was SeqNrIn/SeqNrOut, but it's only 6 instead of 8 bits so I'm not sure
  3. p.bitReader.Skip((152 + 4 + 4) << 3) in Parser.parsePacket needs to be skipped because none of the packets have a CommandInfo and SeqNrIn/SeqNrOut.
  4. Now we can just cat 0_start 1_full 1_delta 2_full 2_delta ... n_full n_delta

Or just use this command: { head -c 1077 ~/path/to/demo_FROM_CORRECT_MAP.dem; tail -c +6 0_start; for i in $(ls *_full | cut -c 1); do cat ${i}_full ${i}_delta; done; } > fake.dem and (for now) the broadcast-parsing branch which can read the generated demo with missing CommandInfo etc.