<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>Blog of Ortz &#187; plugins</title>
	<atom:link href="http://ortz.org/tag/plugins/feed/" rel="self" type="application/rss+xml" />
	<link>http://ortz.org</link>
	<description>The blog of Brian Ortiz aka Ortzinator, software developer, artist, and a swell guy.</description>
	<lastBuildDate>Tue, 27 Mar 2012 20:16:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Dynamic Command Plugins</title>
		<link>http://ortz.org/2009/04/12/dynamic-command-plugins/</link>
		<comments>http://ortz.org/2009/04/12/dynamic-command-plugins/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 18:13:26 +0000</pubDate>
		<dc:creator>Ortzinator</dc:creator>
				<category><![CDATA[OrtzIRC]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[plugins]]></category>
		<guid isPermaLink="false">http://blog.ortz.org/?p=222</guid>
		<description><![CDATA[I finished a major feature of OrtzIRC recently, so I thought I would write a bit about how it works. First of all, a big thanks to Max for being the grease when my gears wouldn&#8217;t turn, so to speak. And for talking me into doing commands this way instead of mine, which would not [...]]]></description>
			<content:encoded><![CDATA[<p>I finished a major feature of OrtzIRC recently, so I thought I would write a bit about how it works.</p>
<p>First of all, a big thanks to <a href="http://maxschmeling.blogspot.com/">Max</a> for being the grease when my gears wouldn&#8217;t turn, so to speak. <img src='http://ortz.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  And for talking me into doing commands this way instead of mine, which would not have worked out as well.</p>
<p>One of the goals with OrtzIRC is extensibility. OrtzIRC will have many categories of plugins which you write with your favorite .NET language, compile, and place in the plugins folder, much like Paint.NET. (Unlike Paint.NET, OrtzIRC will stay open source. wink wink) The first plugin category is commands.</p>
<p>Here&#8217;s what the &#8220;say&#8221; command looks like:</p>
<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">namespace</span> OrtzIRC<span style="color: #008000;">.</span><span style="color: #0000FF;">Commands</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">OrtzIRC.Common</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">OrtzIRC.PluginFramework</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">///&lt;summary&gt; /// Parts a channel /// &lt;/summary&gt;</span>
    <span style="color: #008000;">&#91;</span>Plugin<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> Say <span style="color: #008000;">:</span> ICommand
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008080; font-style: italic;">///&lt;summary&gt; /// Sends a message to the current channel /// &lt;/summary&gt;</span>
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> Execute<span style="color: #008000;">&#40;</span>Channel channel, <span style="color: #6666cc; font-weight: bold;">string</span> message<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            channel<span style="color: #008000;">.</span><span style="color: #0000FF;">Say</span><span style="color: #008000;">&#40;</span>message<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>
<p>Like with most IRC clients, &#8220;say&#8221; is the only command called automatically (when you type into the command box without specifying a command).</p>
<p>Commands must follow these rules to work properly:</p>
<ol>
<li>The class must implement the <tt>ICommand</tt> interface. At the moment this interface just lets the plugin loader know that it&#8217;s a command.</li>
<li>The class must also have the <tt>Plugin</tt> attribute. <tt>Plugin</tt> takes an optional string parameter to specify the name of the plugin (in this case the name of the command you type to execute the command, ie &#8220;/say&#8221;) otherwise the plugin&#8217;s name is the name of the class.</li>
<li>The command class must have at least one public <tt>Execute</tt> method. This method is what OrtzIRC calls when you type in a command.</li>
<li>The type of the first parameter in each of the Execute methods must be one of the following:
<ul>
<li><tt>Channel</tt></li>
<li><tt>Server</tt></li>
<li><tt>PrivateMessageSession</tt></li>
</ul>
<p>This parameter represents the context in which the command was executed, in other words, the window. (A channel window, PM window&#8230;)</li>
<li>The type of each of the remaining parameters must be either <tt>string</tt> or <tt>ChannelInfo</tt>. The <tt>ChannelInfo</tt> object is simply to let the command know that the user specified a channel name, ie &#8220;#luahelp&#8221;.</li>
<li>If you want autocomplete support the <tt>Execute</tt> methods must each have proper XML docs. (This has not yet been implemented, I will discuss it in more detail when it is)</li>
</ol>
<p>If these rules are not followed, the command will either not be loaded or not called when the user attempts to execute it. When a user types in a command, the plugin system looks through the commands it has loaded and looks for one that meets all these requirements and whose parameters match the parameters given by the user.</p>
<p>This command system is much more dynamic and easier on the programmer than other systems I have seen, which usually require the programmer to manage arguments manually and add a lot of redundant code.</p>
<p>Questions, comments, suggestions welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://ortz.org/2009/04/12/dynamic-command-plugins/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OrtzIRC Update</title>
		<link>http://ortz.org/2008/12/30/ortzirc-update-4/</link>
		<comments>http://ortz.org/2008/12/30/ortzirc-update-4/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 02:41:06 +0000</pubDate>
		<dc:creator>Ortzinator</dc:creator>
				<category><![CDATA[OrtzIRC]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[MAF]]></category>
		<category><![CDATA[MEF]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[System.AddIn]]></category>
		<guid isPermaLink="false">http://blog.ortz.org/?p=186</guid>
		<description><![CDATA[Time for another update. Last time I posted about OrtzIRC, I mentioned I was looking at using System.AddIn as the framework for OrtzIRC&#8217;s plugins. (I&#8217;ll just call it MAF for Managed AddIn Framework, what it used to be called) Well the biggest problem with MAF is that it&#8217;s so freaking complicated. After I finally sat [...]]]></description>
			<content:encoded><![CDATA[<p>Time for another update.</p>
<p><a href="http://blog.ortz.org/2008/11/23/ortzirc-update-3/">Last time</a> I posted about <a href="http://code.google.com/p/ortzirc/">OrtzIRC</a>, I mentioned I was looking at using <a href="http://www.codeplex.com/clraddins">System.AddIn</a> as the framework for OrtzIRC&#8217;s plugins. (I&#8217;ll just call it MAF for Managed AddIn Framework, what it used to be called) Well the biggest problem with MAF is that it&#8217;s so freaking complicated. After I finally sat down for a while and read up on it, it just seemed to get more and more complex. And even more so when I started asking &#8220;well, how would I do this?&#8221;. For instance, <em>everything </em>that crosses the isolation boundary needs a contract. Events, collections (you have to use IListContract), everything. So for OrtzIRC this meant every single event (something like two dozen) needed to be redefined as contracts. (Or wrapped, or whatever) Another problem is that <strong>nobody uses it</strong>. I&#8217;ve only found two projects on CodePlex that use it and virtually no blog posts about it. I&#8217;ll admit, I never completely understood it all, but I&#8217;m pretty sure it would&#8217;ve been a LOT of work. Our own way may also be a lot of work, but at least it&#8217;s our own way. <img src='http://ortz.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Which is what I really wanted to discuss today&#8230;</p>
<p>As a quick side note, I did discover the <a href="http://www.codeplex.com/MEF">Managed Extensibility Framework</a>, being developed by Microsoft, presumably for future inclusion in the .NET framework. It looks really nice. Much simpler than MAF. And more popular too, at least on <a href="http://stackoverflow.com/questions/tagged/mef">Stack Overflow</a>. It&#8217;s a really young project though, and although they&#8217;re making it rather clear that MEF is here to stay, I think I&#8217;ll wait until CTP to give it serious consideration.</p>
<p>So Max and I had a disagreement about how to do the command plugins but that has been resolved (he won lol). So I&#8217;ll just point you to his <a href="http://maxschmeling.blogspot.com/2008/08/ortzirc.html">two</a> <a href="http://maxschmeling.blogspot.com/2008/08/irc-commands.html">posts</a> he wrote about it rather than re-explain it.</p>
<p>Onward and upward!</p>
]]></content:encoded>
			<wfw:commentRss>http://ortz.org/2008/12/30/ortzirc-update-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OrtzIRC Update</title>
		<link>http://ortz.org/2008/11/23/ortzirc-update-3/</link>
		<comments>http://ortz.org/2008/11/23/ortzirc-update-3/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 00:17:27 +0000</pubDate>
		<dc:creator>Ortzinator</dc:creator>
				<category><![CDATA[OrtzIRC]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[scripting]]></category>
		<guid isPermaLink="false">http://blog.ortz.org/?p=166</guid>
		<description><![CDATA[Just wanted to make a quick note about the progress of OrtzIRC. It&#8217;s been pretty slow lately. I really want to get commands in before I do anything else, just to get it in a semi-usable state. So this means taking a step back and trying to work out how to do plugins. We were [...]]]></description>
			<content:encoded><![CDATA[<p>Just wanted to make a quick note about the progress of <a href="http://www.ortzirc.com">OrtzIRC</a>.</p>
<p>It&#8217;s been pretty slow lately. I really want to get commands in before I do anything else, just to get it in a semi-usable state. So this means taking a step back and trying to work out how to do plugins.</p>
<p>We were kind of at a loss at first (I was anyway) but then I found out that .NET 3.5 had this new system for adding plugins to your apps <a href="http://msdn.microsoft.com/en-us/library/bb384241.aspx">System.AddIn</a>. So far this looks really nice, and I&#8217;ll be implementing it soon unless Max has any objections. The only issue I can see so far is that I don&#8217;t know how this will jibe with possibly adding scripting later on.</p>
<p>You can get updates more often by following me on <a href="http://twitter.com/ortzinator">Twitter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ortz.org/2008/11/23/ortzirc-update-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OrtzIRC Update</title>
		<link>http://ortz.org/2008/09/28/ortzirc-update-2/</link>
		<comments>http://ortz.org/2008/09/28/ortzirc-update-2/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 03:05:12 +0000</pubDate>
		<dc:creator>Ortzinator</dc:creator>
				<category><![CDATA[OrtzIRC]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[FlamingIRC]]></category>
		<category><![CDATA[GPL]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[Thresher]]></category>
		<category><![CDATA[XChat]]></category>
		<guid isPermaLink="false">http://blog.ortz.org/2008/09/28/ortzirc-update-2/</guid>
		<description><![CDATA[Progress has been slow, but it hasn&#8217;t stopped. It&#8217;s been a while since the last update so forgive me if I repeat anything. The biggest news to tell is probably FlamingIRC. I decided pretty early on that there was no need to reinvent the wheel and so decided against writing my own IRC lib. So [...]]]></description>
			<content:encoded><![CDATA[<p>Progress has been slow, but it hasn&#8217;t stopped. It&#8217;s been a while since the last update so forgive me if I repeat anything.</p>
<p>The biggest news to tell is probably FlamingIRC. I decided pretty early on that there was no need to reinvent the wheel and so decided against writing my own IRC lib. So I went with what seemed to be the most popular IRC library for .NET, <a href="http://thresher.sourceforge.net/" target="_blank">Thresher</a>. After having it pointed out to me how old and outdated the code for Thresher was (I think it was written for the first version of .NET) I decided to fork it and name it FlamingIRC. Sadly it&#8217;s under the GPL so it has to stay that way. I hate how viral GPL is. It&#8217;s very heavy-handed.</p>
<p><a href="http://maxschmeling.blogspot.com/" target="_blank">Max Schmeling</a> sort of gave OrtzIRC a shot of adrenaline, cleaning up some of my code and improving a lot of things overall. I just wish I could code as fast as him&#8230;</p>
<p>I&#8217;m still thinking about features to add, mainly plugins and scripting. I&#8217;ve been thinking that both a plugin system and a scripting system would be over kill, but that seems to be how <a href="http://xchat.org/" target="_blank">XChat</a> does it so I&#8217;ll have to do some more research. <strong>If you have any experience with implementing plugin systems and/or scripting systems or know where I can get some information on implementing them, please leave a comment!</strong></p>
<p>I don&#8217;t think I&#8217;ve linked to the project page yet, so <a href="http://www.ortzirc.com" target="_blank">here you go</a>. You can take a look at the code if you want but there really isn&#8217;t anything to see yet. However if you do happen to see any bugs, or if you have any feature requests feel free to open an issue. I also started a page on <span style="text-decoration: line-through;"><a href="http://code.google.com/p/ortzirc/wiki/Features" target="_blank">planned features</a></span>, mostly for my reference., which is obviously subject to frequent change.</p>
]]></content:encoded>
			<wfw:commentRss>http://ortz.org/2008/09/28/ortzirc-update-2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

