diff -urN tiarra-20060628/.svnversion tiarra-20071125/.svnversion
--- tiarra-20060628/.svnversion	2006-06-28 23:55:53.000000000 +0900
+++ tiarra-20071125/.svnversion	2007-11-25 22:20:35.000000000 +0900
@@ -1 +1 @@
-913
+921
diff -urN tiarra-20060628/ChangeLog.svn tiarra-20071125/ChangeLog.svn
--- tiarra-20060628/ChangeLog.svn	2006-06-28 23:56:03.000000000 +0900
+++ tiarra-20071125/ChangeLog.svn	2007-11-25 22:20:49.000000000 +0900
@@ -1,4 +1,59 @@
 ------------------------------------------------------------------------
+r921 | topia | 2007-11-25 22:18:56 +0900 (Sun, 25 Nov 2007) | 2 lines
+Changed paths:
+   M /trunk/main/Tiarra/Utils/DefineHelper.pm
+
+* add POD.
+
+------------------------------------------------------------------------
+r920 | topia | 2007-11-25 22:17:26 +0900 (Sun, 25 Nov 2007) | 2 lines
+Changed paths:
+   M /trunk/main/Tiarra/Mixin/NewIRCMessage.pm
+
+* whitespace changes.
+
+------------------------------------------------------------------------
+r919 | topia | 2007-11-25 22:16:50 +0900 (Sun, 25 Nov 2007) | 2 lines
+Changed paths:
+   M /trunk/main/IrcIO/Server.pm
+
+* do not proxy RPL_WELCOME to client.
+
+------------------------------------------------------------------------
+r918 | topia | 2007-11-25 22:14:45 +0900 (Sun, 25 Nov 2007) | 2 lines
+Changed paths:
+   M /trunk/main/Tiarra/Encoding/Encode/CP932JIS.pm
+
+* skip unfinished escape sequence.
+
+------------------------------------------------------------------------
+r917 | topia | 2007-11-11 03:40:38 +0900 (Sun, 11 Nov 2007) | 2 lines
+Changed paths:
+   M /trunk/main/Multicast.pm
+
+* add ERR_UNAVAILRESOURCE to attach/detach.
+
+------------------------------------------------------------------------
+r916 | topia | 2006-08-12 18:31:41 +0900 (Sat, 12 Aug 2006) | 1 line
+Changed paths:
+   M /trunk/main/IrcIO.pm
+
+ * fix typo.
+------------------------------------------------------------------------
+r915 | topia | 2006-08-12 15:26:28 +0900 (Sat, 12 Aug 2006) | 2 lines
+Changed paths:
+   M /trunk/main/IrcIO/Server.pm
+
+ * drop remark pong-drop-counter on disconnect.
+
+------------------------------------------------------------------------
+r914 | topia | 2006-07-22 00:10:08 +0900 (Sat, 22 Jul 2006) | 2 lines
+Changed paths:
+   M /trunk/main/Tiarra/Utils/DefineHelper.pm
+
+ * show args when function call with many args.
+
+------------------------------------------------------------------------
 r913 | topia | 2006-06-28 23:51:54 +0900 (Wed, 28 Jun 2006) | 2 lines
 Changed paths:
    M /trunk/main/RunLoop.pm
diff -urN tiarra-20060628/main/IrcIO/Server.pm tiarra-20071125/main/IrcIO/Server.pm
--- tiarra-20060628/main/IrcIO/Server.pm	2006-06-28 23:55:53.000000000 +0900
+++ tiarra-20071125/main/IrcIO/Server.pm	2007-11-25 22:20:35.000000000 +0900
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: Server.pm 866 2005-03-26 16:57:29Z topia $
+# $Id: Server.pm 919 2007-11-25 13:16:50Z topia $
 # -----------------------------------------------------------------------------
 # IrcIO::ServerはIRCサーバーに接続し、IRCメッセージをやり取りするクラスです。
 # このクラスはサーバーからメッセージを受け取ってチャンネル情報や現在のnickなどを保持しますが、
