File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -301,3 +301,11 @@ type ItemDropEvent struct {
301301// You can use the Parser.SendTableParser() after this event to register update notification on entities & properties.
302302// DataTablesParsedEvent is a beta feature, it may be replaced or changed without notice.
303303type DataTablesParsedEvent struct {}
304+
305+ // StringTableCreatedEvent signals that a string table was created via net message.
306+ // Can be useful for figuring out when player-info is available via Parser.GameState().[Playing]Participants().
307+ // E.g. after the table 'userinfo' has been created the player-data should be available after the next TickDoneEvent.
308+ // The reason it's not immediately available is because we need to do some post-processing to prep that data after a tick has finished.
309+ type StringTableCreatedEvent struct {
310+ TableName string
311+ }
Original file line number Diff line number Diff line change 77 "strconv"
88
99 bit "github.com/markus-wa/demoinfocs-golang/bitread"
10+ "github.com/markus-wa/demoinfocs-golang/events"
1011 msg "github.com/markus-wa/demoinfocs-golang/msg"
1112)
1213
@@ -118,6 +119,8 @@ func (p *Parser) handleCreateStringTable(tab *msg.CSVCMsg_CreateStringTable) {
118119 p .processStringTable (tab )
119120
120121 p .stringTables = append (p .stringTables , tab )
122+
123+ p .eventDispatcher .Dispatch (events.StringTableCreatedEvent {TableName : tab .Name })
121124}
122125
123126func (p * Parser ) processStringTable (tab * msg.CSVCMsg_CreateStringTable ) {
You can’t perform that action at this time.
0 commit comments