prestonp / simple-rcon

Simple, painless node RCON client for Source servers
MIT License
14 stars 4 forks source link

Issue with tv_stoprecord for CS:GO #16

Open 33Fraise33 opened 7 years ago

33Fraise33 commented 7 years ago

Hello,

I'm using simple-rcon to integrate our website with CS:GO. This has been working correctly for a few months now but friday we started seeing an issue. When recording a server demo and trying to save that demo with the command tv_stoprecord I get a crash in the simple-rcon package:

0|csgobot  | 2017-06-26 09:07:11.291000000: Error: Unhandled "error" event. (Error: Unknown server response)
0|csgobot  |     at Rcon.emit (events.js:185:19)
0|csgobot  |     at Rcon.<anonymous> (/home/besports/csgobot/node_modules/simple-rcon/lib/rcon.js:52:14)
0|csgobot  |     at emitOne (events.js:115:13)
0|csgobot  |     at Socket.emit (events.js:210:7)
0|csgobot  |     at addChunk (_stream_readable.js:252:12)
0|csgobot  |     at readableAddChunk (_stream_readable.js:239:11)
0|csgobot  |     at Socket.Readable.push (_stream_readable.js:197:10)
0|csgobot  |     at TCP.onread (net.js:588:20)

Running the tv_stoprecord command returns this:

Broadcast backlog of http requests in flight is too high (22 > 20), dropping 4812/full and 4812/delta.
Broadcast backlog of http requests in flight is too high (22 > 20), dropping 4813/full and 4813/delta.
Broadcast backlog of http requests in flight is too high (22 > 20), dropping 4814/full and 4814/delta.
Broadcast backlog of http requests in flight is too high (22 > 20), dropping 4815/full and 4815/delta.
Broadcast backlog of http requests in flight is too high (22 > 20), dropping 4816/full and 4816/delta.
Broadcast backlog of http requests in flight is too high (22 > 20), dropping 4817/full and 4817/delta.
Completed GOTV demo "stuff1.dem", recording time 121.1

It seems the last update of CS:GO changed something to GOTV internally which breaks the simple-rcon package on such a response.

I don't know if this is an issue with CS:GO or if this is something that needs to be fixed in the simple-rcon package.

33Fraise33 commented 7 years ago

I seem to have fixed the issue.

CSGO has had an update this weekend: https://www.reddit.com/r/GlobalOffensive/comments/6iay45/counterstrike_global_offensive_beta_update_for/

This introduced a variable tv_delay1. The problem is that if the time difference between tv_delay and tv_delay1 are too big that this causes the error from above. tv_delay1 is a new variable and is set to 15 or similar by default. My tv_delay was at 120 and the difference was too big. Now I set my tv_delay to 120 and my tv_delay1 to 113 and the issue is gone.

The strange thing is that I don't even use the second broadcast but it does create issues. I'm happy to finally fix it after a few hours of searching.

I hope I can help anyone with this, I also send a mail to the CS:GO dev team already, let's hope they reply.

33Fraise33 commented 7 years ago

Ok this does not seem to fix it, but only at times. Still trying out for real solutions

prestonp commented 7 years ago

@stubbegianni Looks like the protocol type is not recognized here

https://github.com/prestonp/simple-rcon/blob/master/lib/rcon.js#L37

Any way you could dump more information when you reproduce this issue?

I suggest just tweaking your node_modules/simple-rcon to log what res looks like on the error case.

prestonp commented 7 years ago

This lib doesn't support multi-packet responses, which might be causing this.

https://developer.valvesoftware.com/wiki/Source_RCON_Protocol#Multiple-packet_Responses

I'll open an issue and tackle that soon.

33Fraise33 commented 7 years ago

Ok great, I seem to have temporarily fixed the issue by changing my delays to very small number but this makes my GOTV unusable as this will allow ghosting. It sucks that I have to use this workaround for now as this seems like an unwanted consequence caused of the latest CS:GO update.

Good to know, I'd love to help out but this is just a bit too complex for my understanding so I try my best to be as clear as possible to describe this bug. Is there any furhter info I can help you with?

prestonp commented 7 years ago

Gotcha, I suspect the problem probably lies with this library. So, sorry for any inconvenience it caused.

I'll try to get the multi-packet response working and then maybe you can use the desired delay values for your server :)