@@ -516,6 +516,8 @@
     } elsif ($this->state_finalizing) {
 	$this->state_finalized(1);
     }
+    # remove pong drop counter
+    $this->remark('pong-drop-counter', undef, 'delete');
 }
 
 sub quit {
@@ -604,6 +606,7 @@
 		      $this->{user_shortname},
 		      $this->{user_realname});
 
+
 	$this->printmsg("Logged-in successfuly into ".$this->destination.".");
 
 	# 各モジュールにサーバー追加の通知を行なう。
@@ -613,6 +616,7 @@
 	    $this->_runloop->reconnected_server($this);
 	}
 	$this->{new_connection} = undef;
+	return;
     }
     elsif ($reply eq ERR_NICKNAMEINUSE) {
 	# nick重複。
diff -urN tiarra-20060628/main/IrcIO.pm tiarra-20071125/main/IrcIO.pm
--- tiarra-20060628/main/IrcIO.pm	2006-06-28 23:55:54.000000000 +0900
+++ tiarra-20071125/main/IrcIO.pm	2007-11-25 22:20:36.000000000 +0900
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: IrcIO.pm 884 2005-03-30 07:14:01Z topia $
+# $Id: IrcIO.pm 916 2006-08-12 09:31:41Z topia $
 # -----------------------------------------------------------------------------
 # IrcIOはIRCサーバー又はクライアントと接続し、IRCメッセージをやり取りする抽象クラスです。
 # -----------------------------------------------------------------------------
@@ -125,7 +125,7 @@
 
 	# message_encoding_hook
 	my $filtered = $this->_runloop->apply_filters(
-	    [$msg], 'message_encoding_hook', $this, 'out', $encoding);
+	    [$msg], 'message_encoding_hook', $this, 'in', $encoding);
 
 	# message_io_hook
 	$filtered = $this->_runloop->apply_filters(
diff -urN tiarra-20060628/main/Multicast.pm tiarra-20071125/main/Multicast.pm
--- tiarra-20060628/main/Multicast.pm	2006-06-28 23:55:54.000000000 +0900
+++ tiarra-20071125/main/Multicast.pm	2007-11-25 22:20:36.000000000 +0900
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: Multicast.pm 883 2005-03-29 14:32:04Z topia $
+# $Id: Multicast.pm 917 2007-11-10 18:40:38Z topia $
 # -----------------------------------------------------------------------------
 # サーバーからクライアントにメッセージが流れるとき、このクラスはフィルタとして
 # ネットワーク名を付加します。
@@ -370,7 +370,8 @@
 		 (map {"ENDOF$_"} qw(WHO NAMES)),
 		 qw(LIST CHANNELMODEIS NOTOPIC TOPIC TOPICWHOTIME),
 		 qw(CREATIONTIME))),
-	   qw(ERR_TOOMANYCHANNELS ERR_NOTONCHANNEL ERR_NOSUCHCHANNEL))},
+	   ((map {"ERR_$_"}
+		 (qw(TOOMANYCHANNELS NOTONCHANNEL NOSUCHCHANNEL UNAVAILRESOURCE)))))},
     do {
 	no strict 'refs';
 	map {
@@ -445,7 +446,8 @@
 		 (map {"ENDOF$_"} qw(WHO NAMES)),
 		 qw(LIST CHANNELMODEIS NOTOPIC TOPIC TOPICWHOTIME),
 		 qw(CREATIONTIME INVITING UNIQOPIS WHOREPLY))),
