This project is read-only.

Using the Library

In order to use the library, you can download the binary of the latest version from the Downloads page.
Once you have the library, you need to add a reference to it. One way to add a reference is to, from the Menu Bar, go to Project -> Add Reference. From there, add the BF3Rcon.dll.

All of the classes in the library are located in the System.Net.Battlefield3 namespace. The easiest way to access these classes is to add using System.Net.Battlefield3; for C# or Imports System.Net.Battlefield3 for Visual Basic to the part of your file(s) where those other statements are.

Communication with a Battlefield 3 server through RCON is done through the RconClient class. All of RconClient's members are found in the documentation also found in the Downloads page. Remember to right-click, select properties, and unblock the documentation to view it. Things only get more complicated from here, but you'll use the built-in events for things like player joining, kills, etc., and you'll use the SendRequest method if you need to send data. There are a lot more features included that go beyond the scope of this documentation, but, if the documentation mentioned in the 2nd sentence isn't helping, you can ask for help at the Discussion Board.

Here's some quick code to get a connection going. The documentation will still provide the best reference for RconClient's members.

using System.Net.Battlefield3;

RconClient client = new RconClient();
client.Address = "address";
client.Port = 1337;
client.Connected += new EventHandler((sender, e) => client.LogOn("password", true)); //password isn’t stored in RconClient, so send on connect
client.Connect();

Imports System.Net.Battlefield3

Dim client As New RconClient()
client.Address = "address"
client.Port = 1337
AddHandler client.Connected, Sub(sender, e) client.LogOn("password", true)
client.Connect()

Last edited Nov 1, 2011 at 1:15 AM by Timiz0r, version 2

Comments

No comments yet.