marceldev89 / BattleNET

BattlEye Protocol Library and Client
GNU Lesser General Public License v3.0
76 stars 44 forks source link

BattleNet client.exe -command output? #26

Closed matthewlenz closed 11 years ago

matthewlenz commented 11 years ago

Any possibility of dumping the output to a file? maybe command.txt in the working directory? pretty please? :) even stdout would be awesome.

marceldev89 commented 11 years ago

BattleNET client.exe -host 127.0.0.1 -port 2303 -password secret -command players > output.txt?

matthewlenz commented 11 years ago

Doh. I guess I was expecting output on stdout. Didn't realize you were detecting if there was file redirection. Very cool. Thanks and sorry for the issue. Is that documented? If so, I guess I overlooked it. If not, might be helpful. :)

marceldev89 commented 11 years ago

It's just a basic feature from the console. The library itself doesn't have it.

matthewlenz commented 11 years ago

Yeah I understand that. But normally when a command dumps via redirection it dumps to standard out when there is no redirection. Running the 'players' command without > outfile.txt yields no output.

matthewlenz commented 11 years ago

Figured out the problem. It's not always returning results. Bug? Must be, I can use bercon and repeatedly request player lists and get a result.

marceldev89 commented 11 years ago

Hmm not sure, it's unknown to me at least.

st4l commented 11 years ago

From my experiments the rcon server rejects connections when there are more than 4 or 5 clients (you get a message in the console about an admin logged in) logged in. Since it's UDP, the server only detects a client 'disconnect' when it doesn't receive messages for more than 45 seconds. When you execute BattleNet client.exe it connects to the server and creates a new session by logging in. So if you have for example gotcha and bec connected you might already have 2 active sessions, and only have 2 or 3 spare sessions that you can use before it rejects the connection... and if you executed the exe a couple times in the last 45 seconds it created sessions that are still alive in the server, so the pool is full and your connection will be rejected. I need to test all of this to find out the exact mechanism, but that's what I'm gathering so far from my tests.

marceldev89 commented 11 years ago

I think I ran into the same issue today. It didn't seem entirely connected to the client limit. It just seemed to hang until it timed out. Not sure what causes it though.

nanomo commented 11 years ago

i can confirm the same behaviour that st4l explain, if i have a lot of program using the admin interface this will hang up and can drop even the server. (happens on dayz)

marceldev89 commented 11 years ago

Ok, well I guess this is an BattlEye issue instead of a BattleNET issue then.