Open fugma313 opened 6 months ago
Thanks for the report. I'm currently on vacation for the next two weeks, so I cannot work on this before 2024-06-03. I will try to reproduce this asap after that and provide a fix if applicable.
I can confirm that the the library indeed looses connection frequently to the BE server, so you need to manually reconnect the client.
I am not sure that I understand the original issue.
The log messages you see come from the RCon server and afaik are always logged when a remote RCon command is executed. Since this is a property of DayZ's BE RCon server, there's nothing I can do about that.
Can you maybe share the full script you're using so that I may try to reproduce it (I'm running a DayZ server myself).
The RCon Client basically looses connection immediately after you connected to the server. The connection isn't held up. Which means you need to perform a login for every command you want to execute. This results in the server log beeing spammed with login messages (which is not the main issue, as far as i am concerned)
The BE Client should keep the connection alive by sending the correct ACK packages.
I haven't debugged the network traffic myself, but what i understand based on @fugma313 's comment is that your client isn't working correctly. For server messages, which need to be acknowledged by sending 'B'(0x42) | 'E'(0x45) | 0x02, your client is only sending 0x02. The BE RCON specification states that server messages that are not correctly acknowledged will result in the connection beeing droped, which is what seems to be happening here.
To further elaborate: A BE Client login event will trigger a Server Message that gets broadcasted to all connected clients, containing the same string that lands in the server log (RCon admin #0 (127.0.0.1:52368) logged in)
Since that message is not acknowledged correctly, the client will be disconnected quickly after it authenticated.
For server messages, which need to be acknowledged by sending 'B'(0x42) | 'E'(0x45) | 0x02, your client is only sending 0x02.
Thank you for pointing out this bug.
Can you please check, whether https://github.com/conqp/rcon/commit/f88f9dbf11a6080773debf2e58c4b28ca1eb3412 fixes this issue?
I use this module to keep a local player database in a text file, among other things.
Here's some of the code
If I don't raise that exception, I will forever transmit the "players" command which will be ignored by the RCon server.
Judging by the network traffic, something is wrong. The server sends "RCon admin #0 (IP:port) logged in", and I see a reply of b'0200', but this doesn't seem to be what the RCon server is expecting. Because it will transmit this same login message up to 5 times, after which it will start ignoring any commands sent to it, forcing me to re-auth with RCon to continue executing commands. This is becoming a problem as my DayZ server console is flooded with "BattlEye Server: RCon admin #0 (127.0.0.1:52368) logged in"
Edit: Upon comparing the network traffic between this and DaRT, it looks like the reply (0200) is missing the BE RCon protocol header.