2003.08.08 (金) 07:34:49 <u*j*2*6*> allow_2bytename変数の大文字小文字をそろえる修正もついでに入ってます
shuusei24174:ユーザーをアイドル状態とみなすまでの時間を設定するオプション(24161参照、idea by oyakata)

diff --dos -ur 24173/constants.pas 24174/constants.pas
--- 24173/constants.pas	Thu Aug 07 23:42:14 2003
+++ 24174/constants.pas	Fri Aug 08 00:08:36 2003
@@ -27,8 +27,8 @@
  SLAVANAP_VERSION             = '2.4.1';
  SLAVANAP_BUILD               = '108';
  SLAVANAP_BUILD_DATE          = '24 January 2003';
- SLAVANAP_SHUUSEI             = '73';
- SLAVANAP_SHUUSEI_DATE        = '7 August 2003';
+ SLAVANAP_SHUUSEI             = '74';
+ SLAVANAP_SHUUSEI_DATE        = '8 August 2003';
  SLAVANAP_VERSION_SHORT       = SLAVANAP_TITLE+' '+SLAVANAP_VERSION;
  SLAVANAP_FULL                = SLAVANAP_TITLE+' '+SLAVANAP_VERSION+
                                 ' (build '+SLAVANAP_BUILD+
diff --dos -ur 24173/mainform.pas 24174/mainform.pas
--- 24173/mainform.pas	Thu Aug 07 23:30:20 2003
+++ 24174/mainform.pas	Fri Aug 08 00:24:52 2003
@@ -1472,7 +1472,7 @@
   StrHash_Clear(cons_friends);
   force_enter:=ini.ReadBool('Other2','ForceEnter',false);
   force_enter_channel:=ini.ReadString('Other2','ForceEnterChannel','#Alternative');
-  allow_2byteName:=ini.ReadBool('Other2','Allow2ByteName',false);
+  allow_2bytename:=ini.ReadBool('Other2','Allow2ByteName',false);
   check_loginpass:=ini.ReadBool('Other2','CheckLoginPass',false);
   loginpass:=ini.ReadString('Other2','LoginPass','');
   enable_msgserv:=ini.ReadBool('Other2','EnableMsgServ',false);
@@ -1498,6 +1498,7 @@
   for i:=0 to max_custom_allow do
    allowed_custom[i]:=ini.ReadString('Other2','AllowCustomClient'+IntToStr(i),'');
   kill_idleuser:=ini.ReadBool('Other2','KillIdleUser',false);
+  kill_idleuser_time:=ini.ReadInteger('Other2','KillIdleUserTime',180);
   listall_for_users:=ini.ReadBool('Other2','ListAllForUsers',true);
   block_weird_xnapfile:=ini.ReadBool('Other2','BlockWeirdXNapFile',false);
 
@@ -1957,7 +1958,7 @@
   list.Free;
   ini.WriteBool('Other2','ForceEnter',force_enter);
   ini.WriteString('Other2','ForceEnterChannel',force_enter_channel);
-  ini.WriteBool('Other2','Allow2ByteName',allow_2byteName);
+  ini.WriteBool('Other2','Allow2ByteName',allow_2bytename);
   ini.WriteBool('Other2','CheckLoginPass',check_loginpass);
   ini.WriteString('Other2','LoginPass',loginpass);
   ini.WriteBool('Other2','EnableMsgServ',enable_msgserv);
@@ -1979,6 +1980,7 @@
   for i:=0 to max_custom_allow do
    ini.WriteString('Other2','AllowCustomClient'+IntToStr(i),allowed_custom[i]);
   ini.WriteBool('Other2','KillIdleUser',kill_idleuser);
+  ini.WriteInteger('Other2','KillIdleUserTime',kill_idleuser_time);
   ini.WriteBool('Other2','ListAllForUsers',listall_for_users);
   ini.WriteBool('Other2','BlockWeirdXNapFile',block_weird_xnapfile);
   finally
