Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting game time #110

Open
DollarAkshay opened this issue Oct 11, 2019 · 2 comments
Open

Getting game time #110

DollarAkshay opened this issue Oct 11, 2019 · 2 comments

Comments

@DollarAkshay
Copy link

DollarAkshay commented Oct 11, 2019

For any event how do I get the game time for it?

For eample, how should I modify this to also print the game time when the message was said:

p.Callbacks.OnCUserMessageSayText2(func(m *dota.CUserMessageSayText2) error {
  log.Printf("%s said: %s\n", m.GetParam1(), m.GetParam2())
  return nil
})
@ziaoang
Copy link

ziaoang commented Dec 20, 2019

There is a entity named "CDOTAGamerulesProxy", you can listen to it, and get time by "m_pGameRules.m_fGameTime" and "m_pGameRules.m_flGameStartTime"

@Whoeza
Copy link

Whoeza commented Dec 12, 2022

There is a entity named "CDOTAGamerulesProxy", you can listen to it, and get time by "m_pGameRules.m_fGameTime" and "m_pGameRules.m_flGameStartTime"

Hey man, can I ask how you got those names? m_flGameStartTime for instance. I have not found them in any protobuf definition that I've seen, but I see it being constantly referenced in replay parsing codes. If you can help me get this straight I'd appreciate it! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants