Plugin Basics www

xlobby docs (works in progress)

Plugin Basics www

Postby stevenhanna6 on Fri Apr 01, 2005 6:08 pm

#
##
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.
stevenhanna6
 
Posts: 904
Joined: Tue Feb 18, 2003 10:39 am
Location: Ontario, Canada

Re: Plugin Basics www

Postby hjackson on Fri Oct 02, 2009 8:20 pm

Can we use a VisualBasic2008 app instead of C# as a plugin? Does the process above change?

hjackson
hjackson
 
Posts: 371
Joined: Sat Nov 29, 2003 7:12 am
Location: Tampa, Florida

Re: Plugin Basics www

Postby S Pittaway on Sat Oct 03, 2009 8:28 am

the basic process wil be very similar...

but, if you stick to using C# you will find a lot more examples and sample source code to look at.

also, i have to say C# is not hard to pick up, if you can cope with VB i am sure C# will have been sussed very quickly (it not like the jump from VB - C++).
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: Plugin Basics www

Postby lpg on Sat Oct 10, 2009 1:29 am

If you need examples of vb or c# let me know.
lpg
 
Posts: 296
Joined: Thu Apr 14, 2005 8:17 pm
Location: Chicago