TimZaman / dotaservice

DotaService is a service to play Dota 2 through gRPC
Other
114 stars 19 forks source link

the head length of world state message is not correct #47

Closed sijiaxu closed 4 years ago

sijiaxu commented 5 years ago

I notice a weird thing, sometimes the head length of world state message is not equal to 4, and this trig the recv thread exit https://github.com/TimZaman/dotaservice/blob/6e91ff15b25c53b7457e0f711ddb0de3dc5b54d6/dotaservice/dotaservice.py#L316-L319 this problems become frequent when I increase host_timescale, and I try to skip this error, but it seems no hope for finding the correct message position again..

Nostrademous commented 5 years ago

That can happen when the frame rate you request for world state dumps (a configuration parameter you pass to the client when launching) is slower than your read rate as you are attempting to read Protobufs before they are ready

Nostrademous commented 5 years ago

What host time scale you using?

sijiaxu commented 5 years ago

Do you mean if my read rate is too fast, this will make the world state dump process completely stuck? I test with different host time scale, it all has chance to get this error

Nostrademous notifications@github.com于2019年1月24日 周四下午8:52写道:

What host time scale you using?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TimZaman/dotaservice/issues/47#issuecomment-457185718, or mute the thread https://github.com/notifications/unsubscribe-auth/ALlVyE86vaNaMTO7aG0D0Jpg7BWKtWMaks5vGax6gaJpZM4aQvWq .

--

Thanks Sijia

Nostrademous commented 5 years ago

What is youre "Read Rate" and what is your FRAME Dota2 setting?

Also, what are you getting for the "head length"?

It is my understanding that Dota2 will prepare a protobuf on the client socket with port as specified (Radiant/Dire per *_PORT config parameter) at the FRAME rate specified. Once you do a read from that socket it garbage collects that protobuf... so if you do a second read before it has a chance to populate it with new date from the "next frame" you can get garbage.

TimZaman commented 5 years ago

Right, I'm afraid your computer cannot keep up.