2003.03.12 (水) 09:33:06 <u*j*2*6*> UL要求の合計とDL要求の合計をユーザー窓に表示できるようにしました。
2003.03.12 (水) 09:33:17 <u*j*2*6*> ↑ふつうのUL/DLは、よそのサーバーでの転送もかぞえてしまうので。
2003.03.12 (水) 09:33:53 <u*j*2*6*> ついでに検索要求とブロックされたファイル数もカウントして表示するようにしました。
2003.03.12 (水) 09:34:24 <u*j*2*6*> 「ブロックされたファイルの数」のほうは、ブロックキーワードでブロックされたファイルのみカウントします
shuusei24128:ユーザーリストのコラムを追加。UL要求/DL要求/検索要求/ブロックされたファイルの数

diff --dos -wurN 24127/console.pas 24128/console.pas
--- 24127/console.pas	Wed Jan 29 11:52:00 2003
+++ 24128/console.pas	Wed Mar 12 08:36:56 2003
@@ -509,6 +509,10 @@
       item.SubItems.Add(IntToStr(user^.total_down));
       item.SubItems.Add(IntToStr(user^.total_up)+' / '+IntToStr(user^.total_down));
       item.SubItems.Add(GetServerName(user^.server));
+      item.SubItems.Add(IntToStr(user^.ulrequests));
+      item.SubItems.Add(IntToStr(user^.dlrequests));
+      item.SubItems.Add(IntToStr(user^.searchreqs));
+      item.SubItems.Add(IntToStr(user^.blockfiles));
       str:='';
       tmp_pos:=1378;
       if userMuzzled in user^.state then str:=str+GetLangI(LNG_LIST_MUZZLED);
diff --dos -wurN 24127/constants.pas 24128/constants.pas
--- 24127/constants.pas	Wed Mar 12 07:34:48 2003
+++ 24128/constants.pas	Wed Mar 12 08:37:48 2003
@@ -192,7 +192,11 @@
  UL_TDOWN                     = 13;
  UL_TTRANSFERS                = 14;
  UL_SERVER                    = 15;
- UL_STATUS                    = 16;
+ UL_ULREQUESTS                = 16;
+ UL_DLREQUESTS                = 17;
+ UL_SEARCHREQS                = 18;
+ UL_BLOCKFILES                = 19;
+ UL_STATUS                    = 20;
 
 MSG_SERVER_ERROR		= 0;
 MSG_CLIENT_LOGIN		= 2;
diff --dos -wurN 24127/handler.pas 24128/handler.pas
--- 24127/handler.pas	Sun Feb 09 15:23:48 2003
+++ 24128/handler.pas	Wed Mar 12 08:45:16 2003
@@ -2883,6 +2883,7 @@
 exit;
 }
  if not isLogged then exit;
+ Inc(user^.searchreqs);
  // block searches by leeches
  if user^.level=napUserLeech then
  begin
@@ -3357,9 +3358,15 @@
      l2:=nil;
    tmp_pos:=122626;
    inc(local.dlrequestsp3m);//DL元がローカルならとりあえずカウント
+   inc(user^.dlrequests);
+   inc(user2^.ulrequests);
    tmp_pos:=122627;
    if (l2<>nil) and StrHash_FindString(l2.hotlist,AnsiLowerCase(local.nick),true) then
+   begin
      dec(local.dlrequestsp3m);//DL元とDL先がともにローカルでホットリストにDL元がいるときは戻す
+     dec(user^.dlrequests);
+     dec(user2^.ulrequests);
+   end;
    //--------------------------------------------投網ブロック
    tmp_pos:=122628;
    if local.level<NapUserModerator then
diff --dos -wurN 24127/mainform.dfm 24128/mainform.dfm
--- 24127/mainform.dfm	Tue Jan 28 23:35:20 2003
+++ 24128/mainform.dfm	Wed Mar 12 09:14:06 2003
@@ -694,7 +694,7 @@
         Top = 0
         Width = 688
         Height = 248
-        ActivePage = sh_bans
+        ActivePage = sh_users
         Align = alClient
         OwnerDraw = True
         TabOrder = 0
@@ -841,13 +841,13 @@
           object ksoOfficeDock1: TksoOfficeDock
             Left = 0
             Top = 0
-            Width = 635
+            Width = 688
             Height = 74
             Align = alTop
             object ksoOfficeToolBar1: TksoOfficeToolBar
               Left = 0
               Top = 0
-              Width = 635
+              Width = 688
               Height = 74
               Rolled = False
               object lbl_users: TLabel
@@ -1005,7 +1005,7 @@
                 Left = 15
                 Top = 52
                 Width = 60
