| 150 |
u_anonymous++; |
u_anonymous++; |
| 151 |
|
|
| 152 |
// Display logo |
// Display logo |
| 153 |
display_file(DATA_WELCOME); |
display_file_ex(DATA_WELCOME, 1, 0); |
| 154 |
|
|
| 155 |
// Display welcome message |
// Display welcome message |
| 156 |
prints("\033[1;35m欢迎光临\033[33m 【 %s 】 \033[35mBBS\r\n" |
prints("\r\033[1;35m欢迎光临\033[33m 【 %s 】 \033[35mBBS\r\n" |
| 157 |
"\033[32m目前上站人数 [\033[36m%d/%d\033[32m] " |
"\033[32m目前上站人数 [\033[36m%d/%d\033[32m] " |
| 158 |
"匿名游客[\033[36m%d\033[32m] " |
"匿名游客[\033[36m%d\033[32m] " |
| 159 |
"注册用户数[\033[36m%d/%d\033[32m]\r\n" |
"注册用户数[\033[36m%d/%d\033[32m]\r\n" |
| 172 |
return -1; |
return -1; |
| 173 |
} |
} |
| 174 |
|
|
| 175 |
if (display_file_ex(DATA_GOODBYE, 1, 0) < 0) |
display_file_ex(DATA_GOODBYE, 1, 0); |
|
{ |
|
|
return -2; |
|
|
} |
|
| 176 |
|
|
| 177 |
log_std("User logout\n"); |
log_std("User logout\n"); |
| 178 |
|
|
| 191 |
show_top(""); |
show_top(""); |
| 192 |
show_active_board(); |
show_active_board(); |
| 193 |
show_bottom(""); |
show_bottom(""); |
| 194 |
display_menu(get_menu(&bbs_menu, "TOPMENU")); |
display_menu(p_bbs_menu); |
| 195 |
|
|
| 196 |
while (!SYS_server_exit) |
while (!SYS_server_exit) |
| 197 |
{ |
{ |
| 198 |
ch = igetch(0); |
ch = igetch(100); |
| 199 |
|
|
| 200 |
if (time(0) - t_last_action >= 10) |
if (time(0) - t_last_action >= 10) |
| 201 |
{ |
{ |
| 214 |
return 0; |
return 0; |
| 215 |
} |
} |
| 216 |
continue; |
continue; |
| 217 |
|
case CR: |
| 218 |
|
igetch_reset(); |
| 219 |
default: |
default: |
| 220 |
switch (menu_control(&bbs_menu, ch)) |
switch (menu_control(p_bbs_menu, ch)) |
| 221 |
{ |
{ |
| 222 |
case EXITBBS: |
case EXITBBS: |
| 223 |
return 0; |
return 0; |
| 226 |
show_top(""); |
show_top(""); |
| 227 |
show_active_board(); |
show_active_board(); |
| 228 |
show_bottom(""); |
show_bottom(""); |
| 229 |
display_current_menu(&bbs_menu); |
display_menu(p_bbs_menu); |
| 230 |
break; |
break; |
| 231 |
case NOREDRAW: |
case NOREDRAW: |
| 232 |
case UNKNOWN_CMD: |
case UNKNOWN_CMD: |
| 275 |
clearscr(); |
clearscr(); |
| 276 |
|
|
| 277 |
// BBS Top 10 |
// BBS Top 10 |
| 278 |
if (display_file_ex("./var/bbs_top.txt", 1, 1) < 0) |
display_file_ex("./var/bbs_top.txt", 1, 1); |
| 279 |
|
|
| 280 |
|
// Load menu in shared memory |
| 281 |
|
if (load_menu_shm(p_bbs_menu) < 0) |
| 282 |
{ |
{ |
| 283 |
prints("无法加载本站十大\n"); |
return -5; |
| 284 |
} |
} |
| 285 |
|
|
| 286 |
// Main |
// Main |
| 287 |
bbs_center(); |
bbs_center(); |
| 288 |
|
|
| 289 |
|
// Unload menu in shared memory |
| 290 |
|
unload_menu_shm(p_bbs_menu); |
| 291 |
|
free(p_bbs_menu); |
| 292 |
|
p_bbs_menu = NULL; |
| 293 |
|
|
| 294 |
// Logout |
// Logout |
| 295 |
bbs_logout(db); |
bbs_logout(db); |
| 296 |
|
|