2002.12.13 (金) 17:51:54 <u*j*2*6*> ポイントを相手にあげたいときは/msg nickserv rate <user> <+|->
2002.12.13 (金) 17:53:40 <u*j*2*6*> 自分の評価点x10MまでのサイズのファイルにDL要求をだせます
2002.12.13 (金) 17:55:00 <u*j*2*6*> ポイントを与えることができるのは1日1回まで。
2002.12.13 (金) 17:55:13 <u*j*2*6*> おなじIPのひとにはポイントをあげることはできません。
2002.12.13 (金) 17:56:02 <u*j*2*6*> ポイントが設定で決めたしきい値より低いユーザーは検索できません。
2002.12.13 (金) 18:33:36 <Heracules> 機能としてはおもしろいんだけど、初期値0だとみんな検索できないし、ダウンロードもできないし???初期値を設定できるようにしてみてはいかがでしょうか?w
2002.12.13 (金) 18:36:25 <Heracules> しきいを0にすればいいのかな?(検索の問題は)
2002.12.13 (金) 18:42:26 <Heracules> 案:共有数(容量?)に基づいた初期値を適用する。 有効にしたら、Mod+以外が初期段階ではダウンロード不可(検索も初期の「1」だと)なので・・・。 あと、x10Mは少なくない?(笑
2002.12.13 (金) 18:42:58 <Heracules> UP量に応じたポイント自動付加は可能かな?w
2002.12.13 (金) 18:48:40 <Heracules> コンソール側からポイント付与・確認できるようになるといいな〜(ぉ
2002.12.14 (土) 19:59:19 <u*j*2*6*> 共有数やサイズで初期値をきめちゃうと、捏造でポイントかせげちゃうので無理かも
2002.12.14 (土) 20:00:27 <u*j*2*6*> UP量に応じて、だと、途中で切断してもポイント入っちゃうので
2002.12.14 (土) 20:01:23 <u*j*2*6*> mods+だけは、あげられるポイントを無制限にすればいいかな?仕事ふえるけど
2002.12.14 (土) 20:02:34 <u*j*2*6*> ポイントはwhoisで確認できるようにする予定。
2002.12.14 (土) 20:03:34 <u*j*2*6*> ユーザーリストのコラムにポイント列を追加するかも
shuusei21185:ポイント制(idea by MataPara)
shuusei21185.zip

diff --dos -urN 21184/constants.pas 21185/constants.pas
--- 21184/constants.pas	Thu Oct 24 02:50:28 2002
+++ 21185/constants.pas	Fri Dec 13 03:40:18 2002
@@ -393,6 +393,9 @@
 //GhostKick
 MSG_CLIENT_GHOST_KICK           = 11000; //ghost kick
 
+//Additional Messages
+MSG_CLIENT_RATE                 = 12000; //rate user
+
 implementation
 
 end.
diff --dos -urN 21184/handler.pas 21185/handler.pas
--- 21184/handler.pas	Mon Nov 04 05:07:40 2002
+++ 21185/handler.pas	Fri Dec 13 17:42:56 2002
@@ -1703,6 +1703,25 @@
   ProcessCommand(local,queryOperServ);
 end;
 
+procedure Handler_Rate; //12000, <user> <+|->
+var
+  user2: POnlineUser;
+begin
+  if not isLogged then exit;
+  if not isLocal then exit;
+  if not CheckParams(2) then exit;
+  if local.ratepointcache<1 then exit;
+  user2:=db_online.FindUser(hlist.Strings[0]);
+  if user2=nil then exit;
+  if user2^.ip=local.ip then exit;
+  if hlist.Strings[1]='+' then
+    inc(user2^.rating)
+  else if hlist.Strings[1]='-' then
+    dec(user2^.rating)
+  else exit;
+  dec(local.ratepointcache);
+end;
+
 procedure Handler_NickServ;
 var
  action: String;
@@ -1716,6 +1735,7 @@
  gcmd.id:=0;
  if action='pass' then gcmd.id:=MSG_CLIENT_CHANGE_PASS
  else if action='ghost' then gcmd.id:=MSG_CLIENT_GHOST_KICK
+ else if action='rate' then gcmd.id:=MSG_CLIENT_RATE
  else if action='help' then
  begin
    local.Exec(MSG_CLIENT_PRIVMSG,'NickServ NickServのコマンドリスト :');
@@ -1723,6 +1743,7 @@
    local.Exec(MSG_CLIENT_PRIVMSG,'NickServ help - このヘルプメッセージを表示');
    local.Exec(MSG_CLIENT_PRIVMSG,'NickServ pass <pass> - パスワードを変更');
    local.Exec(MSG_CLIENT_PRIVMSG,'NickServ ghost <user> <pass> - ゴーストを切断');
+   local.Exec(MSG_CLIENT_PRIVMSG,'NickServ rate <user> <+|-> - ユーザーを評価');
    local.Exec(MSG_CLIENT_PRIVMSG,'NickServ --------------------------------');
    exit;
  end
@@ -2875,6 +2896,14 @@
       local.Exec(MSG_SERVER_SEARCH_END,'');
       exit;
     end;
+    // block search by ppl not meeting rating
+    if enable_rating and (user^.rating<rating_threshold) then
+    begin
+      Exec(user,MSG_SERVER_NOSUCH,'検索するには評価がたりません: '
+        +IntToStr(user^.rating)+'/'+IntToStr(rating_threshold));
+      local.Exec(MSG_SERVER_SEARCH_END,'');
+      exit;
+    end;
   end;
  end;
  tmp_pos:=360;
@@ -3267,12 +3296,12 @@
 var
  user2: POnlineUser;
  l2: TLocalUser;
+ rec: PShare;
 begin
  tmp_pos:=400;
  if not isLogged then exit;
  if not CheckParams(2) then exit;
  if (query<>queryNormal) and (query<>queryRemoteUser) then exit;
- if user=nil then exit;
  tmp_pos:=12262;
  //-----------------------------------Leechブロック
  if user^.level=napUserLeech then
@@ -3417,6 +3446,24 @@
    Error(GetLangT(LNG_FIREWALL),true);
    exit;
  end;
+
+ tmp_pos:=12265;//ポイント制にしたがってダウンロード制限
+ if enable_rating then
+ if user^.level<NapUserModerator then
+ if not StrHash_FindString(db_friends,user^.nick,true) then
+ if l2<>nil then
+ begin //user2<>nil,user2^.server=nil,l2<>nil
+   rec:=l2.shared.FindRec(hlist.Strings[1]);
+   if rec<>nil then
+   if rec.size>user^.rating*10485760 then //ポイントx10MのサイズまでダウンロードOK
+   begin
+     Exec(user,MSG_SERVER_UPLOAD_FAILED,gcmd.cmd);
+     Error('ポイントがたりないのでダウンロードできません: '
+       +IntToStr(user^.rating)+'/'+IntToStr(rating_threshold),true);
+     exit;
+   end;
+ end;
+
  tmp_pos:=404;
  if l2=nil then
   Exec(user2,MSG_SERVER_UPLOAD_REQUEST,user^.nick+' "'+hlist.Strings[1]+'" '+IntToStr(Ord(user^.speed)))
@@ -10232,7 +10279,7 @@
    MSG_CLIENT_DENGON_CLEAR            : Handler_DengonClear;  //10504 - delete all messages
    MSG_CLIENT_DENGON_READNEW2         : Handler_DengonReadNew2; //10505 - read new messages as from sender
    MSG_CLIENT_GHOST_KICK              : Handler_GhostKick; // 11000 - client's ghost kick
-
+   MSG_CLIENT_RATE                    : Handler_Rate; // 12000 - rate user
 //     MSG_CLIENT_OPENNAPSERVER      : Handler_OpenNapLink; // 10010 - opennap server tries to link
 
    14,15,300,431,624,702,920,931,932,19999: begin end; // ignore command
diff --dos -urN 21184/localusers.pas 21185/localusers.pas
--- 21184/localusers.pas	Sat Oct 05 00:03:56 2002
+++ 21185/localusers.pas	Fri Dec 13 01:52:26 2002
@@ -55,6 +55,7 @@
   localstate      : TLocalUserState;
   dlrequestsp3m   : Integer;
   wantqueuep3m    : Integer;
+  ratepointcache  : Integer;
   constructor Create;
   destructor Destroy; override;
   function  logged: Boolean;
@@ -110,6 +111,7 @@
  localstate:=[];
  dlrequestsp3m:=0;
  wantqueuep3m:=0;
+ ratepointcache:=0;
  softwareID:=softUnknown;
 {$IFDEF USERS_DOUBLE_QUEUE}
  StrHash_Reset(out_list2);
@@ -177,6 +179,7 @@
  localstate:=[];
  dlrequestsp3m:=0;
  wantqueuep3m:=0;
+ ratepointcache:=0;
  softwareID:=softUnknown;
 {$IFDEF USERS_DOUBLE_QUEUE}
  StrHash_Clear(out_list2);
diff --dos -urN 21184/mainform.pas 21185/mainform.pas
--- 21184/mainform.pas	Wed Nov 06 01:58:10 2002
+++ 21185/mainform.pas	Fri Dec 13 12:18:50 2002
@@ -27,7 +27,8 @@
   inifiles, ShellApi, RXShell, ImgList, OfficeToolBar, Menus, winsock,
   OfficeButtons, OfficeControls, OfficeEdit, clipbrd, channelform, chatform,
   stypes, basecombo, ComboBox, whoisform, slavastrings, mmsystem,
-  Buttons, class_cmdlist, class_cmdexlist, class_doublecmdlist, DFWPages;
+  Buttons, class_cmdlist, class_cmdexlist, class_doublecmdlist, DFWPages,
+  DateUtils;
 
 type
   TSlavaNapWindow = class(TForm)
@@ -1234,6 +1235,8 @@
   autoban_incomplete:=ini.ReadBool('Share','AutoBanINCOMPLETE',false);
   loginblock_port:=ini.ReadBool('Share','LoginBlockPort',false);
   local2global_level:=ini.ReadBool('Share','Local2GlobalLevel',true);
+  enable_rating:=ini.ReadBool('Share','EnableRating',false);
+  rating_threshold:=ini.ReadInteger('Share','RatingThreshold',1);
   if language<>'english' then
   begin
     LogStartup('mainform::loadconfig: loading custom language - '+language);
@@ -1654,6 +1657,8 @@
   ini.WriteBool('Share','AutoBanINCOMPLETE',autoban_incomplete);
   ini.WriteBool('Share','LoginBlockPort',loginblock_port);
   ini.WriteBool('Share','Local2GlobalLevel',local2global_level);
+  ini.WriteBool('Share','EnableRating',enable_rating);
+  ini.WriteInteger('Share','RatingThreshold',rating_threshold);
   ini.WriteString('Share','MP3 Extensions',ext_mp3);
   ini.WriteString('Share','Audio Extensions',ext_audio);
   ini.WriteString('Share','Video Extensions',ext_video);
@@ -2756,10 +2761,22 @@
 end;
 
 procedure TSlavaNapWindow.Timer2Timer(Sender: TObject);
+var
+  i: Integer;
+  loc: TLocalUser;
 begin
  if not running then exit;
  cmd_list.AddDoubleCmd(MSG_CMD_SAVEDATA,0,'','');
  mnu_save.Enabled:=false;
+ if HourOf(Now)=0 then
+   for i:=db_local.count-1 downto 0 do
+     try
+       loc:=db_local.Items[i];
+       if loc.logged then
+        if loc.ratepointcache<>999 then
+         loc.ratepointcache:=1;
+      except
+     end;
 end;
 
 procedure TSlavaNapWindow.btn_tb_logClick(Sender: TObject);
diff --dos -urN 21184/settings.dfm 21185/settings.dfm
--- 21184/settings.dfm	Wed Nov 06 01:58:10 2002
+++ 21185/settings.dfm	Fri Dec 13 17:45:36 2002
@@ -285,7 +285,7 @@
       Top = 38
       Width = 365
       Height = 384
-      ActivePage = sh_minshare
+      ActivePage = sh_other3
       Align = alClient
       MultiLine = True
       OwnerDraw = True
@@ -5581,6 +5581,20 @@
           Height = 12
           Caption = '期限:'
         end
+        object Label147: TLabel
+          Left = 30
+          Top = 192
+          Width = 99
+          Height = 12
+          Caption = 'ブロックするポート:'
+        end
+        object Label148: TLabel
+          Left = 160
+          Top = 235
+          Width = 115
+          Height = 12
+          Caption = '検索に必要なポイント:'
+        end
         object cb_nocount_text: TCheckBox
           Left = 6
           Top = 4
@@ -5756,13 +5770,6 @@
           TabOrder = 11
           OnClick = cb_loginblock_portClick
         end
-        object Label147: TLabel
-          Left = 30
-          Top = 192
-          Width = 99
-          Height = 12
-          Caption = 'ブロックするポート:'
-        end
         object edit_loginblock_port: TEdit
           Left = 132
           Top = 188
@@ -5772,12 +5779,31 @@
           Text = 'edit_loginblock_port'
         end
         object cb_l2b_level: TCheckBox
-          Left = 8
+          Left = 6
           Top = 216
           Width = 265
           Height = 17
           Caption = 'local2globalの適用をModerator以上に限定する'
           TabOrder = 13
+        end
+        object cb_enable_rating: TCheckBox
+          Left = 6
+          Top = 235
+          Width = 107
+          Height = 15
+          Caption = 'ポイント制有効'
+          TabOrder = 14
+          OnClick = cb_enable_ratingClick
+        end
+        object edit_rating_threshold: TSpinEdit
+          Left = 282
+          Top = 232
+          Width = 66
+          Height = 21
+          MaxValue = 10000
+          MinValue = -10000
+          TabOrder = 15
+          Value = 1
         end
       end
     end
diff --dos -urN 21184/settings.pas 21185/settings.pas
--- 21184/settings.pas	Wed Nov 06 01:58:10 2002
+++ 21185/settings.pas	Fri Dec 13 12:14:16 2002
@@ -553,6 +553,9 @@
     Label147: TLabel;
     edit_loginblock_port: TEdit;
     cb_l2b_level: TCheckBox;
+    cb_enable_rating: TCheckBox;
+    edit_rating_threshold: TSpinEdit;
+    Label148: TLabel;
     procedure Panel3Resize(Sender: TObject);
     procedure headerPaint(Sender: TObject);
     procedure SetTopText(str: String);
@@ -621,6 +624,7 @@
     procedure cb_block_limitMXClick(Sender: TObject);
     procedure cb_autoban_incompleteClick(Sender: TObject);
     procedure cb_loginblock_portClick(Sender: TObject);
+    procedure cb_enable_ratingClick(Sender: TObject);
   private
     { Private declarations }
     procedure SetBanItems(control: TComboBox);
@@ -1397,6 +1401,8 @@
   cb_autoban_incomplete.Checked:=autoban_incomplete;
   cb_loginblock_port.Checked:=loginblock_port;
   cb_l2b_level.Checked:=local2global_level;
+  cb_enable_rating.Checked:=enable_rating;
+  edit_rating_threshold.Value:=rating_threshold;
 
   if toami_taiou='block' then radio_dl_block.Checked:=true
   else if toami_taiou='leech' then radio_dl_leech.Checked:=true
@@ -1419,6 +1425,9 @@
   edit_loginblock_port.Text:=loginblock_portnumber;
   Label147.Visible:=cb_loginblock_port.Checked;
   edit_loginblock_port.Visible:=cb_loginblock_port.Checked;
+
+  Label148.Visible:=cb_enable_rating.Checked;
+  edit_rating_threshold.Visible:=cb_enable_rating.Checked;
 end;
 
 procedure TSlavaNapSettings.sh_reportShow(Sender: TObject);
@@ -1883,6 +1892,8 @@
    loginblock_port:=cb_loginblock_port.Checked;
    loginblock_portnumber:=edit_loginblock_port.Text;
    local2global_level:=cb_l2b_level.Checked;
+   enable_rating:=cb_enable_rating.Checked;
+   rating_threshold:=edit_rating_threshold.Value;
    if radio_dl_block.Checked then toami_taiou:='block'
    else if radio_dl_leech.Checked then toami_taiou:='leech'
    else if radio_dl_ban.Checked then toami_taiou:='ban';
@@ -2292,6 +2303,12 @@
 begin
   edit_loginblock_port.Visible:=cb_loginblock_port.Checked;
   Label147.Visible:=cb_loginblock_port.Checked;
+end;
+
+procedure TSlavaNapSettings.cb_enable_ratingClick(Sender: TObject);
+begin
+  edit_rating_threshold.Visible:=cb_enable_rating.Checked;
+  Label148.Visible:=cb_enable_rating.Checked;
 end;
 
 end.
diff --dos -urN 21184/users.pas 21185/users.pas
--- 21184/users.pas	Sun Sep 29 19:31:06 2002
+++ 21185/users.pas	Fri Dec 13 01:43:28 2002
@@ -38,6 +38,7 @@
   server        : TServer;
   state         : TUserState;
   last_seen     : time_t;
+  rating        : Integer;
  end;
  POnlineUser = ^TOnlineUser;
  TOnlineUserList = class(TList)
diff --dos -urN 21184/vars.pas 21185/vars.pas
--- 21184/vars.pas	Wed Nov 06 01:58:10 2002
+++ 21185/vars.pas	Fri Dec 13 12:10:22 2002
@@ -200,6 +200,8 @@
  loginblock_port: Boolean;
  loginblock_portnumber: String;
  local2global_level: Boolean;
+ enable_rating: Boolean;
+ rating_threshold: Integer;
  // napigator
  stats_socket: HSocket;
  napigator_socket: HSocket;