-                Height = 21
+                Height = 20
                 ParentColor = True
                 ParentShowHint = False
                 ShowHint = True
@@ -1016,9 +1016,9 @@
                 Left = 170
                 Top = 52
                 Width = 52
-                Height = 21
+                Height = 20
                 Style = csDropDownList
-                ItemHeight = 0
+                ItemHeight = 12
                 ParentShowHint = False
                 ShowHint = True
                 TabOrder = 7
@@ -1027,7 +1027,7 @@
                 Left = 414
                 Top = 30
                 Width = 52
-                Height = 21
+                Height = 20
                 ParentColor = True
                 ParentShowHint = False
                 ShowHint = True
@@ -1052,14 +1052,16 @@
             object list_users: TListView
               Left = 1
               Top = 1
-              Width = 633
-              Height = 121
+              Width = 686
+              Height = 172
               Align = alClient
               BorderStyle = bsNone
               Columns = <
                 item
                   AutoSize = True
                   Caption = 'User'
+                  WidthType = (
+                    -255)
                 end
                 item
                   Alignment = taCenter
@@ -1140,6 +1142,26 @@
                   Caption = 'Server'
                 end
                 item
+                  Alignment = taRightJustify
+                  Caption = 'ULReqs'
+                  Width = 30
+                end
+                item
+                  Alignment = taRightJustify
+                  Caption = 'DLReqs'
+                  Width = 30
+                end
+                item
+                  Alignment = taRightJustify
+                  Caption = 'SearchReqs'
+                  Width = 40
+                end
+                item
+                  Alignment = taRightJustify
+                  Caption = 'BlockFiles'
+                  Width = 40
+                end
+                item
                   AutoSize = True
                   Caption = 'Comments'
                 end
@@ -3975,6 +3997,30 @@
     end
     object mnu_um_server: TMenuItem
       Caption = 'server'
+      OnClick = mnu_um_click
+      OnDrawItem = DrawPopupItem
+      OnMeasureItem = MeasurePopupItem
+    end
+    object mnu_um_ulrequests: TMenuItem
+      Caption = 'ulreqs'
+      OnClick = mnu_um_click
+      OnDrawItem = DrawPopupItem
+      OnMeasureItem = MeasurePopupItem
+    end
+    object mnu_um_dlrequests: TMenuItem
+      Caption = 'dlreqs'
+      OnClick = mnu_um_click
+      OnDrawItem = DrawPopupItem
+      OnMeasureItem = MeasurePopupItem
+    end
+    object mnu_um_searchreqs: TMenuItem
+      Caption = 'searchreqs'
+      OnClick = mnu_um_click
+      OnDrawItem = DrawPopupItem
+      OnMeasureItem = MeasurePopupItem
+    end
+    object mnu_um_blockfiles: TMenuItem
+      Caption = 'blockfiles'
       OnClick = mnu_um_click
       OnDrawItem = DrawPopupItem
       OnMeasureItem = MeasurePopupItem
diff --dos -wurN 24127/mainform.pas 24128/mainform.pas
--- 24127/mainform.pas	Sun Feb 09 14:28:18 2003
+++ 24128/mainform.pas	Wed Mar 12 09:22:42 2003
@@ -406,6 +406,10 @@
     mnu_um_down: TMenuItem;
     mnu_um_totalup: TMenuItem;
     mnu_um_totaldown: TMenuItem;
+    mnu_um_ulrequests: TMenuItem;
+    mnu_um_dlrequests: TMenuItem;
+    mnu_um_searchreqs: TMenuItem;
+    mnu_um_blockfiles: TMenuItem;
     procedure FormCreate(Sender: TObject);
     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
