ziellos2k 35 Posted July 4, 2012 (edited) BattleNET is a C# (.NET) library and client for the BattlEye protocol written by me and Vipeax.Webpagehttp://ziellos2k.net/battlenet/GitHub project pagehttps://github.com/z...os2k/BattleNET/LicenceLGPLChangelogv1.3 * Client now has DNS support * BattlEyeLoginCredentials.Host changed from string to IPAddress * Increased timeout check sleep a bit (1 second) * Increased time before a packet gets resend (2 seconds) * Proper UTF8 support * The usual bugfixes and cleanupsv1.2.1 * Increased max socket receive buffer (fixes long ban lists)v1.2 * Removed system messages (Connected, Disconnected, etc) from library * Changed ReconnectOnPacketLoss and IsConnected to properties * New connect event (success, invalid login, host unreachable) * SendCommandPacket() now returns an identifier which can be used in message filtering * Renamed SendCommandPacket() to SendCommand(), kinda... * Bugfixes and cleanupsv1.1 * Different method to construct packets * Some fixes and cleanups * Did licensing the right wayv1.0.2 * Fixed predefined commands, they now work actually. :)v1.0.1 * Fixed a bug where the lib would send the 'say' command twicev1.0 * Started using proper version numbers... :)20121217.1 * Library didn't reconnect on connection loss20121217 * 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 arguments20120821 * Hackish fix for not handling very long ban files20120717 * Decreased keep alive packet interval and timeout timer * Changed Encoding.Default to Encoding.GetEncoding(1252) as Default is variable across systems (also makes it compatible with Linux/mono)20120706 * Fixed autoreconnect not working20120704 * License added20120628 * Complete BattlEye protocol implementation Edited March 20, 2013 by ziellos2k 12 Share this post Link to post Share on other sites
mrsherenai 64 Posted July 4, 2012 Nice work! I searched for something like this. Share this post Link to post Share on other sites
facoptere 180 Posted July 4, 2012 Hello,I have written rcon in Perl, it works well on Linux and other systems. It can be used in batch scripts easily.If someone is interested please PM me. Share this post Link to post Share on other sites
ziellos2k 35 Posted July 5, 2012 Hello' date='I have written rcon in Perl, it works well on Linux and other systems. It can be used in batch scripts easily.If someone is interested please PM me.[/quote']You can send it to me, I'd like to check it out! :) Share this post Link to post Share on other sites
stice 2 Posted July 5, 2012 Vipeax and I wrote a BattlEye Protocol Library for C#' date=' you could use this to for example notify your players before a restart via RCon.To get an idea of how it would look, take a look at this sample code; [url']https://github.com/ziellos2k/BattleNET/blob/master/sample.cs'>https://github.com/ziellos2k/BattleNET/blob/master/sample.cs.LicenceGPLBinarieshttps://github.com/ziellos2k/BattleNETSourcehttps://github.com/ziellos2k/BattleNET-srcChangelog2012-07-04* License added2012-06-28* Complete BattlEye protocol implementationi love youuuu... thought something like this would be awesome all the time.. Share this post Link to post Share on other sites
ziellos2k 35 Posted July 6, 2012 New update available, see first post for details. Share this post Link to post Share on other sites
ziellos2k 35 Posted July 17, 2012 New version available, first post updated. :) Share this post Link to post Share on other sites
Reo 26 Posted July 17, 2012 Could you explain a bit more how it works please? Since I only understood something like "warn before restart" and rest is like "wtfisthisshit" ^^Thx in advance! Share this post Link to post Share on other sites
ziellos2k 35 Posted July 17, 2012 Could you explain a bit more how it works please? Since I only understood something like "warn before restart" and rest is like "wtfisthisshit" ^^Thx in advance!It's basically a .dll file that programmers can use to communicate with BattlEye (i.e. warn about restarts automatically, etc). For you, I guess, it's not much of use in this state. :)I may release a simple auto restart notifier in the coming days though. Share this post Link to post Share on other sites
divineholiness 0 Posted July 17, 2012 I will be on vacation for several weeks, I may get a bug up my bum to build a web management tool using this DLL. (Already started) The battleeye Gui tool that is out doesn't seem to work too well for me.Thanks for all the hard work already done to create this library. Share this post Link to post Share on other sites
pepperkorn@gmail.com 94 Posted July 20, 2012 (edited) Quick question here. I'm attempting to use your library in vb.net and I'm having a few issues... I can successfully use the following code and it does in fact send the commands through:Dim loginCredentials As BattlEyeLoginCredentials = New BattlEyeLoginCredentials loginCredentials.Host = "127.0.0.1" loginCredentials.Port = "2342" loginCredentials.Password = "123" Dim b As IBattleNET = New BattlEyeClient(loginCredentials) b.Connect() b.SendCommandPacket(EBattlEyeCommand.Say, "-1 This is a global message.") b.SendCommandPacket(EBattlEyeCommand.MaxPing, "200") b.SendCommandPacket("say -1 This is another global message.") b.Disconnect()However it seems I cannot get the following to work:b.MessageReceivedEvent += HandleMessageand in fact there doesn't even seem to be a MessageReceivedEvent for me. I do have the subclass:Private Shared Sub HandleMessage(args As BattlEyeMessageEventArgs) Console.WriteLine(args.Message)End Suband:Private Shared Sub HandleDisconnect(ByVal args As BattlEyeDisconnectEventArgs) Console.WriteLine(args.Message) Select Case (args.DisconnectionType) Case EBattlEyeDisconnectionType.ConnectionLost Case EBattlEyeDisconnectionType.LoginFailed Case EBattlEyeDisconnectionType.Manual Case EBattlEyeDisconnectionType.SocketException End SelectEnd Sub Edited July 20, 2012 by peperonikiller Share this post Link to post Share on other sites
tofucake 6 Posted July 20, 2012 fyi BattleNet is already a thing Share this post Link to post Share on other sites
Brainling 3 Posted July 20, 2012 Very nice work. Thanks for this. I was looking for a way to write some tools for my server, and this will help immensely. Share this post Link to post Share on other sites
ryahn 112 Posted July 20, 2012 How does one install this and use it? It would be nice for me so I dont have to get in chat to warn players Share this post Link to post Share on other sites
Brainling 3 Posted July 20, 2012 How does one install this and use it? It would be nice for me so I dont have to get in chat to warn playersThis is a development tool, not meant for general use. Unless you know C# and want to program your own tool, this probably isn't for you, as this is a .NET Class Library. Share this post Link to post Share on other sites
ziellos2k 35 Posted July 20, 2012 [...]No idea, zero experience with vb.net. I'm just guessing here but it could be that events in VB.NET are different from C#.NET? Also make sure you put b.MessageReceivedEvent += HandleMessage after Dim b As IBattleNET = New BattlEyeClient(loginCredentials) and before b.Connect(). No idea if it matters but that's all I can think of. :)fyi BattleNet is already a thingWho cares... Besides, I didn't pick the name. :P Share this post Link to post Share on other sites
Brainling 3 Posted July 20, 2012 (edited) Ugg, I hate VB.Net...but += is not how you add handlers in VB.Net. You use AddHandler and AddressOf. Example:AddHandler b.MessageReceivedEvent, AddressOf HandleMessage+= is a C# syntactic sugar override to allow this to be easier. Edited July 20, 2012 by Brainling 1 Share this post Link to post Share on other sites
pepperkorn@gmail.com 94 Posted July 20, 2012 Ugg, I hate VB.Net...but += is not how you add handlers in VB.Net. You use AddHandler and AddressOf. Example:AddHandler b.MessageReceivedEvent, AddressOf HandleMessage+= is a C# syntactic sugar override to allow this to be easier.I appreciate your help. Works like a charm. In case you're interested/want to help: http://dayzmod.com/forum/index.php?/topic/39628-server-admin-tool/#entry377033 1 Share this post Link to post Share on other sites
domistyle 221 Posted July 21, 2012 Really neat, but 2 things:You wrote "Succes" instead of "Success", just a little typo but still.Fixed it already in the source you offer but maybe you want to correct it for yourself too.Also, is there a way to wait for a response?My program sometimes is too fast when calling SendCommandPacket and doesn't wait for a response.I fixed it for now by letting the thread sleep but that is not really an elegant solutions.Thanks anyway, comes in really handy for some stuff. Share this post Link to post Share on other sites
Brainling 3 Posted July 23, 2012 I appreciate your help. Works like a charm. In case you're interested/want to help: http://dayzmod.com/f...ol/#entry377033Change to C# and we'll talk ;) Share this post Link to post Share on other sites
Vipeax 318 Posted July 24, 2012 Change to C# and we'll talk ;)http://www.developerfusion.com/tools/convert/csharp-to-vb/ Share this post Link to post Share on other sites
thevisad 11 Posted July 24, 2012 http://www.developer...t/csharp-to-vb/Yuck? 1 Share this post Link to post Share on other sites
webmaster@taskymedia.com 0 Posted July 24, 2012 Any chance this can be licensed under LGPL? Share this post Link to post Share on other sites