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

Diff of /lbbs/src/bbs_main.c

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

Revision 1.31 by sysadm, Mon Apr 28 03:30:59 2025 UTC Revision 1.32 by sysadm, Wed Apr 30 09:18:19 2025 UTC
# Line 15  Line 15 
15   *                                                                         *   *                                                                         *
16   ***************************************************************************/   ***************************************************************************/
17    
18    #include "bbs_main.h"
19  #include "bbs.h"  #include "bbs.h"
20    #include "welcome.h"
21    #include "login.h"
22    #include "user_priv.h"
23  #include "common.h"  #include "common.h"
24    #include "log.h"
25  #include "io.h"  #include "io.h"
26    #include "screen.h"
27  #include "menu.h"  #include "menu.h"
28  #include "bbs_cmd.h"  #include "bbs_cmd.h"
29    #include <unistd.h>
30  #include <time.h>  #include <time.h>
31  #include <string.h>  #include <string.h>
32    
 int bbs_main()  
 {  
         char temp[256];  
         int ret;  
   
         set_input_echo(0);  
   
         bbs_info();  
   
         // Welcome  
         bbs_welcome();  
   
         // Login  
         ret = bbs_login();  
         if (ret < 0)  
                 return -1;  
         log_std("User \"%s\"(%ld) login from %s:%d\n",  
                         BBS_username, BBS_priv.uid, hostaddr_client, port_client);  
         clearscr();  
   
         // BBS Top 10  
         strcpy(temp, app_home_dir);  
         strcat(temp, "data/bbs_top.txt");  
         display_file_ex(temp, 1, 1);  
   
         // Main  
         bbs_center();  
   
         // Logout  
         bbs_exit();  
         log_std("User logout\n");  
   
         return 0;  
 }  
   
33  int bbs_info()  int bbs_info()
34  {  {
35          prints("»¶Ó­¹âÁÙ \033[1;33m%s \033[32m[%s]  \033[37m( %s )\r\n",          prints("»¶Ó­¹âÁÙ \033[1;33m%s \033[32m[%s]  \033[37m( %s )\r\n",
# Line 145  int bbs_center() Line 117  int bbs_center()
117    
118          return 0;          return 0;
119  }  }
120    
121    int bbs_main()
122    {
123            char temp[256];
124            int ret;
125    
126            set_input_echo(0);
127    
128            bbs_info();
129    
130            // Welcome
131            bbs_welcome();
132    
133            // Login
134            ret = bbs_login();
135            if (ret < 0)
136                    return -1;
137            log_std("User \"%s\"(%ld) login from %s:%d\n",
138                            BBS_username, BBS_priv.uid, hostaddr_client, port_client);
139            clearscr();
140    
141            // BBS Top 10
142            strcpy(temp, app_home_dir);
143            strcat(temp, "data/bbs_top.txt");
144            display_file_ex(temp, 1, 1);
145    
146            // Main
147            bbs_center();
148    
149            // Logout
150            bbs_exit();
151            log_std("User logout\n");
152    
153            return 0;
154    }


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

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