<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/marvin/irc/server/channel.rb</filename>
    </added>
    <added>
      <filename>lib/marvin/irc/server/named_store.rb</filename>
    </added>
    <added>
      <filename>lib/marvin/irc/server/user_connection.rb</filename>
    </added>
    <added>
      <filename>rfcs/README</filename>
    </added>
    <added>
      <filename>rfcs/ctcp.txt</filename>
    </added>
    <added>
      <filename>rfcs/ctcp_ext.txt</filename>
    </added>
    <added>
      <filename>rfcs/dcc.txt</filename>
    </added>
    <added>
      <filename>rfcs/rfc1459.txt</filename>
    </added>
    <added>
      <filename>rfcs/rfc2810.txt</filename>
    </added>
    <added>
      <filename>rfcs/rfc2811.txt</filename>
    </added>
    <added>
      <filename>rfcs/rfc2812.txt</filename>
    </added>
    <added>
      <filename>rfcs/rfc2813.txt</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,6 +2,9 @@ module Marvin
   module IRC
     module Server
       
+      # Server utilities
+      autoload :NamedStore,         'marvin/irc/server/named_store'
+      autoload :Channel,            'marvin/irc/server/channel'
       # The actual network connection
       autoload :BaseConnection,     'marvin/irc/server/base_connection'
       # An our implementations of protocol-specific stuff.
@@ -9,6 +12,22 @@ module Marvin
       autoload :UserConnection,     'marvin/irc/server/user_connection'
       autoload :ServerConnection,   'marvin/irc/server/server_connection'
       
+      # Store each user
+      UserStore = NamedStore.new(:nicks, :user) do
+        def nick_taken?(nick)
+          has_key?(nick)
+        end
+        
+        def each_user_except(user)
+          self.each_user do |u|
+            yield u unless user == u 
+          end
+        end
+      end
+      
+      # Store each channel
+      ChannelStore = NamedStore(:names, :channel)
+      
       # call start_server w/ the default options
       # and inside an EM::run block.
       def self.run</diff>
      <filename>lib/marvin/irc/server.rb</filename>
    </modified>
    <modified>
      <diff>@@ -49,6 +49,25 @@ module Marvin::IRC::Server
       end
       
     end
+    
+    private
+    
+    def rpl(number, *args)
+      code = Marvin::IRC::Replies[&quot;RPL_#{number.to_s.upcase}&quot;]
+      return command(code, *args)
+    end
+    
+    def err(number, *args)
+      code = Marvin::IRC::Replies[&quot;ERR_#{number.to_s.upcase}&quot;]
+      return command(code, *args)
+    end
+    
+    def command(name, *args)
+      opts = args.extract_options!
+      formatted = [name.to_s.upcase, *args].join(&quot; &quot;)
+      formatted = &quot;:#{opts[:prefix]} #{formatted}&quot; if opts[:prefix]
+      send_line formatted
+    end
   
   end
 end
\ No newline at end of file</diff>
      <filename>lib/marvin/irc/server/abstract_connection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,13 @@
 module Marvin
   module Util
       
+      GLOB_PATTERN_MAP = {
+        '*' =&gt; '.*',
+        '?' =&gt; '.',
+        '[' =&gt; '[',
+        ']' =&gt; ']'
+      }
+      
       # Return the channel-name version of a string by
       # appending &quot;#&quot; to the front if it doesn't already
       # start with it.
@@ -20,9 +27,19 @@ module Marvin
       # specify parameters which have spaces etc (for example,
       # the actual message part of a response).
       def last_param(section)
-        section &amp;&amp; &quot;:#{section.to_s.strip} &quot;
+        section &amp;&amp; &quot;:#{section.to_s.strip}&quot;
       end
       alias lp last_param
+      
+      # Converts a glob-like pattern into a regular
+      # expression for easy / fast matching. Code is
+      # from PLEAC at http://pleac.sourceforge.net/pleac_ruby/patternmatching.html
+      def glob2pattern(glob_string)
+          inner_pattern = glob_string.gsub(/(.)/) do |c|
+            GLOB_PATTERN_MAP[c] || Regexp::escape(c)
+          end
+        return Regexp.new(&quot;^#{inner_pattern}$&quot;)
+      end
      
       extend self
      </diff>
      <filename>lib/marvin/util.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>07620fcc15d96d73124ea9ca9aa4fc2e98e878be</id>
    </parent>
  </parents>
  <author>
    <name>Darcy Laycock</name>
    <email>sutto@sutto.net</email>
  </author>
  <url>http://github.com/Sutto/marvin/commit/38686dabe5881d18ae92421bef4e6e22feec55c1</url>
  <id>38686dabe5881d18ae92421bef4e6e22feec55c1</id>
  <committed-date>2008-11-22T03:22:31-08:00</committed-date>
  <authored-date>2008-11-22T03:22:31-08:00</authored-date>
  <message>More server work, added RFC's to the checkout and the like</message>
  <tree>88a3c42eb83f9b7424d7e4ff9f7e9515def814ed</tree>
  <committer>
    <name>Darcy Laycock</name>
    <email>sutto@sutto.net</email>
  </committer>
</commit>
