| 38 |
|
|
| 39 |
int bbs_info() |
int bbs_info() |
| 40 |
{ |
{ |
| 41 |
prints("ӭ \033[1;33m%s \033[32m[%s] \033[37m( %s )\r\n", |
prints("欢迎光临 \033[1;33m%s \033[32m[%s] \033[37m( %s )\033[m\r\n", |
| 42 |
BBS_name, BBS_server, APP_INFO); |
BBS_name, BBS_server, APP_INFO); |
| 43 |
|
|
| 44 |
return iflush(); |
return iflush(); |
| 157 |
display_file(DATA_WELCOME, 2); |
display_file(DATA_WELCOME, 2); |
| 158 |
|
|
| 159 |
// Display welcome message |
// Display welcome message |
| 160 |
prints("\r\033[1;35mӭ\033[33m %s \033[35mBBS\r\n" |
prints("\r\033[1;35m欢迎光临\033[33m 【 %s 】 \033[35mBBS\r\n" |
| 161 |
"\033[32mĿǰվ [\033[36m%d/%d\033[32m] " |
"\033[32m目前上站人数 [\033[36m%d/%d\033[32m] " |
| 162 |
"ο[\033[36m%d\033[32m] " |
"匿名游客[\033[36m%d\033[32m] " |
| 163 |
"עû[\033[36m%d/%d\033[32m]\r\n" |
"注册用户数[\033[36m%d/%d\033[32m]\r\n" |
| 164 |
" [\033[36m%s\033[32m] ۼƷ˴Σ[\033[36m%d\033[32m]\033[m\r\n", |
"从 [\033[36m%s\033[32m] 起,累计访问人次:[\033[36m%d\033[32m]\033[m\r\n", |
| 165 |
BBS_name, u_online, BBS_max_client, u_anonymous, u_total, |
BBS_name, u_online, BBS_max_client, u_anonymous, u_total, |
| 166 |
BBS_max_user, BBS_start_dt, u_login_count); |
BBS_max_user, BBS_start_dt, u_login_count); |
| 167 |
|
|
| 206 |
show_top("", BBS_name, ""); |
show_top("", BBS_name, ""); |
| 207 |
show_active_board(); |
show_active_board(); |
| 208 |
show_bottom(""); |
show_bottom(""); |
| 209 |
display_menu(p_bbs_menu); |
display_menu(&bbs_menu); |
| 210 |
iflush(); |
iflush(); |
| 211 |
|
|
| 212 |
while (!SYS_server_exit) |
while (!SYS_server_exit) |
| 213 |
{ |
{ |
| 214 |
ch = igetch(100); |
ch = igetch(100); |
| 215 |
|
|
| 216 |
if (p_bbs_menu->choose_step == 0 && time(NULL) - t_last_action >= 10) |
if (bbs_menu.choose_step == 0 && time(NULL) - t_last_action >= 10) |
| 217 |
{ |
{ |
| 218 |
t_last_action = time(NULL); |
t_last_action = time(NULL); |
| 219 |
|
|
| 220 |
show_active_board(); |
show_active_board(); |
| 221 |
show_bottom(""); |
show_bottom(""); |
| 222 |
display_menu_cursor(p_bbs_menu, 1); |
display_menu_cursor(&bbs_menu, 1); |
| 223 |
iflush(); |
iflush(); |
| 224 |
} |
} |
| 225 |
|
|
| 241 |
case CR: |
case CR: |
| 242 |
igetch_reset(); |
igetch_reset(); |
| 243 |
default: |
default: |
| 244 |
switch (menu_control(p_bbs_menu, ch)) |
switch (menu_control(&bbs_menu, ch)) |
| 245 |
{ |
{ |
| 246 |
case EXITBBS: |
case EXITBBS: |
| 247 |
case EXITMENU: |
case EXITMENU: |
| 252 |
show_top("", BBS_name, ""); |
show_top("", BBS_name, ""); |
| 253 |
show_active_board(); |
show_active_board(); |
| 254 |
show_bottom(""); |
show_bottom(""); |
| 255 |
display_menu(p_bbs_menu); |
display_menu(&bbs_menu); |
| 256 |
break; |
break; |
| 257 |
case NOREDRAW: |
case NOREDRAW: |
| 258 |
case UNKNOWN_CMD: |
case UNKNOWN_CMD: |
| 301 |
} |
} |
| 302 |
|
|
| 303 |
// Load menu in shared memory |
// Load menu in shared memory |
| 304 |
if (set_menu_shm_readonly(p_bbs_menu) < 0) |
if (set_menu_shm_readonly(&bbs_menu) < 0) |
| 305 |
{ |
{ |
| 306 |
goto cleanup; |
goto cleanup; |
| 307 |
} |
} |
| 323 |
// User login |
// User login |
| 324 |
if (SSH_v2) |
if (SSH_v2) |
| 325 |
{ |
{ |
| 326 |
prints("\033[1m%s ӭʹsshʽ \033[1;33m...\033[m", BBS_username); |
prints("\033[1m%s 欢迎使用ssh方式访问 \033[1;33m按任意键继续...\033[m", BBS_username); |
| 327 |
iflush(); |
iflush(); |
| 328 |
igetch_t(MAX_DELAY_TIME); |
igetch_t(MAX_DELAY_TIME); |
| 329 |
} |
} |
| 371 |
article_view_log_unload(&BBS_article_view_log); |
article_view_log_unload(&BBS_article_view_log); |
| 372 |
|
|
| 373 |
// Detach menu in shared memory |
// Detach menu in shared memory |
| 374 |
detach_menu_shm(p_bbs_menu); |
detach_menu_shm(&bbs_menu); |
|
free(p_bbs_menu); |
|
|
p_bbs_menu = NULL; |
|
| 375 |
|
|
| 376 |
// Detach data pools shm |
// Detach data pools shm |
| 377 |
detach_section_list_shm(); |
detach_section_list_shm(); |