2003.08.14 (木) 23:04:44 <Heracules> ログイン毎にTStringList?使ってIntegerにStringをバラす処理をしていたのを設定変更時と起動時のみにしたので軽くなるはずです。
2003.08.14 (木) 23:05:28 <Heracules> また、FreeStringList?で開放してなかったので無駄にメモリ使用量が増えていたバグも修正しました。
shuusei211138:指定申告ポートでのログインをブロックする機能の細かい修正(21179参照, source by Heracules)

diff --dos -urN 211137/handler.pas 211138/handler.pas
--- 211137/handler.pas	Wed Aug 13 18:44:04 2003
+++ 211138/handler.pas	Thu Aug 14 22:44:36 2003
@@ -988,10 +988,7 @@
  sin: TSockAddrIn;
  ban: PBan;
  list: TStringList;
- blist: TStringList;
  friend: Boolean;
- port: Integer;
- block_port: Array[0..MAX_LISTEN_SOCKET] of Integer;
  b: Boolean;
 begin
  tmp_pos:=190;
@@ -1043,23 +1040,14 @@
    exit;
  end;
  if loginblock_port then
- begin
-   str:=loginblock_portnumber;
-   port:=StrToIntDef(hlist.Strings[2],-1);
-   blist:=TStringList.Create;
-   SplitString(str,blist);
-   for i:=0 to blist.count-1 do
-   begin
-     block_port[i]:=StrToIntDef(blist.Strings[i],0);
-     if (port=block_port[i]) then
+   for i:=0 to MAX_BLOCK_PORT do
+     if (StrToIntDef(hlist.Strings[2],-1)=block_port[i]) then
      begin
-       LoginError('当サーバではポート'+IntToStr(port)+'の使用は禁止しています。');
+       LoginError('当サーバではポート'+IntToStr(block_port[i])+'の使用は禁止しています。');
        If (log_login) then
-         Log(slDebugData,'ポート'+IntToStr(port)+'のため、'+hlist.Strings[0]+'のログインをブロックしました.');
+         Log(slDebugData,'ポート'+IntToStr(block_port[i])+'のため、'+hlist.Strings[0]+'のログインをブロックしました.');
        exit;
      end;
-   end;
- end;
  tmp_pos:=12262;
  for i:=0 to MAX_LISTEN_TRAPSOCKET do
  begin
diff --dos -urN 211137/settings.pas 211138/settings.pas
--- 211137/settings.pas	Wed Aug 13 23:53:32 2003
+++ 211138/settings.pas	Thu Aug 14 22:43:00 2003
@@ -1607,6 +1607,7 @@
  ini: TIniFile;
  reg: TRegistry;
  i: Integer;
+ list: TStringList;
 begin
  if pages.ActivePage=sh_main then
  try
@@ -1998,6 +1999,11 @@
    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);
    local2global_level:=cb_l2b_level.Checked;
    enable_rating:=cb_enable_rating.Checked;
    rating_threshold:=edit_rating_threshold.Value;
diff --dos -urN 211137/mainform.pas 211138/mainform.pas
--- 211137/mainform.pas	Wed Aug 13 23:25:06 2003
+++ 211138/mainform.pas	Thu Aug 14 22:52:10 2003
@@ -883,6 +883,8 @@
   redirect_port[i]:=0;
   redirect_socket[i]:=INVALID_SOCKET;
  end;
+ for i:=0 to MAX_BLOCK_PORT do
+   block_port[i]:=0;
  napigator_socket:=INVALID_SOCKET;
  dagsta_socket:=INVALID_SOCKET;
  stats_socket:=INVALID_SOCKET;
@@ -1577,6 +1579,9 @@
   SplitString(str,list);
   for i:=0 to list.Count-1 do
     redirect_port[i]:=StrToIntDef(list.Strings[i],0);
+  SplitString(loginblock_portnumber,list);
+  for i:=0 to list.Count-1 do
+    block_port[i]:=StrToIntDef(list.Strings[i],0);
   // set up console
   LogStartup('mainform::loadconfig: setting up console user');
   cons_channels:=TList.Create;
diff --dos -urN 211137/constants.pas 211138/constants.pas
--- 211137/constants.pas	Wed Aug 13 19:19:06 2003
+++ 211138/constants.pas	Thu Aug 14 22:32:16 2003
@@ -48,6 +48,7 @@
  MAX_LISTEN_SOCKET            = 7; // maximum listen sockets
  MAX_LISTEN_TRAPSOCKET        = 7; // maximum listen trapsockets
  MAX_LISTEN_REDIRECT          = 7; // maximum listen redirect
+ MAX_BLOCK_PORT               = 7; // maximum block client's data port
  DEF_LISTEN_PORT              = 8888; //3456; // default port for listening
  DEF_LISTEN_PORTS             = '3456 8888';
  RECV_BUF_SIZE_MIN            = 128;
diff --dos -urN 211137/vars.pas 211138/vars.pas
--- 211137/vars.pas	Thu Aug 14 14:57:32 2003
+++ 211138/vars.pas	Thu Aug 14 22:33:24 2003
@@ -329,6 +329,7 @@
  enable_redirect: Boolean;
  redirect_socket: Array[0..MAX_LISTEN_REDIRECT] of HSocket;
  redirect_port: Array[0..MAX_LISTEN_REDIRECT] of Integer;
+ block_port: Array[0..MAX_BLOCK_PORT] of Integer;
 
 implementation