2003.08.15 (金) 00:45:35 <Heracules> String型をさらにひとつ減らしました。
shuusei211139:指定申告ポートでのログインブロック機能を若干軽量化(21179参照, source by Heracules)

diff --dos -urN 211138/settings.pas 211139/settings.pas
--- 211138/settings.pas	Thu Aug 14 22:43:00 2003
+++ 211139/settings.pas	Fri Aug 15 00:40:54 2003
@@ -1440,6 +1440,8 @@
 end;
 
 procedure TSlavaNapSettings.sh_other3Show(Sender: TObject);
+var
+  ini: TIniFile;
 begin
   SetTopText('ほかの設定2');
   SetChange(true);
@@ -1477,10 +1479,14 @@
   Label146.Visible:=cb_autoban_incomplete.Checked;
   edit_incomplete_bantime.Visible:=cb_autoban_incomplete.Checked;
 
-  edit_loginblock_port.Text:=loginblock_portnumber;
-  Label147.Visible:=cb_loginblock_port.Checked;
-  edit_loginblock_port.Visible:=cb_loginblock_port.Checked;
-
+  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;
   Label148.Visible:=cb_enable_rating.Checked;
   edit_rating_threshold.Visible:=cb_enable_rating.Checked;
 end;
@@ -1998,12 +2004,17 @@
    flood_max_dlrequests:=edit_toami_judge.Value;
    autoban_incomplete:=cb_autoban_incomplete.Checked;
    loginblock_port:=cb_loginblock_port.Checked;
-   loginblock_portnumber:=edit_loginblock_port.Text;
-   list.Create;
-   SplitString(loginblock_portnumber,list);
-   for i:=0 to MAX_BLOCK_PORT do
-     block_port[i]:=StrToIntDef(list.Strings[i],0);
-   FreeStringList(list);
+   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);
+   finally
+     ini.Free;
+   end;
    local2global_level:=cb_l2b_level.Checked;
    enable_rating:=cb_enable_rating.Checked;
    rating_threshold:=edit_rating_threshold.Value;
diff --dos -urN 211138/mainform.pas 211139/mainform.pas
--- 211138/mainform.pas	Thu Aug 14 22:52:10 2003
+++ 211139/mainform.pas	Fri Aug 15 00:41:04 2003
@@ -1550,7 +1550,6 @@
   toami_bantime:=ini.ReadInteger('Other','ToamiBanTime',3600);
   wq_bantime:=ini.ReadInteger('Other','WantQueueBanTime',3600);
   incomplete_bantime:=ini.ReadInteger('Other','IncompleteBanTime',3600);
-  loginblock_portnumber:=ini.ReadString('Other','LoginBlockPortNumber','6699 7743');
   toami_taiou:=ini.ReadString('Other','ToamiTaiou','block');
   renqueue_taiou:=ini.ReadString('Other','RenQueueTaiou','block');
   folder_depth:=ini.ReadInteger('Other','FolderDepth',1);
@@ -1579,7 +1578,8 @@
   SplitString(str,list);
   for i:=0 to list.Count-1 do
     redirect_port[i]:=StrToIntDef(list.Strings[i],0);
-  SplitString(loginblock_portnumber,list);
+  str:=ini.ReadString('Other','LoginBlockPortNumber','6699 7743');
+  SplitString(str,list);
   for i:=0 to list.Count-1 do
     block_port[i]:=StrToIntDef(list.Strings[i],0);
   // set up console
@@ -2020,7 +2020,6 @@
   ini.WriteInteger('Other','ToamiBanTime',toami_bantime);
   ini.WriteInteger('Other','WantQueueBanTime',wq_bantime);
   ini.WriteInteger('Other','IncompleteBanTime',incomplete_bantime);
-  ini.WriteString('Other','LoginBlockPortNumber',loginblock_portnumber);
   ini.WriteString('Other','ToamiTaiou',toami_taiou);
   ini.WriteString('Other','RenQueueTaiou',renqueue_taiou);
   ini.WriteInteger('Other','FolderDepth',folder_depth);
diff --dos -urN 211138/vars.pas 211139/vars.pas
--- 211138/vars.pas	Thu Aug 14 22:33:24 2003
+++ 211139/vars.pas	Fri Aug 15 00:16:48 2003
@@ -203,7 +203,6 @@
  share_matchedfile_only: Boolean;
  autoban_incomplete: Boolean;
  loginblock_port: Boolean;
- loginblock_portnumber: String;
  local2global_level: Boolean;
  enable_rating: Boolean;
  rating_threshold: Integer;