-	   qw(ERR_TOOMANYCHANNELS ERR_NOTONCHANNEL ERR_NOSUCHCHANNEL))},
+	   (map {"ERR_$_"}
+		 (qw(TOOMANYCHANNELS NOTONCHANNEL NOSUCHCHANNEL UNAVAILRESOURCE))))},
     do {
 	no strict 'refs';
 	map {
diff -urN tiarra-20060628/main/Tiarra/Encoding/Encode/CP932JIS.pm tiarra-20071125/main/Tiarra/Encoding/Encode/CP932JIS.pm
--- tiarra-20060628/main/Tiarra/Encoding/Encode/CP932JIS.pm	2006-06-28 23:55:53.000000000 +0900
+++ tiarra-20071125/main/Tiarra/Encoding/Encode/CP932JIS.pm	2007-11-25 22:20:35.000000000 +0900
@@ -60,6 +60,8 @@
 		}exog;
 		$ret .= Encode::decode('cp932', $chunk, FB_PERLQQ);
 	    }
+	} elsif ($str =~ s/\A\e[\$\(]?$//s) {
+	    # skip unfinished escape seq.
 	} elsif ($str =~ s/\A(\e?[^\e]*)//s) {
 	    my $str = $1;
 	    $ret .= Encode::decode('cp932', $str, FB_PERLQQ);
diff -urN tiarra-20060628/main/Tiarra/Mixin/NewIRCMessage.pm tiarra-20071125/main/Tiarra/Mixin/NewIRCMessage.pm
--- tiarra-20060628/main/Tiarra/Mixin/NewIRCMessage.pm	2006-06-28 23:55:53.000000000 +0900
+++ tiarra-20071125/main/Tiarra/Mixin/NewIRCMessage.pm	2007-11-25 22:20:35.000000000 +0900
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: NewIRCMessage.pm 874 2005-03-27 19:04:59Z topia $
+# $Id: NewIRCMessage.pm 920 2007-11-25 13:17:26Z topia $
 # -----------------------------------------------------------------------------
 # copyright (C) 2005 Topia <topia@clovery.jp>. all rights reserved.
 package Tiarra::Mixin::NewIRCMessage;
@@ -12,7 +12,7 @@
 Tiarra::Mixin::NewIRCMessage - Tiarra::IRC::Message Construction Interface Mixin
 =head1 SYNOPSIS
 
-  package foo::class; 
+  package foo::class;
   use base qw(Tiarra::Mixin::NewIRCMessage); # use this
   $this->irc_message_class->foo_class_method;
   $this->construct_irc_message(Command => ...);
diff -urN tiarra-20060628/main/Tiarra/Utils/DefineHelper.pm tiarra-20071125/main/Tiarra/Utils/DefineHelper.pm
--- tiarra-20060628/main/Tiarra/Utils/DefineHelper.pm	2006-06-28 23:55:53.000000000 +0900
+++ tiarra-20071125/main/Tiarra/Utils/DefineHelper.pm	2007-11-25 22:20:35.000000000 +0900
@@ -1,13 +1,12 @@
 # -----------------------------------------------------------------------------
-# $Id: DefineHelper.pm 753 2005-02-16 10:22:29Z topia $
+# $Id: DefineHelper.pm 921 2007-11-25 13:18:56Z topia $
 # -----------------------------------------------------------------------------
 # Define Helper Utilities
 # -----------------------------------------------------------------------------
-# copyright (C) 2004 Topia <topia@clovery.jp>. all rights reserved.
+# copyright (C) 2004-2005 Topia <topia@clovery.jp>. all rights reserved.
 package Tiarra::Utils::DefineHelper;
 use strict;
 use warnings;
-use Tiarra::Utils::Core;
 use base qw(Tiarra::Utils::Core);
 our $ExportLevel = 0;
 
@@ -19,9 +18,55 @@
 #         });
 # in define_*s' wrapper function.
 
-# all function is class method.
-# please use package->method(...);
-# maybe all functions can use with Tiarra::Utils->...
+
+=head1 NAME
+
+Tiarra::Utils::DefineHelper - Tiarra misc Utility Functions: Define Helper
+
+=head1 SYNOPSIS
+
+  use Tiarra::Utils; # import master
+
+=head1 DESCRIPTION
+
+Tiarra::Utils is misc helper functions class. this class is implement define
+helpers. (accessors, proxys, ...)
+
+class splitting is maintainer issue only. please require/use Tiarra::Utils.
+
+all function is class method; please use package->method(...);
+
+maybe all functions can use with utils->...
+
+=head1 METHODS
+
+=over 4
+
+=cut
+
+=item define_function
+
+  utils->define_function($package, $code, @funcnames)
+
+define function with some package, code, funcnames.
+
+=over 4
+
+=item * $package
+
+package name. such as C<< utils->get_package($some_level) >>.
+
+=item * $code
+
+coderef(closure) of function. such as C<< sub { shift->foo_func('bar') } >>.
+
+=item * @funcnames
+
+function names to define.
+
+=back
+
+=cut
 
 sub define_function {
     shift; #package
@@ -65,10 +110,52 @@
     undef;
 }
 
+=item define_attr_accessor
+
+  utils->define_attr_accessor($class_method_p, @defines)
+
+define attribute accessor.
+
+=over 4
+
+=item * $class_method_p
+
+these accessor is called as class method, pass true; otherwise false.
+
+=item * @defines
+
+accessor defines array.
+
+=over 4
+
+=item * scalar value ($valname)
+
+define ->$valname for accessor of ->{$valname}.
+
+=item * array ref value ([$funcname, $valname])
+
+define ->$funcname for accessor of ->{$valname}.
+
+=back
+
+=back
+
+=cut
+
 sub define_attr_accessor {
     shift->_define_attr_common('accessor', @_);
 }
 
+=item define_attr_getter
+
+  utils->define_attr_getter($class_method_p, @defines)
+
+define attribute getter.
+
+all params is same as L</define_attr_accessor>, except s/accessor/getter/.
+
+=cut
+
 sub define_attr_getter {
     shift->_define_attr_common('getter', @_);
 }
@@ -130,6 +217,40 @@
     undef;
 }
 
+=item define_array_attr_accessor
+
+  utils->define_attr_accessor($class_method_p, @defines)
+
+define attribute accessor for array type object.
+
+=over 4
+
+=item * $class_method_p
+
+these accessor is called as class method, pass true; otherwise false.
+
+=item * @defines
+
+accessor defines array.
+
+=over 4
+
+=item * scalar value (value)
+
+define ->value for accessor of ->[VALUE].
+
+example: ->define_attr
+
+=item * array ref value ([$funcname, $valname])
+
+define ->$funcname for accessor of ->{$valname}.
+
+=back
+
+=back
+
+=cut
+
 sub define_array_attr_accessor {
     shift->_define_array_attr_common('accessor', @_);
 }
@@ -271,7 +392,7 @@
 		       getter   => '',
 		   }->{$type}),
 		   ' {',
-		   ' die "too many args" if $#_ >= ',
+		   ' die "too many args: @_" if $#_ >= ',
 		   ({
 		       accessor => '2',
 		       getter   => '1',
@@ -307,7 +428,7 @@
 		   (defined $funcname ? "->$funcname\: " : ''),
 		   "attr $type\"\n",
 		   '(sub {',
-		   ' die "too many args" if $#_ >= 2;',
+		   ' die "too many args: @_" if $#_ >= 2;',
 		   ' my $this = shift',
 		   ($class_method_p ? '->_this' : ''),
 		   ';',
@@ -328,5 +449,25 @@
 	(print STDERR __PACKAGE__."/generator error: \n$str\n$@", undef);
 }
 
-
 1;
+
+__END__
+=back
+
+=head1 SEE ALSO
+
+L<Tiarra::Utils>
+
+=head1 AUTHOR
+
+Topia E<lt>topia@clovery.jpE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2005 by Topia.
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.8.6 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
