2003.08.15 (金) 03:06:36 <Heracules> settings.pas内でTStringList?を使用するとコンパイルはとおるけど例外が発生するみたいなので、該当部分を書き換えました。
2003.08.15 (金) 03:07:18 <Heracules> 他、各所に追加、修正を加えてます(特に自動入室関連)。

shuusei211140:自動入室のチャンネルを複数指定可能にした(source by Heracules, idea by hari)

diff --dos -urN 211139/vars.pas 211140/vars.pas
--- 211139/vars.pas	Fri Aug 15 00:16:48 2003
+++ 211140/vars.pas	Fri Aug 15 01:19:58 2003
@@ -261,7 +261,7 @@
  loginim_user: String;
  loginim: Array[0..MAX_LOGINIM] of String;
  force_enter: Boolean;
- force_enter_channel: String;
+ force_enter_channel: Array[0..MAX_FORCE_ENTER] of String;
  old_force_enter: Boolean;
  force_enter_furiwake: Boolean;
  mx3_auto_im: Boolean;
diff --dos -urN 211139/constants.pas 211140/constants.pas
--- 211139/constants.pas	Thu Aug 14 22:32:16 2003
+++ 211140/constants.pas	Fri Aug 15 02:42:50 2003
@@ -49,6 +49,7 @@
  MAX_LISTEN_TRAPSOCKET        = 7; // maximum listen trapsockets
  MAX_LISTEN_REDIRECT          = 7; // maximum listen redirect
  MAX_BLOCK_PORT               = 7; // maximum block client's data port
+ MAX_FORCE_ENTER              = 5; // maximum force enter channels
  DEF_LISTEN_PORT              = 8888; //3456; // default port for listening
  DEF_LISTEN_PORTS             = '3456 8888';
  RECV_BUF_SIZE_MIN            = 128;
diff --dos -urN 211139/handler.pas 211140/handler.pas
--- 211139/handler.pas	Thu Aug 14 22:44:36 2003
+++ 211140/handler.pas	Fri Aug 15 02:21:42 2003
@@ -60,6 +60,7 @@
 var
  gcmd: TNapCmd;
  ResolvingCount: Integer; // ホスト名解決中のTUserListReverseDNSThreadの数
+ user: POnlineUser;
 
 implementation
 
@@ -70,7 +71,6 @@
 
 var
  hlist,hlst: TStringList;
- user: POnlineUser;
  server: TServer;
  local: TLocalUser;
  query: TQuery;
@@ -1263,28 +1263,18 @@
  end;
  tmp_pos:=207;
  if mx3_auto_im then
- begin
    if (Pos('WinMX',local.software)<>0) and (Pos('3',local.software)<>0) then
-   begin
      if mx3_auto_im_text<>'' then
        local.Exec(MSG_CLIENT_PRIVMSG,loginim_user+' '+mx3_auto_im_text);
-   end;
- end;
  tmp_pos:=208;
- if force_enter then
- begin
-   if old_force_enter then
-   begin
-     if not ((Pos('WinMX',local.software)<>0) and (Pos('3',local.software)<>0)) then
-     begin
-       gcmd.cmd:=force_enter_channel;
-       Handler_JoinChannel;
-     end;
-     local.auto_channel:=True;
-   end else
-   local.auto_channel:=False;
- end else
-   local.auto_channel:=True;
+ if force_enter and  old_force_enter then
+   if not ((Pos('WinMX',local.software)<>0) and (Pos('3',local.software)<>0)) then
+     for i:=0 to MAX_FORCE_ENTER do
+       if force_enter_channel[i]<>'' then
+       begin
+         gcmd.cmd:=force_enter_channel[i];
+         Handler_JoinChannel;
+       end;
  local.Flush;
  if dengon_enabled then begin
    gcmd.id:=MSG_CLIENT_DENGON_READNEW2;
diff --dos -urN 211139/mainform.pas 211140/mainform.pas
--- 211139/mainform.pas	Fri Aug 15 00:41:04 2003
+++ 211140/mainform.pas	Fri Aug 15 02:11:18 2003
@@ -885,6 +885,8 @@
  end;
  for i:=0 to MAX_BLOCK_PORT do
    block_port[i]:=0;
+ for i:=0 to MAX_FORCE_ENTER do
+   force_enter_channel[i]:='';
  napigator_socket:=INVALID_SOCKET;
  dagsta_socket:=INVALID_SOCKET;
  stats_socket:=INVALID_SOCKET;