diff --dos -ur 24173/settings.dfm 24174/settings.dfm
--- 24173/settings.dfm	Thu Aug 07 23:41:34 2003
+++ 24174/settings.dfm	Fri Aug 08 00:34:00 2003
@@ -1922,7 +1922,7 @@
           Width = 156
           Height = 20
           Style = csDropDownList
-          ItemHeight = 0
+          ItemHeight = 12
           TabOrder = 9
         end
       end
@@ -2435,7 +2435,7 @@
           Width = 111
           Height = 20
           Style = csDropDownList
-          ItemHeight = 0
+          ItemHeight = 12
           TabOrder = 1
         end
         object Edit_cons_autojoin1: TEdit
@@ -5504,7 +5504,7 @@
           Width = 156
           Height = 20
           Style = csDropDownList
-          ItemHeight = 0
+          ItemHeight = 12
           TabOrder = 9
         end
       end
@@ -5860,7 +5860,7 @@
             Width = 73
             Height = 20
             Style = csDropDownList
-            ItemHeight = 0
+            ItemHeight = 12
             TabOrder = 4
             Visible = False
           end
@@ -5915,7 +5915,7 @@
             Width = 73
             Height = 20
             Style = csDropDownList
-            ItemHeight = 0
+            ItemHeight = 12
             TabOrder = 4
             Visible = False
           end
@@ -6038,6 +6038,22 @@
           Caption = '秒毎'
           Visible = False
         end
+        object Label161: TLabel
+          Left = 200
+          Top = 210
+          Width = 46
+          Height = 12
+          Caption = '切断まで'
+          Visible = False
+        end
+        object Label162: TLabel
+          Left = 320
+          Top = 210
+          Width = 12
+          Height = 12
+          Caption = '分'
+          Visible = False
+        end
         object GroupBox1: TGroupBox
           Left = 8
           Top = 0
@@ -6196,6 +6212,7 @@
           Height = 17
           Caption = 'アイドル状態のユーザーを切断'
           TabOrder = 13
+          OnClick = cb_kill_idleuserClick
         end
         object cb_deny_listall_for_users: TCheckBox
           Left = 8
@@ -6212,6 +6229,17 @@
           Height = 17
           Caption = 'XNapの文字化け共有をブロック'
           TabOrder = 15
+        end
+        object edit_kill_idleuser_time: TSpinEdit
+          Left = 256
+          Top = 206
+          Width = 57
+          Height = 21
+          MaxValue = 10080
+          MinValue = 1
+          TabOrder = 16
+          Value = 180
+          Visible = False
         end
       end
       object sh_other4: TDFWTabSheetes
diff --dos -ur 24173/settings.pas 24174/settings.pas
--- 24173/settings.pas	Thu Aug 07 23:40:06 2003
+++ 24174/settings.pas	Fri Aug 08 00:43:18 2003
@@ -619,6 +619,9 @@
     cb_kill_idleuser: TCheckBox;
     cb_deny_listall_for_users: TCheckBox;
     cb_block_weird_xnapfile: TCheckBox;
+    edit_kill_idleuser_time: TSpinEdit;
+    Label161: TLabel;
+    Label162: TLabel;
     procedure Panel3Resize(Sender: TObject);
     procedure headerPaint(Sender: TObject);
     procedure SetTopText(str: String);
@@ -705,6 +708,7 @@
     procedure cb_minshare_banClick(Sender: TObject);
     procedure cb_allow_otherClick(Sender: TObject);
     procedure sh_other4Show(Sender: TObject);
+    procedure cb_kill_idleuserClick(Sender: TObject);
   private
     { Private declarations }
     procedure SetBanItems(control: TComboBox);
@@ -1589,6 +1593,10 @@
  end;
  cb_minshare_noblockact.Checked:=minshare_noblockact;
  cb_kill_idleuser.Checked:=kill_idleuser;
