Requirements To test your plugin in the main software you will need to apply with us to get Plugin Developer access. For now e-mail tracker@recursion.tk with your request and Recursion account name. Eventually this process will become more automated. Development should be performed on the latest stable version of the Recursion Tracker. The minimum required version for plugin support is 0.10.2.2. The Recursion Tracker is a 32 bit application which specifically targets the .NET Framework 4.5 on the following operating systems: Windows Vista, Windows 7, Windows 8.0, and Windows 8.1. Examples will be based on C# using Visual Studio 2013--Update 4. |
|
Getting Started Create a new class library in Visual Studio by going to File -> New Project -> Visual C# -> Class Library Once created you will want to add a reference to the Recursion library. Right click on your new project and choose Add -> Reference. Then browse to the Recursion Tracker installation directory and choose RTLibrary.dll. |
|
Now we should setup the base class we will be using and link the RecursionTracker name space. There are multiple ways to do this, but to stay consistent with other plugin development your plugin should fall under the RecursionTracker.Plugins namespace, and with your own namespace extending it. The main program requires your plugin implement the IPlugin interface. To make things easier we have a BasePlugin class which implements the interface and takes care of a few other things as well. Extend the RecursionTracker.Plugins.PluginBase class. The PluginBase class implements the IPlugin interface which has a set of required methods. PluginBase creates protected member properties and implements all methods as virtual so they can be overloaded. |
First overwrite the PluginInformation m_information with your own plugin specific information. (string name, string description, string author, string imagePath) Next set m_guid with a new GUID unique to your plugin. Visual Studio offers a GUID generator by going to Tools -> Create GUID. Make sure the GUID consists of numbers, letters, and hyphens only. The Recursion Tracker will only allow one plugin per GUID to be loaded at a time. Let's go over the IPlugin required methods which are already fully implemented.
|
There will likely be information you wish to retrieve from the Recursion Tracker application. The Core object provided through m_core is your gateway to object instances managed by the host application. Common objects include: StatTracker-- Retrieved through GetStatTracker(). The StatTracker processes JSON events from the socket connection and formats them properly into GameEvent objects. The stat tracker also totals information relating to the player being tracked. Guinan-- Retrieved through GetGuinan(). Guinan is our listener class which performs event processing and is used to figure out which GameEvent is currently processing or what the state of the game currently is through tracked method groups. D3DXInterface-- Retrieved through GetD3D(). The d3d interface is how communication is performed with the game client. You can send MenuComponents through this connection which will automatically serialize the component and send it to the game for display. |
Code:
namespace RecursionTracker.Plugins.MyPlugin { public class MyPluginBase : PluginBase { private StatTracker m_statTracker; public MyPluginBase() { m_pluginInformation = new PluginInformation("My Plugin", "A test plugin for the Recursion Tracker.", "Me", null); m_guid = new Guid("27A7E26E-FE91-4F61-91D9-43DF3A0FBF6F"); } public override void Load() { base.Load(); // m_core will have been set by SetInformation() at this point. m_statTracker = m_core.GetStatTracker(); } } } |
Getting Game Events
JSON events enter the Stat Tracker and are converted to GameEvents. The stat tracker class builds the players and their initial stats from either a query or cache. WeaponStats by default are not retrieved due to API overhead. The complete game event is then sent off to Guinan for processing in the order it was received. To get access to the currently processing game event, call Guinan.GetCurrentProcessingEvent().
Game Event format
Sound Player
We use NAudio for our sound library and support both WaveOut and DirectSound implementations. The sound player can be retrieved by Core.GetSoundPlayer()
The following are common methods which can be used.
PlaySound(byte[] byteArray) PlayCustomSound(string filePath) // Loads a file into a bytearray and calls PlaySound StopSound() // Stops the current playing sound.
Guinan
Guinan uses MethodGroups to determine what to track. Define your own methods and load them into Guinan's TrackedMethods.
In-Game Menu Creation
This format will be changing in 0.10.3 and documentation will be constructed after that time.
vBulletin Message