@@ -1041,6 +1045,10 @@
   if ini.ReadBool('Interface','UsersListHideTotalDown',true) then begin isHide[UL_TDOWN+1]:=true; SetColumnVisible(list_users,UL_TDOWN+1,0,false); end;
   if ini.ReadBool('Interface','UsersListHideTotal',true) then begin isHide[UL_TTRANSFERS+1]:=true; SetColumnVisible(list_users,UL_TTRANSFERS+1,0,false); end;
   if ini.ReadBool('Interface','UsersListHideServer',false) then begin isHide[UL_SERVER+1]:=true; SetColumnVisible(list_users,UL_SERVER+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideULRequests',false) then begin isHide[UL_ULREQUESTS+1]:=true; SetColumnVisible(list_users,UL_ULREQUESTS+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideDLRequests',false) then begin isHide[UL_DLREQUESTS+1]:=true; SetColumnVisible(list_users,UL_DLREQUESTS+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideSearchReqs',false) then begin isHide[UL_SEARCHREQS+1]:=true; SetColumnVisible(list_users,UL_SEARCHREQS+1,0,false); end;
+  if ini.ReadBool('Interface','UsersListHideBlockFiles',false) then begin isHide[UL_BLOCKFILES+1]:=true; SetColumnVisible(list_users,UL_BLOCKFILES+1,0,false); end;
   // colors
   LogStartup('mainform::loadconfig: loading colors');
   slBackground:=ini.ReadInteger('Colors','clBackground',$FFFFFF);
@@ -1551,6 +1559,10 @@
   ini.WriteBool('Interface','UsersListHideTotalDown',not isColumnVisible(list_users,UL_TDOWN+1));
   ini.WriteBool('Interface','UsersListHideTotal',not isColumnVisible(list_users,UL_TTRANSFERS+1));
   ini.WriteBool('Interface','UsersListHideServer',not isColumnVisible(list_users,UL_SERVER+1));
+  ini.WriteBool('Interface','UsersListHideULRequests',not isColumnVisible(list_users,UL_ULREQUESTS+1));
+  ini.WriteBool('Interface','UsersListHideDLRequests',not isColumnVisible(list_users,UL_DLREQUESTS+1));
+  ini.WriteBool('Interface','UsersListHideSearchReqs',not isColumnVisible(list_users,UL_SEARCHREQS+1));
+  ini.WriteBool('Interface','UsersListHideBlockFiles',not isColumnVisible(list_users,UL_BLOCKFILES+1));
   // colors
   ini.WriteInteger('Colors','clBackground',slBackground);
   ini.WriteInteger('Colors','clText',slText);
@@ -2041,6 +2053,10 @@
  mnu_um_totaldown.Caption:='ダウンロードの合計を表示';
  mnu_um_total.Caption:=GetLangI(LNG_LIST_MNU2_TOTAL);
  mnu_um_server.Caption:=GetLangI(LNG_LIST_MNU2_SERVER);
+ mnu_um_ulrequests.Caption:='アップロード要求の合計を表示';
+ mnu_um_dlrequests.Caption:='ダウンロード要求の合計を表示';
+ mnu_um_searchreqs.Caption:='検索要求の合計を表示';
+ mnu_um_blockfiles.Caption:='ブロックされたファイルの合計を表示';
  // toolbar
  i:=10;
  btn_tb_log.Caption:=GetLangI(LNG_TB_BTN_LOG);
@@ -2124,6 +2140,10 @@
    Items[UL_TDOWN+1].Caption:='合計DL';
    Items[UL_TTRANSFERS+1].Caption:=GetLangI(LNG_LIST_HEADER_TOTAL);
    Items[UL_SERVER+1].Caption:=GetLangI(LNG_LIST_HEADER_SERVER);
+   Items[UL_ULREQUESTS+1].Caption:='UL要求';
+   Items[UL_DLREQUESTS+1].Caption:='DL要求';
+   Items[UL_SEARCHREQS+1].Caption:='検索要求';
+   Items[UL_BLOCKFILES+1].Caption:='ブロックファイル';
    Items[UL_STATUS+1].Caption:='';
  end;
  lbl_users.Caption:=GetLangI(LNG_USERS_LABEL);
@@ -2922,7 +2942,11 @@
         UL_TDOWN+1      : list.Columns.Items[i].Width:=50;
         UL_TTRANSFERS+1 : list.Columns.Items[i].Width:=50;
         UL_SERVER+1     : list.Columns.Items[i].Width:=50;
-        17              : list.Columns.Items[i].Width:=50;
+        UL_ULREQUESTS+1 : list.Columns.Items[i].Width:=30;
+        UL_DLREQUESTS+1 : list.Columns.Items[i].Width:=30;
+        UL_SEARCHREQS+1 : list.Columns.Items[i].Width:=40;
+        UL_BLOCKFILES+1 : list.Columns.Items[i].Width:=40;
+        22              : list.Columns.Items[i].Width:=50;
        else break;
      end;
   inc(w,list.Columns.Items[i].Width);
@@ -3052,7 +3076,11 @@
  else if (list=list_users) and (index=UL_DOWN+1) then Result:=CompareDigit(str1,str2)
  else if (list=list_users) and (index=UL_TUP+1) then Result:=CompareDigit(str1,str2)
  else if (list=list_users) and (index=UL_TDOWN+1) then Result:=CompareDigit(str1,str2)
- else if (list=list_users) and (index=12) then Result:=CompareDigit(str1,str2)
+ else if (list=list_users) and (index=UL_ULREQUESTS+1) then Result:=CompareDigit(str1,str2)
+ else if (list=list_users) and (index=UL_DLREQUESTS+1) then Result:=CompareDigit(str1,str2)
+ else if (list=list_users) and (index=UL_SEARCHREQS+1) then Result:=CompareDigit(str1,str2)
+ else if (list=list_users) and (index=UL_BLOCKFILES+1) then Result:=CompareDigit(str1,str2)
+ else if (list=list_users) and (index=22) then Result:=CompareDigit(str1,str2)
  else if (list=list_channels) and (index=1) then Result:=CompareDigit(str1,str2)
  else if (list=list_channels) and (index=2) then Result:=CompareDigit(str1,str2)
  else if (list=list_channels) and (index=3) then Result:=CompareLevel(str1,str2)
@@ -4616,6 +4644,10 @@
  else if Sender=mnu_um_totaldown then n:=UL_TDOWN+1
  else if Sender=mnu_um_total then n:=UL_TTRANSFERS+1
  else if Sender=mnu_um_server then n:=UL_SERVER+1
+ else if Sender=mnu_um_ulrequests then n:=UL_ULREQUESTS+1
+ else if Sender=mnu_um_dlrequests then n:=UL_DLREQUESTS+1
+ else if Sender=mnu_um_searchreqs then n:=UL_SEARCHREQS+1
+ else if Sender=mnu_um_blockfiles then n:=UL_BLOCKFILES+1
  else exit;
  if isColumnVisible(list_users,n) then
  begin
@@ -4638,7 +4670,11 @@
  else if Sender=mnu_um_totalup then w:=50
  else if Sender=mnu_um_totaldown then w:=50
  else if Sender=mnu_um_total then w:=0
- else if Sender=mnu_um_server then w:=0;
+ else if Sender=mnu_um_server then w:=0
+ else if Sender=mnu_um_ulrequests then w:=30
+ else if Sender=mnu_um_dlrequests then w:=30
+ else if Sender=mnu_um_searchreqs then w:=40
+ else if Sender=mnu_um_blockfiles then w:=40;
  if w=0 then
  begin
   w:=10;
@@ -4666,6 +4702,10 @@
  mnu_um_totaldown.Checked:=isColumnVisible(list_users,UL_TDOWN+1);
  mnu_um_total.Checked:=isColumnVisible(list_users,UL_TTRANSFERS+1);
  mnu_um_server.Checked:=isColumnVisible(list_users,UL_SERVER+1);
+ mnu_um_ulrequests.Checked:=isColumnVisible(list_users,UL_ULREQUESTS+1);
+ mnu_um_dlrequests.Checked:=isColumnVisible(list_users,UL_DLREQUESTS+1);
+ mnu_um_searchreqs.Checked:=isColumnVisible(list_users,UL_SEARCHREQS+1);
+ mnu_um_blockfiles.Checked:=isColumnVisible(list_users,UL_BLOCKFILES+1);
 end;
 
 
diff --dos -wurN 24127/share2.pas 24128/share2.pas
--- 24127/share2.pas	Wed Feb 26 03:55:06 2003
+++ 24128/share2.pas	Wed Mar 12 09:11:20 2003
@@ -151,6 +151,7 @@
     or ((user.data^.level<napUserAdmin) and (not block_allowshare)) then
     begin
       list.Free;
+      Inc(user.data^.blockfiles);
       result:=false;
       exit;
     end;
diff --dos -wurN 24127/users.pas 24128/users.pas
--- 24127/users.pas	Sun Dec 08 16:24:06 2002
+++ 24128/users.pas	Wed Mar 12 09:12:50 2003
@@ -40,6 +40,10 @@
   server        : TServer;
   state         : TUserState;
   last_seen_t   : time_t;
+  ulrequests    : SmallInt;
+  dlrequests    : SmallInt;
+  searchreqs    : Integer;
+  blockfiles    : Integer;
  end;
  POnlineUser = ^TOnlineUser;
  TOnlineUsers = class(TObject)
@@ -109,6 +113,10 @@
    local:=nil;
    state:=[];
    last_seen_t:=current_time_t;
+   ulrequests:=0;
+   dlrequests:=0;
+   searchreqs:=0;
+   blockfiles:=0;
  end;
 end;
 
@@ -217,6 +225,10 @@
   local:=Value.local;
   state:=Value.state;
   last_seen_t:=Value.last_seen_t;
+  ulrequests:=Value.ulrequests;
+  dlrequests:=Value.dlrequests;
+  searchreqs:=Value.searchreqs;
+  blockfiles:=Value.blockfiles; //ブロックワードによるブロックのみカウント
  end;
  index:=GetCharIndex(result^.username);
  names[index].Add(result);