+ edit_kill_idleuser_time.Value:=kill_idleuser_time div 60000;
+ Label161.Visible:=cb_kill_idleuser.Checked;
+ Label162.Visible:=cb_kill_idleuser.Checked;
+ edit_kill_idleuser_time.Visible:=cb_kill_idleuser.Checked;
  cb_deny_listall_for_users.Checked:=not listall_for_users;
  cb_block_weird_xnapfile.Checked:=block_weird_xnapfile;
 end;
@@ -2189,6 +2197,7 @@
    end;
    minshare_noblockact:=cb_minshare_noblockact.Checked;
    kill_idleuser:=cb_kill_idleuser.Checked;
+   kill_idleuser_time:=edit_kill_idleuser_time.Value*60000;
    listall_for_users:=not cb_deny_listall_for_users.Checked;
    block_weird_xnapfile:=cb_block_weird_xnapfile.Checked;
   except
@@ -3079,6 +3088,13 @@
   edit_allow_sign2.Visible:=cb_allow_other.Checked;
   edit_allow_sign3.Visible:=cb_allow_other.Checked;
   edit_allow_sign4.Visible:=cb_allow_other.Checked;
+end;
+
+procedure TSlavaNapSettings.cb_kill_idleuserClick(Sender: TObject);
+begin
+  Label161.Visible:=cb_kill_idleuser.Checked;
+  Label162.Visible:=cb_kill_idleuser.Checked;
+  edit_kill_idleuser_time.Visible:=cb_kill_idleuser.Checked;
 end;
 
 end.
diff --dos -ur 24173/stypes.pas 24174/stypes.pas
--- 24173/stypes.pas	Thu Aug 07 23:42:24 2003
+++ 24174/stypes.pas	Fri Aug 08 00:08:00 2003
@@ -1212,7 +1212,7 @@
    if str='root'     then exit;
    for i:=0 to 4 do if str=AnsiLowerCase(levels[i]) then exit;
  end;
- if allow_2byteName then
+ if allow_2bytename then
  begin
    if Trim(str)<>str then exit;
    for i:=1 to Length(str) do
diff --dos -ur 24173/thread.pas 24174/thread.pas
--- 24173/thread.pas	Sun Apr 13 15:01:08 2003
+++ 24174/thread.pas	Fri Aug 08 00:50:32 2003
@@ -1313,7 +1313,6 @@
  db_reconnect.Clear;
  ResetWantQueueControl;
  ResetDLRequestControl;
- KillIdleUser;
  tmp_pos:=1562;
  if num_servers>0 then
   for i:=0 to db_local.count-1 do
@@ -1416,6 +1415,7 @@
      if (current_time-WINMX_DETECT_TIME)>loc.last_seen then
       CheckWinMX(loc);
  end;
+ KillIdleUser;
  tmp_pos:=1576;
  linking:=false;
  for i:=0 to db_servers.count-1 do
@@ -2032,7 +2032,7 @@
  try
    loc:=db_local.Items[i];
    if loc.logged then
-   if GetTickCount-loc.last_command_time>60000 then
+   if GetTickCount-loc.last_command_time>kill_idleuser_time then
    if loc.level<NapUserModerator then
    if not StrHash_FindString(db_friends,loc.nick,true) then
    begin
diff --dos -ur 24173/vars.pas 24174/vars.pas
--- 24173/vars.pas	Thu Aug 07 23:30:30 2003
+++ 24174/vars.pas	Fri Aug 08 00:31:36 2003
@@ -327,7 +327,7 @@
  loginim: Array[0..MAX_LOGINIM] of String;
  force_enter: Boolean;
  force_enter_channel: String;
- allow_2byteName: Boolean;
+ allow_2bytename: Boolean;
  check_loginpass: Boolean;
  loginpass: String;
  enable_msgserv: Boolean;
@@ -341,6 +341,7 @@
  'Lopster', 'XNap', 'Utatane', '2get', 'Teknap', 'Other');
  allowed_custom: Array[0..MAX_CUSTOM_ALLOW] of String;
  kill_idleuser: Boolean;
+ kill_idleuser_time: Cardinal;
  listall_for_users: Boolean;
  block_weird_xnapfile: Boolean;
 implementation