@@ -1319,7 +1321,6 @@
   flood_warning:=ini.ReadBool('Channels','FloodWarning',true);
   flood_enable:=ini.ReadBool('Channels','FloodEnabled',true);
   force_enter:=ini.ReadBool('Channels','ForceEnter',false);
-  force_enter_channel:=ini.ReadString('Channels','ForceEnterChannel','#Alternative');
   force_enter_furiwake:=ini.ReadBool('Channels','ForceEnterFuriwake',false);
   old_force_enter:=ini.ReadBool('Channels','OldForceEnter',true);
   enable_inflections:=ini.ReadBool('Channels','EnableInflections',false);
@@ -1582,6 +1583,10 @@
   SplitString(str,list);
   for i:=0 to list.Count-1 do
     block_port[i]:=StrToIntDef(list.Strings[i],0);
+  str:=ini.ReadString('Channels','ForceEnterChannel','#Alternative');
+  SplitString(str,list);
+  for i:=0 to list.Count-1 do
+    force_enter_channel[i]:=list.Strings[i];
   // set up console
   LogStartup('mainform::loadconfig: setting up console user');
   cons_channels:=TList.Create;
@@ -1593,7 +1598,6 @@
   cons:=TLocalUser.Create;
   cons.localstate:=cons.localstate+[locPingable];
   cons.last_seen:=GetTickCount;
-  cons.auto_channel:=True;
   rec.nick:=ini.ReadString('Console','User','Admin');
   rec.state:=Int2UserState(ini.ReadInteger('Console','UserMode',0),false);
   rec.speed:=TNapSpeed(ini.ReadInteger('Console','Speed',0));
@@ -1919,7 +1923,6 @@
   ini.WriteBool('Channels','FloodWarning',flood_warning);
   ini.WriteBool('Channels','FloodEnabled',flood_enable);
   ini.WriteBool('Channels','ForceEnter',force_enter);
-  ini.WriteString('Channels','ForceEnterChannel',force_enter_channel);
   ini.WriteBool('Channels','ForceEnterFuriwake',force_enter_furiwake);
   ini.WriteBool('Channels','OldForceEnter',old_force_enter);
   ini.WriteBool('Channels','EnableInflections',enable_inflections);
@@ -4255,34 +4258,33 @@
 
 procedure TSlavaNapWindow.CheckForceEnter;
 var
- i: Integer;
+ i,j: Integer;
  loc: TLocalUser;
 begin
   tmp_pos:=12267;
   if not force_enter then exit;
   tmp_pos:=12268;
+  if old_force_enter then exit;
+  tmp_pos:=12269;
   for i:=0 to db_local.count-1 do
   begin
     loc:=db_local.Items[i];
-    tmp_pos:=12269;
+    tmp_pos:=12270;
     if loc.logged then
-    begin
-      if loc.last_channel_time>0 then
-      begin
-        loc.last_channel_time:=loc.last_channel_time -1;
-      end
-      else if (loc.last_channel_time<=0) and Not loc.auto_channel then
-      begin
-        if Not ((Pos('WinMX',loc.software)<>0) and (Pos('3',loc.software)<>0)) then
-        begin
-          gcmd.cmd:=force_enter_channel;
-          Handler_JoinChannel;
-          loc.auto_channel:=True;
-        end;
-      end;
-    end;
+      if loc.level<>napUserConsole then
+        if loc.last_channel_time>0 then
+          loc.last_channel_time:=loc.last_channel_time -1
+        else if (loc.last_channel_time<=0) then
+          if Not ((Pos('WinMX',loc.software)>0) and (Pos('3',loc.software)>0)) then
+            for j:=0 to MAX_FORCE_ENTER do
+              if force_enter_channel[j]<>'' then
+              begin
+                handler.user:=loc.data;
+                gcmd.cmd:=force_enter_channel[j];
+                Handler_JoinChannel;
+              end;
   end;
-  tmp_pos:=12270;
+  tmp_pos:=12271;
 end;
 
 procedure TSlavaNapWindow.btn_hotlist_addClick(Sender: TObject);
