2003.02.08 (土) 22:28:40 <u*j*2*6*> サーバー全体の共有数がユーザーのログアウト時に戻らないバグも修正済みです(thx to 名無しさん)
shuusei24121:テキストファイルは共有数にかぞえない(idea by 2ndreal)

diff --dos -wurN 24120/handler.pas 24121/handler.pas
--- 24120/handler.pas	Sat Feb 08 00:01:20 2003
+++ 24121/handler.pas	Sat Feb 08 22:15:18 2003
@@ -560,8 +560,10 @@
     begin
       tmp_pos:=1204;
       dec(local_files,usr.data^.shared);
+      if nocount_text then dec(local_files,usr.shared_text);
       dec(local_bytes,usr.shared_size);
       dec(total_files,usr.data^.shared);
+      if nocount_text then dec(total_files,usr.shared_text);
       dec(total_bytes,usr.shared_size);
       tmp_pos:=1205;
       usr.shared_size:=0;
@@ -2224,7 +2226,11 @@
      TYPE_IMAGE: inc(local.shared_images);
      TYPE_APP: inc(local.shared_apps);
      TYPE_CD: inc(local.shared_cd);
-     TYPE_TEXT: inc(local.shared_text);
+     TYPE_TEXT:
+     begin
+      if nocount_text then dec(user^.shared);
+      inc(local.shared_text);
+     end;
     end;
     if auto_friendadd then
      if user^.shared=share_auto_friendadd_minimum then
@@ -2290,7 +2296,8 @@
  end;
  tmp_pos:=292;
  if maxshare>0 then
-  if user^.shared>=maxshare then
+  if (user^.shared>=maxshare) or
+     (nocount_text and (user^.shared+local.shared_text>=maxshare)) then
   begin
     if shareinform and CanSendError(user,query) then
      local.Exec(MSG_SERVER_NOSUCH,GetLangT(LNG_SHARE_LIMIT,filename,maxshare));
@@ -2536,6 +2543,11 @@
    dec(local_bytes,local.shared_size);
    dec(total_files,local.shared.count);
    dec(local_files,local.shared.count);
+   if nocount_text then
+   begin
+     dec(total_files,local.shared_text);
+     dec(local_files,local.shared_text);
+   end;
    local.shared.Clear;
    local.localstate:=local.localstate+[locNeedsUpdate];
   end;
diff --dos -wurN 24120/mainform.pas 24121/mainform.pas
--- 24120/mainform.pas	Thu Feb 06 19:59:24 2003
+++ 24121/mainform.pas	Sat Feb 08 21:48:24 2003
@@ -1414,6 +1414,7 @@
   if str='leech' then wqfloodblock_method:=leech
   else if str='ban' then wqfloodblock_method:=ban
   else wqfloodblock_method:=block;
+  nocount_text:=ini.ReadBool('Other2','NoCountText',false);
   // set up console
   LogStartup('mainform::loadconfig: setting up console user');
   cons_channels:=TMyList.Create;
@@ -1843,6 +1844,7 @@
     leech: ini.WriteString('Other2','WQFloodBlockMethod','leech');
     ban  : ini.WriteString('Other2','WQFloodBlockMethod','ban');
   end;
+  ini.WriteBool('Other2','NoCountText',nocount_text);
   finally
   ini.Free;
  end;
diff --dos -wurN 24120/settings.dfm 24121/settings.dfm
--- 24120/settings.dfm	Thu Feb 06 01:29:54 2003
+++ 24121/settings.dfm	Sat Feb 08 21:57:18 2003
@@ -1922,7 +1922,7 @@
           Width = 156
           Height = 20
           Style = csDropDownList
-          ItemHeight = 12
+          ItemHeight = 0
           TabOrder = 9
         end
       end
@@ -2435,7 +2435,7 @@
           Width = 111
           Height = 20
           Style = csDropDownList
-          ItemHeight = 12
+          ItemHeight = 0
           TabOrder = 1
         end
         object Edit_cons_autojoin1: TEdit
@@ -5494,7 +5494,7 @@
           Width = 156
           Height = 20
           Style = csDropDownList
-          ItemHeight = 12
+          ItemHeight = 0
           TabOrder = 9
         end
       end
@@ -5909,6 +5909,14 @@
             TabOrder = 4
             Visible = False
           end
+        end
+        object cb_nocount_text: TCheckBox
+          Left = 8
+          Top = 208
+          Width = 225
+          Height = 17
+          Caption = 'テキストファイルは共有数にかぞえない'
+          TabOrder = 4
         end
       end
     end
diff --dos -wurN 24120/settings.pas 24121/settings.pas
--- 24120/settings.pas	Thu Feb 06 01:41:20 2003
+++ 24121/settings.pas	Sat Feb 08 21:58:22 2003
@@ -567,6 +567,7 @@
     rd_wqfloodblock_ban: TRadioButton;
     edit_wqfloodblock: TSpinEdit;
     edit_wqfloodblock_bantime: TComboBox;
+    cb_nocount_text: TCheckBox;
     procedure Panel3Resize(Sender: TObject);
     procedure headerPaint(Sender: TObject);
     procedure SetTopText(str: String);
@@ -1460,6 +1461,8 @@
  edit_wqfloodblock.Value:=wqfloodblock_count;
  edit_wqfloodblock_bantime.Visible:=rd_wqfloodblock_ban.Checked;
  edit_wqfloodblock_bantime.ItemIndex:=GetBanIndex(wqfloodblock_bantime);
+
+ cb_nocount_text.Checked:=nocount_text;
 end;
 
 procedure TSlavaNapSettings.sh_reportShow(Sender: TObject);
@@ -1983,6 +1986,8 @@
      wqfloodblock_method:=block;
    wqfloodblock_count:=edit_wqfloodblock.Value;
    wqfloodblock_bantime:=GetBanID(edit_wqfloodblock_bantime);
+
+   nocount_text:=cb_nocount_text.Checked;
   except
  end;
  btn_restoreClick(nil);
diff --dos -wurN 24120/vars.pas 24121/vars.pas
--- 24120/vars.pas	Thu Feb 06 00:58:54 2003
+++ 24121/vars.pas	Sat Feb 08 21:49:04 2003
@@ -309,6 +309,7 @@
  wqfloodblock_count: Integer;
  wqfloodblock_method: TWQBlockMethod;//(block,leech,ban)
  wqfloodblock_bantime: Cardinal;
+ nocount_text: Boolean;
 implementation
 
 procedure CheckWindows;