/[LeafOK_CVS]/lbbs/src/bbs.c
ViewVC logotype

Diff of /lbbs/src/bbs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.33 by sysadm, Thu Oct 23 15:45:41 2025 UTC Revision 1.35 by sysadm, Mon Nov 3 15:08:54 2025 UTC
# Line 36  int BBS_max_client_per_ip = MAX_CLIENT_P Line 36  int BBS_max_client_per_ip = MAX_CLIENT_P
36  char BBS_start_dt[BBS_start_dt_max_len + 1] = "2000年 1月 1日";  char BBS_start_dt[BBS_start_dt_max_len + 1] = "2000年 1月 1日";
37  int BBS_sys_id = 1;  int BBS_sys_id = 1;
38    
39  const int BBS_section_list_load_interval = 5; // second  const int BBS_section_list_load_interval = 1; // second
40    
41  // User  // User
42  const int BBS_user_list_load_interval = 60;               // 1 minute  const int BBS_user_list_load_interval = 60;               // 1 minute
# Line 79  static const int BBS_user_level_points[] Line 79  static const int BBS_user_level_points[]
79          80000,   // 13          80000,   // 13
80          90000,   // 14          90000,   // 14
81          100000,  // 15          100000,  // 15
         INT_MAX, // 16  
82  };  };
83    
84  static const char *BBS_user_level_names[] = {  static const char *BBS_user_level_names[] = {
# Line 129  int get_user_level(int point) Line 128  int get_user_level(int point)
128          while (left < right)          while (left < right)
129          {          {
130                  mid = (left + right) / 2;                  mid = (left + right) / 2;
131                  if (point < BBS_user_level_points[mid + 1])                  if (point < BBS_user_level_points[mid])
132                  {                  {
133                          right = mid;                          right = mid - 1;
134                  }                  }
135                  else if (point > BBS_user_level_points[mid + 1])                  else if (point > BBS_user_level_points[mid])
136                  {                  {
137                          left = mid + 1;                          left = mid + 1;
138                  }                  }
139                  else // if (point == user_level_points[mid])                  else // if (point == user_level_points[mid])
140                  {                  {
141                          left = mid + 1;                          left = mid;
142                          break;                          break;
143                  }                  }
144          }          }
145    
146            if (point < BBS_user_level_points[left])
147            {
148                    left--;
149            }
150    
151          return left;          return left;
152  }  }
153    


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1