| 172 |
return -1; |
return -1; |
| 173 |
} |
} |
| 174 |
|
|
| 175 |
display_file_ex(DATA_GOODBYE, 1, 0); |
display_file_ex(DATA_GOODBYE, 1, 1); |
| 176 |
|
|
| 177 |
log_std("User logout\n"); |
log_std("User logout\n"); |
| 178 |
|
|
| 192 |
show_active_board(); |
show_active_board(); |
| 193 |
show_bottom(""); |
show_bottom(""); |
| 194 |
display_menu(p_bbs_menu); |
display_menu(p_bbs_menu); |
| 195 |
|
iflush(); |
| 196 |
|
|
| 197 |
while (!SYS_server_exit) |
while (!SYS_server_exit) |
| 198 |
{ |
{ |
| 199 |
ch = igetch(100); |
ch = igetch(100); |
| 200 |
|
|
| 201 |
if (time(0) - t_last_action >= 10) |
if (p_bbs_menu->choose_step == 0 && time(0) - t_last_action >= 10) |
| 202 |
{ |
{ |
| 203 |
t_last_action = time(0); |
t_last_action = time(0); |
| 204 |
|
|
| 205 |
show_active_board(); |
show_active_board(); |
| 206 |
show_bottom(""); |
show_bottom(""); |
| 207 |
|
iflush(); |
| 208 |
} |
} |
| 209 |
|
|
| 210 |
switch (ch) |
switch (ch) |
| 225 |
case EXITBBS: |
case EXITBBS: |
| 226 |
return 0; |
return 0; |
| 227 |
case REDRAW: |
case REDRAW: |
| 228 |
|
t_last_action = time(0); |
| 229 |
clearscr(); |
clearscr(); |
| 230 |
show_top(""); |
show_top(""); |
| 231 |
show_active_board(); |
show_active_board(); |
| 237 |
default: |
default: |
| 238 |
break; |
break; |
| 239 |
} |
} |
| 240 |
|
iflush(); |
| 241 |
} |
} |
| 242 |
|
|
| 243 |
BBS_last_access_tm = time(0); |
BBS_last_access_tm = time(0); |
| 244 |
} |
} |
| 245 |
|
|
| 281 |
clearscr(); |
clearscr(); |
| 282 |
|
|
| 283 |
// BBS Top 10 |
// BBS Top 10 |
| 284 |
display_file_ex("./var/bbs_top.txt", 1, 1); |
display_file_ex(VAR_BBS_TOP, 1, 1); |
| 285 |
|
|
| 286 |
// Load menu in shared memory |
// Load menu in shared memory |
| 287 |
if (load_menu_shm(p_bbs_menu) < 0) |
if (set_menu_shm_readonly(p_bbs_menu) < 0) |
| 288 |
{ |
{ |
| 289 |
return -5; |
return -5; |
| 290 |
} |
} |
| 293 |
bbs_center(); |
bbs_center(); |
| 294 |
|
|
| 295 |
// Unload menu in shared memory |
// Unload menu in shared memory |
| 296 |
unload_menu_shm(p_bbs_menu); |
detach_menu_shm(p_bbs_menu); |
| 297 |
free(p_bbs_menu); |
free(p_bbs_menu); |
| 298 |
p_bbs_menu = NULL; |
p_bbs_menu = NULL; |
| 299 |
|
|
| 300 |
// Logout |
// Logout |
| 301 |
bbs_logout(db); |
bbs_logout(db); |
| 302 |
|
|
| 303 |
|
// Unload file_loader and trie_dict |
| 304 |
|
// Do nothing explictly - SHM detached automatically on process exit |
| 305 |
|
|
| 306 |
mysql_close(db); |
mysql_close(db); |
| 307 |
|
|
| 308 |
return 0; |
return 0; |