BBS Program 2 --- Include Directory

xiaoxiao2021-03-06  41

Sender: loveyou (Dreamman), letter area: DAS_ROOM Title: BBS Program 2 - Include Catalog Send Station: Jincheng Station (Tue Apr 25 20:08:23 2000), transfer

(* More, I am because of the limited level, it is not necessarily very correct, please find errors and timely refer to *)

Let me talk about include the include -> BBS library file directory

In the version of FB7.0, in the include directory:

Bbs.h chat.h config.h Edit.h permissions.h

Struch.h vote.h bbsgopher.h modes.h screen.h

TMACHINE.H

For beginners, you don't need you to know. Just ask you to know a few commonly used. Below I

Take a few commonly used explanations. Other I will introduce it in the following chapters.

Config.h -> Define BBS various settings, such as: Maximum number of people, default BBS directory, BBS

The longest string length used in the order, the longest time, the longest password number

And various identity, etc. ...

Chat.h -> is about some settings in the chat room. For example: the name of the chat room, the maximum length of the chat room, the chat room enters the number, up to a few rooms, the maximum length of the code, chat The room has entered the number, up to several rooms, and global definitions you want to use in the program.

Config.h -> Define the station name, ID, IP address, domain name, BBS port number of the BBS, and the longest time of ordinary users, the longest time of senior users, the maximum number of registered people ..

Edit.h -> The content is very small. Some is the definition of Mark, which is the understanding of the procedures used in the program. There is also a structure TextLine, which is used to keep the characters written when you publish your article (Description: When you are writing a article, you haven't retained to the file when you are writing.

It is temporarily placed in the buffer, waiting for you to officially publish it, then save it to the file)

Permissions.h -> I have learned English, you know that you are setting permissions, of course, this is what you should know, (* Remember, you have to look at the settings here, and future programming often uses To *) BBS permission definition, use the data identity (1, 2, 4), I will talk about it in detail:

In the forefront you can see a lot of numbers such as:

#define perm_basic 000001 #define perm_chat 000002 #define perm_post 000004 ........

If I (LoveYou) only has basic permissions, its permission record is:

Loveyou.userlevel = 000001

(* In fact, it is only written here, and the front plus 0 is also easy to see! Write procedures to develop good habits *) (* is right, then explain, basic permissions are the permissions of the station, if you can't enter the station *)

If I have basic permissions and chat permissions, then:

Loveyou.userlevel = 000003 (* Here is 000001 000002 *)

This definition, then I have the right to this. The following, that's this, the permissions identifier are: 1, 2, 4, 10, 20, 40, 100, 200, 400 .... Designer also stayed for development BBS Permissions: Special1, Special2 ... If you want to add some authority functions to BBS, then set it here, such as I have to add a chat.

The total tube of the room, then I will change perm_special1 to perm_chatgod, and then I will still have the right to add the right to add the right to add, add it to set its Chinese name: Behind this setting Place, you can find a Chinese character, then change "Special Permissions 1" to "Special Permissions 1" in the line in Special1. This way, you can use perm_chatgod permissions in the BBS program. Such as: people who have this permission can kick people in the chatting room, then you will be able to judge the statement HAS_PERM (Perm_Chatgod) in chat.c, if you don't know where to add, then slowly learn I will explain when talking about Chat.c files later. The definition of permissions is taught, and there is also the definition of user parameters. Basic meaning the same. Just, you have to fill a parameter, don't forget to change it :

#define numdefines 26

This line, if you add a parameter, turn 26 to 27. Since this class.

Struct.h -> This library file is also very important, so you have to look at it, I also explain more here. The first defined is the useer structure. This structure is for each user to save various records. First Defined UseREC structure. This structure is for each user to save various records. For example, the user's code, last online address, last time, publish the number of articles, number of on-station, etc. The permissions I mentioned earlier Userlevel record. There is a structure in the next, that is, user_info is also used to record user information. They record

Different, and user_info is used in UTMP files (* If you don't understand, no matter whether it is, anyway, you can primarily understand the useer structure. *)

In the program design, if you want to take a user's permissions, then this is:

Loveyou.userlevel

Take the number of seats: loveYou.numlogins, etc .... You can use the time to find it in the struct.h file, don't fully remember. This library file also defines some of the files such as the file. No need to take it, wait until you can see it again.: PP

Modes.h -> This is also very important. It is defined that the user's state is defined here. You can use it here. You can use it in the program. If you want to add a state, you will be played later, then it is behind Add:

#define Go 56

This 56 is again added in the last few. You can use this after the definition, such as writing: modify_user_mode (go) when the program user begins.

Yes, if you ask, this is the status of which user is GO? BBS program generally refers to the current user (* said that you want to say this, this currentuser, you must have a certain must be remembered, You can use this after the definition. If you start Go when you start playing Chess: it can be used in any corner of the program, it is a global constant, referring to the current user. If you want to get the ID of the current user In this way: currentuser.userid is the current user ID *) - ※ Source: · Meilong Inn bbs.ecust.edu.cn · [from: 211.144.72.160]

转载请注明原文地址:https://www.9cbs.com/read-54651.html

New Post(0)