#
##
How to start a basic plugin in Visual Studio .NET
###
<h3>Plugin Basics</h3>
<p></p>The following describes how the xstats C# plugin for xlobby was made with Visual Studio .NET 2003, I would recommend downloading the plugin sdk which includes xstats and all its source code so you don't have to use these steps. But if you want to start from stratch this is how you do it
<p></p>First thing you must do is create a new project, select "Visual C# Porjects" as the "Project Type" and from the
"Templates" box select "Class Library". Now enter the name for your plugin, below I have entered "xstats", then click "OK".
<p></p><img src='http://www.xlobby.com/files/stevenhanna6/newproject.jpg' border='0' alt='' /><br />
<p></p>Now the project should be created and you should be editing "Class1.cs" file.
<p></p>The very first thing we have to do is add a reference to the XPluginSDK.dll, this contains
the interface for creating an xlobby compatible plugin. To do this we right click
on "References" and click "Add Reference"
<p></p><img src='http://www.xlobby.com/files/stevenhanna6/addreference.jpg' border='0' alt='' /><br />
<p></p>Now we click "Browse" and we select "XPluginSDK.dll", click "open" now after browse windows dissapears
we click "OK" to finish adding our reference. Now if you didn't see the "XPluginSDK.dll", its because you
forgot to put it in your projects folder.
<p></p><img src='http://www.xlobby.com/files/stevenhanna6/addreferencebrowse.jpg' border='0' alt='' /><br />
<p></p>Ok so now your project references should look like this
<p></p><img src='http://www.xlobby.com/files/stevenhanna6/addreferencedone.jpg' border='0' alt='' /><br />
<p></p>The second thing we will now do is rename Class1 and make it use the interface provided by
XPluginSDK.dll file. This is easy to do, simply click "Class1.cs" from the treeview on your
right and rename it to "Stats", and since we just changed the name of the file we should now
change the name of the class.
<p></p>Next we tell this new class to use the "XPlugin" interface by using ":" ("public class Stats : XPlugin")
and dont forget to add "using XPluginSDK;" to the top.
<p></p>In the end you should have this. A new class called Stats that uses the XPlugin interface.
<p></p><img src='http://www.xlobby.com/files/stevenhanna6/newclass.jpg' border='0' alt='' /><br />
<p></p>Now if you click "Build" then "Build xstats" you will get a bunch of error messages, these are all the interface members you have to implement. You can check <a class='wikilink' href='http://www.xlobby.com/Documentation/PluginSDK'>here</a> for more information about these members, but again I recommend downloading the plugin sdk which includes xstats to get you started.