diff --dos -urN 211139/settings.pas 211140/settings.pas
--- 211139/settings.pas	Fri Aug 15 00:40:54 2003
+++ 211140/settings.pas	Fri Aug 15 02:59:28 2003
@@ -1394,12 +1394,18 @@
 procedure TSlavaNapSettings.sh_other2Show(Sender: TObject);
 var
  i: Integer;
+ ini: TIniFile;
 begin
   SetTopText('ほかの設定');
   SetChange(true);
   cb_loginim_enable.Checked:=loginim_enabled;
   cb_channels_forceenter.Checked:=force_enter;
-  edit_channels_forceenter.Text:=force_enter_channel;
+  ini:=TIniFile.Create(Applicationdir+'config');
+  try
+    edit_channels_forceenter.Text:=ini.ReadString('Channels','ForceEnterChannel','#Alternative');
+  finally
+    ini.Free;
+  end;
   cb_channels_old_forceenter.Checked:=old_force_enter;
   cb_force_enter_furiwake.Checked:=force_enter_furiwake;
   edit_channels_forceenter.Visible:=cb_channels_forceenter.Checked;
@@ -1482,11 +1488,11 @@
   ini:=TIniFile.Create(Applicationdir+'config');
   try
     edit_loginblock_port.Text:=ini.ReadString('Other','LoginBlockPortNumber','6699 7743');
-    Label147.Visible:=cb_loginblock_port.Checked;
-    edit_loginblock_port.Visible:=cb_loginblock_port.Checked;
   finally
     ini.Free;
   end;
+  edit_loginblock_port.Visible:=cb_loginblock_port.Checked;
+  Label147.Visible:=cb_loginblock_port.Checked;
   Label148.Visible:=cb_enable_rating.Checked;
   edit_rating_threshold.Visible:=cb_enable_rating.Checked;
 end;
@@ -1612,8 +1618,8 @@
 var
  ini: TIniFile;
  reg: TRegistry;
- i: Integer;
- list: TStringList;
+ i,j: Integer;
+ str: String;
 begin
  if pages.ActivePage=sh_main then
  try
@@ -1966,7 +1972,23 @@
    loginim_enabled:=cb_loginim_enable.Checked;
    loginim_user:=edit_loginim_user.Text;
    force_enter:=cb_channels_forceenter.Checked;
-   force_enter_channel:=edit_channels_forceenter.Text;
+   str:=edit_channels_forceenter.Text;
+   ini:=TIniFile.Create(Applicationdir+'config');
+   try
+     ini.WriteString('Channels','ForceEnterChannel',str);
+   finally
+     ini.Free;
+   end;
+   for i:=0 to MAX_FORCE_ENTER do
+   begin
+     j:=AnsiPos(' ',str);
+     if j>0 then
+     begin
+       force_enter_channel[i]:=Copy(str,1,j-1);
+       str:=Copy(str,j+1,Length(str)-j);
+     end else
+       force_enter_channel[i]:=str;
+   end;
    old_force_enter:=cb_channels_old_forceenter.Checked;
    force_enter_furiwake:=cb_force_enter_furiwake.Checked;
    mx3_auto_im:=cb_mx3_auto_im.Checked;
@@ -2004,16 +2026,22 @@
    flood_max_dlrequests:=edit_toami_judge.Value;
    autoban_incomplete:=cb_autoban_incomplete.Checked;
    loginblock_port:=cb_loginblock_port.Checked;
+   str:=edit_loginblock_port.Text;
    ini:=TIniFile.Create(Applicationdir+'config');
    try
-     ini.WriteString('Other','LoginBlockPortNumber',edit_loginblock_port.Text);
-     list.Create;
-     SplitString(edit_loginblock_port.Text,list);
-     for i:=0 to MAX_BLOCK_PORT do
-       block_port[i]:=StrToIntDef(list.Strings[i],0);
-     FreeStringList(list);
+     ini.WriteString('Other','LoginBlockPortNumber',str);
    finally
      ini.Free;
+   end;
+   for i:=0 to MAX_BLOCK_PORT do
+   begin
+     j:=AnsiPos(' ',str);
+     if j>0 then
+     begin
+       block_port[i]:=StrToIntDef(Copy(str,1,j-1),0);
+       str:=Copy(str,j+1,Length(str)-j);
+     end else
+       block_port[i]:=StrToIntDef(str,0);
    end;
    local2global_level:=cb_l2b_level.Checked;
    enable_rating:=cb_enable_rating.Checked;