| 1 |
/*************************************************************************** |
/*************************************************************************** |
| 2 |
bbs_main.c - description |
bbs_main.c - description |
| 3 |
------------------- |
------------------- |
| 4 |
begin : Mon Oct 18 2004 |
Copyright : (C) 2004-2025 by Leaflet |
| 5 |
copyright : (C) 2004 by Leaflet |
Email : leaflet@leafok.com |
|
email : leaflet@leafok.com |
|
| 6 |
***************************************************************************/ |
***************************************************************************/ |
| 7 |
|
|
| 8 |
/*************************************************************************** |
/*************************************************************************** |
| 9 |
* * |
* * |
| 10 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
| 11 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
| 12 |
* the Free Software Foundation; either version 2 of the License, or * |
* the Free Software Foundation; either version 3 of the License, or * |
| 13 |
* (at your option) any later version. * |
* (at your option) any later version. * |
| 14 |
* * |
* * |
| 15 |
***************************************************************************/ |
***************************************************************************/ |
| 44 |
{ |
{ |
| 45 |
display_file_ex(DATA_GOODBYE, 1, 0); |
display_file_ex(DATA_GOODBYE, 1, 0); |
| 46 |
|
|
|
sleep(1); |
|
|
|
|
| 47 |
return 0; |
return 0; |
| 48 |
} |
} |
| 49 |
|
|
| 50 |
int bbs_center() |
int bbs_center() |
| 51 |
{ |
{ |
| 52 |
int ch, redraw; |
int ch; |
| 53 |
time_t t_last_action; |
time_t t_last_action; |
| 54 |
|
|
| 55 |
BBS_last_access_tm = t_last_action = time(0); |
BBS_last_access_tm = t_last_action = time(0); |
| 61 |
show_bottom(""); |
show_bottom(""); |
| 62 |
display_menu(get_menu(&bbs_menu, "TOPMENU")); |
display_menu(get_menu(&bbs_menu, "TOPMENU")); |
| 63 |
|
|
| 64 |
while (!SYS_exit) |
while (!SYS_server_exit) |
| 65 |
{ |
{ |
| 66 |
ch = igetch(0); |
ch = igetch(0); |
| 67 |
|
|
| 75 |
switch (ch) |
switch (ch) |
| 76 |
{ |
{ |
| 77 |
case KEY_NULL: |
case KEY_NULL: |
|
return 0; |
|
| 78 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 79 |
if (time(0) - BBS_last_access_tm >= MAX_DELAY_TIME) |
if (time(0) - BBS_last_access_tm >= MAX_DELAY_TIME) |
| 80 |
{ |
{ |
| 81 |
return -1; |
return 0; |
| 82 |
} |
} |
| 83 |
continue; |
continue; |
| 84 |
default: |
default: |
|
redraw = 1; |
|
| 85 |
switch (menu_control(&bbs_menu, ch)) |
switch (menu_control(&bbs_menu, ch)) |
| 86 |
{ |
{ |
| 87 |
case EXITBBS: |
case EXITBBS: |
| 88 |
return 0; |
return 0; |
| 89 |
case REDRAW: |
case REDRAW: |
|
break; |
|
|
case NOREDRAW: |
|
|
case UNKNOWN_CMD: |
|
|
default: |
|
|
redraw = 0; |
|
|
break; |
|
|
} |
|
|
if (redraw) |
|
|
{ |
|
| 90 |
clearscr(); |
clearscr(); |
| 91 |
show_top(""); |
show_top(""); |
| 92 |
show_active_board(); |
show_active_board(); |
| 93 |
show_bottom(""); |
show_bottom(""); |
| 94 |
display_current_menu(&bbs_menu); |
display_current_menu(&bbs_menu); |
| 95 |
|
break; |
| 96 |
|
case NOREDRAW: |
| 97 |
|
case UNKNOWN_CMD: |
| 98 |
|
default: |
| 99 |
|
break; |
| 100 |
} |
} |
| 101 |
} |
} |
| 102 |
BBS_last_access_tm = time(0); |
BBS_last_access_tm = time(0); |