Jump to content
ziellos2k

BattleNET - C# library and client for the BattlEye protocol

Recommended Posts

So did anyone ever implement the command like utility I mentioned a page or so back? :)

Share this post


Link to post
Share on other sites

Well, no :P. But if you specify exactly what kind of commands you want, exact input and exact output you want, I may work my magic when I'm bored. Shouldn't take very long to create something like that for me anyways. (But depends on the # of commands and complexity, ofcourse)

Share this post


Link to post
Share on other sites

Alright, BattleNET client updated with command line options. :) Please note that it won't check if the command was received or anything, this will have to be fixed within the lib itself.


BattleNET Client.exe -host 127.0.0.1 -port 2302 -password 123456789 -command "say -1 testing 123"
-host // Ip
-port // Port
-password // Password
-command // Command to send to the server (optional)

https://github.com/ziellos2k/BattleNET/tree/master/bin

Edited by ziellos2k

Share this post


Link to post
Share on other sites

Hey ziellos, I am using your lib for about 1 and half month now, and it works great. Today I thought I should update to the latest available on GIT, I imported it, replaced all the old files and made the interface change.

But when I use it, it will disconnect from rcon every 6 or 7 seconds, my tool is made so that if it disconnects it will reconnect, so, it keeps connecting and disconnecting in a loop forever, every 6-7 seconds.

I reverted to the old files that still work and are stable, but could be useful to have the latest :D

Oh, by the way, I am having this problem where after banning a player, the ban wont stick and he can join right back.

Here are all the permutations I have tried thus far :

//b.SendCommandPacket(EBattlEyeCommand.ExecBan, p.id + " -1 " + message);

//b.SendCommandPacket ("ban "+ p.id + " -1 " + message);

b.SendCommandPacket(string.Format("ban {0} -1 {1}", p.id, curBan.banID));

b.SendCommandPacket(string.Format("banIP {0} -1 {1}", p.id, curBan.banID));

b.SendCommandPacket(string.Format("addBan {0} -1 {1}", p.guid, curBan.banID));

iPop.show(p.nick + " banned!");

b.SendCommandPacket("writebans");

None of them seem to "stick" and the ban is treated as a simple kick.

Share this post


Link to post
Share on other sites

Hmm I don't see this behavior on my own test server. It could be the way you've implemented stuff. Not sure. As per PM, add me to skype and we'll figure it out. :)

Edited by ziellos2k

Share this post


Link to post
Share on other sites

Binaries updated, dropped packets should be handled now but currently it's only handling them when both server and client are "idle" for 5 seconds. This will probably be changed in the future.

Changelog: https://github.com/z.../commits/master

Edited by ziellos2k

Share this post


Link to post
Share on other sites

Heya ziellos2k,

Not sure if this is still around in the current version (I use an old version as that one works just fine), but calling the BattlEyeClient.Disconnect() function raises the OnDisconnect() event twice.

This is because in void Disconnect() you raise the event, and again at the end of the loop which listens for data. Solution, don't raise the event in void Disconnect().

Just a little thing that was crashing my program.

Share this post


Link to post
Share on other sites

Heya ziellos2k,

Not sure if this is still around in the current version (I use an old version as that one works just fine), but calling the BattlEyeClient.Disconnect() function raises the OnDisconnect() event twice.

This is because in void Disconnect() you raise the event, and again at the end of the loop which listens for data. Solution, don't raise the event in void Disconnect().

Just a little thing that was crashing my program.

DisconnectEvent gets triggered 2 times too, making it output the disconnect message 2 times.

Didn't have any problems with that yet, I just filtered the disconnect messages.

DaRT sometimes displays a disconnect message 2+ times in a row because of this though.

Edited by DomiStyle

Share this post


Link to post
Share on other sites

Heya ziellos2k,

Not sure if this is still around in the current version (I use an old version as that one works just fine), but calling the BattlEyeClient.Disconnect() function raises the OnDisconnect() event twice.

This is because in void Disconnect() you raise the event, and again at the end of the loop which listens for data. Solution, don't raise the event in void Disconnect().

Just a little thing that was crashing my program.

Can you create a ticket on github? That way I won't forget to check. :)

Edited by ziellos2k

Share this post


Link to post
Share on other sites

New version available.

20121217

  • Updated predifined commands
  • Timeout values decreased for faster connection drop detection
  • UTF8 support
  • Better handling of dropped packets (client -> server)
  • Packet receiving is now asynchronous
  • Some other fixes and cleanups
  • Client now accepts command line arguments

This includes some older changes and what not, but I'm moving back to version numbers. Makes it a bit more easy to track issues. :)

Edited by ziellos2k
  • Like 2

Share this post


Link to post
Share on other sites

Great tool !

I've got an issue when trying the say command, display the text twice.

Connecting to 94.242.xx.xx:2342...

Connected!

RCon admin #0 (83.194.xx.xx:54918) logged in

say 4 test

RCon admin #0: (To Ameo) test

RCon admin #0: (To Ameo) test

Share this post


Link to post
Share on other sites

Even with manual method I got the issue

Enter IP address: 94.242.xxx.xxx

Enter port number: 2342

Enter RCon password: xxxxxxxx

Connecting to 94.242.xxx.xxx:2342...

Connected!

RCon admin #3 (83.194.xx.xx:52174) logged in

say 9 test

RCon admin #3: (To Ameo) test

RCon admin #3: (To Ameo) test

Edited by Ameo

Share this post


Link to post
Share on other sites

Alright, will take a look later today.

EDIT: You're right, major fuck up.. ^^ Please don't use this version! :)

Edited by ziellos2k

Share this post


Link to post
Share on other sites

Can you create an OnConnected event? I've been adding it myself, but every time I try to update Git just plain refuses to do it because I messed with the code. I need this event for reasons, but I'd also like the updates. Thanks!

Share this post


Link to post
Share on other sites

I'll take a look at it.

Though, you should just be able to merge your code with my code.

Edited by ziellos2k

Share this post


Link to post
Share on other sites

Can you create an OnConnected event? I've been adding it myself, but every time I try to update Git just plain refuses to do it because I messed with the code. I need this event for reasons, but I'd also like the updates. Thanks!

For now it has it's own branch, 'connected-event'. Is this something like what you meant? :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×