home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / bbs / qstruct / struct.doc
Text File  |  1989-02-05  |  19KB  |  492 lines

  1. //////////////////////////////////////////////////////////////////////////
  2. /                                                                        /
  3. /                       QuickBBS ST v0.30c Structures                    /
  4. /                                                                        /
  5. / The descriptions given here are for your info only. They are will      /
  6. / probably change without notice! If you decide to use these structures, /
  7. / you may do so, but if ANYTHING goes wrong IT'S ALWAYS YOUR OWN STUPID  /
  8. / FAULT.                                                                 /
  9. /                                                                        /
  10. / Part of this document is based on structures created by Adam Hudson,   /
  11. / the author of the 'original' PC version, and by Jac Kersing and        /
  12. / J.P. Middeling, authors of Pandora, The-Box and related utilities      /
  13. /                                                                        /
  14. /                                                       - Jon -          /
  15. /                                                                        /
  16. //////////////////////////////////////////////////////////////////////////
  17.  
  18. ***********************************
  19. ** 1 **  Variable types used...  **
  20. ***********************************
  21.  
  22. The following variable types and names have been used:
  23.  
  24.     * Pas[n]
  25.  
  26.         A Pascal type string with a maximum length of n. The first
  27.         byte contains the length of the string. When stored in a
  28.         file the string will be n long. Example:
  29.  
  30.         User name 'Alexis Carrington' is 17 characters long. The
  31.         space reserved for the user name in USERS.BBS is 36. In
  32.         the file it would look something like:
  33.  
  34.                 <17>Alexis Carrington__________________
  35.  
  36.         Where   <17> is a character with ascii value 17, and
  37.                 ____ is something undefined.
  38.  
  39.         Note that the actual user name may only be 35 characters!
  40.         To convert a Pascal type string A$ into a GfA string, use:
  41.  
  42.                 A$=Mid$(A$,2,Asc(A$))
  43.  
  44.     * Str[n]
  45.  
  46.         A C-Type string, null terminated, of max n characters.
  47.         An example: A message is addressed to 'Alexis Carrington'.
  48.         In the message header a space of 36 characters is reserved
  49.         for the 'To' field. That space would be filled like this:
  50.  
  51.         Alexis Carrington<0>__________________
  52.  
  53.         Where  <0> is a character with ascii value 0, and
  54.                ____ is something undefined.
  55.  
  56.         To convert a C-type string A$ into a GfA string, use:
  57.  
  58.                 A$ = Char{ V:A$ }                    ( GfA 3.0 only )
  59.         
  60.         or
  61.                 A$=Left$(A$,Instr(A$,Chr$(0))-1)     ( Any GfA )
  62.  
  63.         You might want to check the string is actually null-terminated
  64.         with...
  65.  
  66.                 If Instr(A$,Chr$(0))
  67.                    .
  68.                    .
  69.                    .
  70.                 Endif
  71.  
  72.     * Byte 
  73.  
  74.         A single byte, range 0..255.
  75.  
  76.     * Word
  77.  
  78.         A two-byte value, range 0..65535.
  79.  
  80.     * Long
  81.  
  82.         A four-byte value, range 0..?????
  83.  
  84.     * MS-Word
  85.  
  86.         The same as a word, but the two bytes are in Intel-format.
  87.  
  88.     * MS-Long
  89.  
  90.         The same as a long, but the for bytes are in Intel-format.
  91.  
  92.     *** NOTE ***
  93.  
  94.     The information given here is the way QUICKBBS ST handles the files.
  95.     This may differ from the way Pandora, The-Box, QuickBBS PC and
  96.     utilities handle them! 
  97.  
  98. **************************
  99. ** 2 **  The user file  **
  100. **************************
  101.  
  102. The file USERS.BBS has the following format :
  103.  
  104.  
  105.         Name .............. 36 .... Pas[36]
  106.         City .............. 26 .... Pas[26]
  107.         Password .......... 16 .... Pas[16]
  108.         Data Phone ........ 13 .... Pas[13]
  109.         Home Phone ........ 13 .... Pas[13]
  110.         Last Time On ......  6 .... Pas[ 6]   Format HH:MM
  111.         Last Date On ......  9 .... Pas[ 9]   Format DD/MM/YY
  112.         Attributes ........  1 .... Byte      See below
  113.         Flags .............  4 .... Long
  114.         Credit ............  2 .... Word
  115.         - Reserved - ......  2 .... -
  116.         Posted Messages ...  2 .... Word
  117.         Graphics Mode .....  2 .... Word
  118.         Security Level ....  2 .... Word
  119.         Calls .............  2 .... Word
  120.         Uploads ...........  2 .... Word
  121.         Downloads .........  2 .... Word
  122.         Uploaded Kb .......  2 .... Word
  123.         Downloaded Kb .....  2 .... Word
  124.         DL'ed Today Kb ....  2 .... Word
  125.         Secs used today ...  2 .... Word
  126.         Screen Length .....  2 .... Word
  127.         - Reserved - ......  8 .... -
  128.  
  129.     The user attributes are:
  130.  
  131.         Bit 0 - Deleted
  132.         Bit 1 - Clear Screen 
  133.         Bit 2 - More Prompts
  134.         Bit 3 - Use F.S.E.
  135.         Bit 4 - Reserved
  136.         Bit 5 - Reserved
  137.         Bit 6 - Reserved
  138.         Bit 7 - Reserved
  139.  
  140. If the lastread pointers are used, each user has one record of 400
  141. bytes in the LASTREAD.BBS file, 2 bytes for each message board,
  142. like this:
  143.  
  144.                 +-------+-------+-------...---------+
  145.          User 1 | area1 | area2 | area3 ... area200 |
  146.                 +-------+-------+-------...---------+
  147.          User 2 | area1 | area2 | area3 ... area200 |
  148.                 +-------+-------+-------...---------+
  149.          User 3 | area1 | area2 | area3 ... area200 |
  150.                 .       .       .       . .         .
  151.                 .       .       .       . .         .
  152.  
  153.  
  154. ***********************************
  155. ** 3 **  The configuration file  **
  156. ***********************************
  157.  
  158. The file QCONFIG.BBS has the following structure:
  159.  
  160.         Max Baudrate ....................  2 ....... Word
  161.         Max Init Tries ..................  1 ....... Byte
  162.         Connect Delay (Seconds) .........  1 ....... Byte
  163.        *Answer Delay (Seconds) ..........  1 ....... Byte
  164.         Init String ..................... 70 ....... Str[70]
  165.         Reset String .................... 70 ....... Str[70]
  166.        *Answer String ................... 70 ....... Str[70]
  167.         Ring Detection .................. 20 ....... Str[20]
  168.         Init Response ................... 20 ....... Str[20]
  169.         Reset Response .................. 20 ....... Str[20]
  170.         300 Baud Response ............... 20 ....... Str[20]
  171.         1200 Baud Response .............. 20 ....... Str[20]
  172.         2400 Baud Response .............. 20 ....... Str[20]
  173.         Minimum Baudrate to Logon .......  2 ....... Word
  174.         Minimum Baudrate for VT-52 ......  2 ....... Word
  175.         Minimum Baudrate for Xfer .......  2 ....... Word
  176.  
  177.     ... Paths & names
  178.  
  179.         Menu Path ....................... 70 ....... Str[70]
  180.         Textfile Path ................... 70 ....... Str[70]
  181.         Message Path .................... 70 ....... Str[70]
  182.         OARC Path ....................... 70 ....... Str[70]
  183.         - Reserved - .................... 70 ....... -
  184.         External Chat ................... 70 ....... Str[70]
  185.         FSE Program ..................... 70 ....... Str[70]
  186.         Sysop Name ...................... 40 ....... Str[40]
  187.        *System Name ..................... 40 ....... Str[40]
  188.         
  189.         ... Times
  190.  
  191.         Start 300 Baud Access ........... 10 ....... Str[10] Format:
  192.         End 300 Baud Access ............. 10 ....... Str[10]
  193.         Start Download Hours ............ 10 ....... Str[10] HH:MM:SS
  194.         End Download Hours .............. 10 ....... Str[10]
  195.         Start Paging Hours .............. 10 ....... Str[10]
  196.         End Paging Hours ................ 10 ....... Str[10]
  197.         
  198.         ... New users
  199.         
  200.         New User Security ...............  2 ....... Word
  201.         New User Flags ...,,.............  4 ....... Long
  202.         New User Credit (Cents) .........  2 ....... Word
  203.         
  204.         ... Restrictions
  205.         
  206.         Max OARC Size (Kb)...............  2 ....... Word
  207.         Timeout (Seconds) ...............  2 ....... Word
  208.         Default Logon Time (Minutes) ....  2 ....... Word
  209.         Password Tries ..................  1 ....... Byte
  210.         Maximum Pages ...................  1 ....... Byte
  211.         Page Tune Length ................  1 ....... Byte
  212.         
  213.         ... Network information
  214.         
  215.         Zone Number .....................  2 ....... Word
  216.         Net Number ......................  2 ....... Word
  217.         Node Number .....................  2 ....... Word
  218.        *Allow Reply to Unlisted Nodes ...  1 ....... Byte
  219.         
  220.         ... Screen
  221.         
  222.         Status Line Character Colour ....  1 ....... Byte
  223.         Status Line Background Colour ...  1 ....... Byte
  224.         Colour 0 (RGB) - Background .....  4 ....... Long
  225.         Colour 1 (RGB) ..................  4 ....... Long
  226.         Colour 2 (RGB) ..................  4 ....... Long
  227.         Colour 3 (RGB) - Foreground .....  4 ....... Long
  228.         Screen Saver Delay (Seconds) ....  2 ....... Word
  229.         
  230.         ... Toggles
  231.         
  232.         ^E at Logon .....................  1 ....... Byte
  233.         Fast Logon Locally ..............  1 ....... Byte
  234.         Ask for Pwd Locally .............  1 ....... Byte
  235.         Use LastRead Pointers ...........  1 ....... Byte
  236.         Exit for Net/Echo ...............  1 ....... Byte
  237.         Check for Mail ..................  1 ....... Byte
  238.         Ask Voice Phone .................  1 ....... Byte
  239.         Ask Data Phone ..................  1 ....... Byte
  240.         Ask New Users Graphics ..........  1 ....... Byte
  241.         Use Xmodem ......................  1 ....... Byte
  242.         Use Xmodem 1K ...................  1 ....... Byte
  243.         Use Ymodem ......................  1 ....... Byte
  244.         Use WXmodem .....................  1 ....... Byte
  245.         Use Zmodem ......................  1 ....... Byte
  246.         Allow Batch Downloads ...........  1 ....... Byte
  247.        *Enforce Language ................  1 ....... Byte
  248.        *Enforce Lower Case ..............  1 ....... Byte
  249.        *Touch Uploads ...................  1 ....... Byte
  250.        *Use Extended File Info ..........  1 ....... Byte
  251.         Allow Quoting ...................  1 ....... Byte
  252.        *Save Combined Boards ............  1 ....... Byte
  253.        *Use Manual Answer ...............  1 ....... Byte
  254.         
  255.         ... Additions
  256.  
  257.         Use YellTunes ....................  1 ....... Byte
  258.         Nodelist Path .................... 70 ....... Str[70]
  259.         - Reserved - .....................970 ....... -
  260.  
  261.         * = Not (yet) supported / used.
  262.  
  263. **********************************
  264. ** 4 **  The message board file **
  265. **********************************
  266.  
  267. The message board configuration file BOARDS.BBS has 200 records
  268. which are built up like this:
  269.  
  270.         Board Name ...................... 20 ....... Str[20]
  271.         Board Type ......................  2 ....... Word
  272.         Read Security ...................  2 ....... Word
  273.         Read Flags ......................  4 ....... Long
  274.         Write Security ..................  2 ....... Word
  275.         Write Flags .....................  4 ....... Long
  276.         Sysop Security ..................  2 ....... Word
  277.         Sysop Flags .....................  5 ....... Long
  278.         Origin line ..................... 60 ....... Str[60]
  279.  
  280. ***************************
  281. ** 5 **  The menu files  ** 
  282. ***************************
  283.  
  284. The menu files (*.MNU) have the following record layout:
  285.  
  286.         Option Type .....................  1 ....... Byte
  287.         Option Security .................  2 ....... MS-Word
  288.         Option Flags ....................  4 ....... MS-Long
  289.         Option Text ..................... 76 ....... Pas[76]
  290.         Option Key ......................  1 ....... Byte
  291.         Option Parameters ............... 81 ....... Pas[81]
  292.        *Option Foreground Colour ........  1 ....... Byte
  293.        *Option Background Colour ........  1 ....... Byte
  294.  
  295. Record 0 contains the prompt line in its 'Option Text' field. Colours
  296. are not (yet) supported.
  297.  
  298. *****************************
  299. ** 5 **  The Message files ** 
  300. *****************************
  301.  
  302. The *.HDR files are built up like this:
  303.  
  304.         From ............................ 36 ........ Str[36]
  305.         To .............................. 36 ........ Str[36]
  306.         Subject ......................... 72 ........ Str[72]
  307.         Time ............................ 20 ........ Str[20]
  308.         Stamp ...........................  4 ........ Long
  309.         Offset in .MSG ..................  4 ........ Long
  310.         - Reserved - ....................  2 ........ Word
  311.         Message is a reply to  ..........  2 ........ Word
  312.         Attributes ......................  2 ........ Word
  313.         - Reserved - Mailer ............. 16 ........ -
  314.         Size in .MSG ....................  2 ........ Word
  315.         Read Count ......................  2 ........ Word
  316.         Cost (cents) ....................  2 ........ Word
  317.         Origin ........ Zone ............  2 ........ Word
  318.         Origin ........ Net .............  2 ........ Word
  319.         Origin ........ Node ............  2 ........ Word
  320.        *Origin ........ Point ...........  2 ........ Word
  321.         Destination ... Zone ............  2 ........ Word
  322.         Destination ... Net .............  2 ........ Word
  323.         Destination ... Node ............  2 ........ Word
  324.        *Destination ... Point ...........  2 ........ Word
  325.  
  326. Notes: - Fields marked '*' are not supported/used by QuickBBS ST, but MIGHT
  327.          be used by The-Box and/or Import/Export/ComScan etc!
  328.     
  329.        - Do NOT mess around with the 'Mailer' field. This is OFF LIMITS!
  330.  
  331.        - The 'Time' field is a string containing the date and time in Ascii
  332.          of the message, example : "24 Oct 88 13:25:00".
  333.  
  334.        - The 'Stamp' field is the number of seconds between 01/01/1970 and
  335.          the time the message was processed by Import, or the message was
  336.          entered in QuickBBS/Pandora/Caned/whatever.
  337.  
  338.        - Message Attributes:
  339.  
  340.            Bit  0 ............ Message is private
  341.           *Bit  1 ............ Message is crashmail
  342.            Bit  2 ............ Message has been received
  343.            Bit  3 ............ Message has been sent
  344.           *Bit  4 ............ Message has a file attached
  345.           *Bit  5 ............ Message has been forwarded
  346.           *Bit  6 ............ Message has unknown destination
  347.            Bit  7 ............ Message to be killed when sent
  348.            Bit  8 ............ Message was entered here
  349.           *Bit  9 ............ Message to be held for pickup
  350.            Bit 10 ............ - Reserved -
  351.            Bit 11 ............ - Reserved -
  352.            Bit 12 ............ - Reserved -
  353.            Bit 13 ............ - Reserved -
  354.            Bit 14 ............ - Reserved -
  355.            Bit 15 ............ Message has been deleted
  356.  
  357.         - Each message board consists of two files, which are located in
  358.           your 'message file' directory as specified in QConfig. The files
  359.           are called nnnn.HDR and nnnn.MSG where 'nnnn' is the message
  360.           area number, such as...
  361.  
  362.                     D:\QBBS\MSG\0004.HDR
  363.                     D:\QBBS\MSG\0004.MSG
  364.  
  365.           The header file '.HDR' is described above. It contains two
  366.           fields which relate to the message text file '.MSG':
  367.  
  368.              - Offset in .MSG   points to the first byte of the message
  369.                                 in the .MSG file
  370.              - Size in .MSG     is the size in bytes of the message.
  371.  
  372.         - The field 'Message is a reply to' contains the message number
  373.           to which the message is a reply. This is NOT supported in
  374.           Echomail or Netmail, unless the reply was entered locally.
  375.  
  376.         - Basically: if you don't know FOR SURE what you're doing, don't
  377.           touch the message files!!!
  378.  
  379.  
  380.  
  381. *****************************
  382. ** 6 **  The 'Door' files  ** 
  383. *****************************
  384.  
  385. The file LASTUSER.LOG is a plain ASCII file which contains the following
  386. lines:
  387.  
  388.         - The users name
  389.         - The users security level
  390.         - A plain zero (0, used on the PC for port number?)
  391.         - Minutes left
  392.  
  393. Example:
  394.  
  395.         Alexis Carrington.Colby.Dexter
  396.         10
  397.         0
  398.         47
  399.  
  400. Another file can be written, called DORINFO1.DEF. This is also an ASCII
  401. file, containing:
  402.  
  403.         - The sysops first name
  404.         - The sysops last name
  405.         - The baudrate ( 0 = Local )
  406.         - The users first name
  407.         - The users last name
  408.         - Where the guy lives
  409.         - His graphics mode
  410.         - The length of his screen
  411.         - His security level
  412.         - Number of minutes left
  413.         - His record number in the USERS.BBS file
  414.  
  415. Example:
  416.  
  417.         J.R.
  418.         Ewing
  419.         1200
  420.         Alexis
  421.         Carrington.Colby.Dexter
  422.         Denver
  423.         1
  424.         24
  425.         10
  426.         47
  427.         56
  428.  
  429. For the structure of the FOREM.DAT file, please refer to the FoReM
  430. documentation. Some information is required in FOREM.DAT, but is not
  431. available to QuickBBS. They are filled in with 'standard' values, which
  432. are enclosed in brackets. The fields supported by QuickBBS ST are:
  433.  
  434.         Password
  435.         Name
  436.         Phone number
  437.         Age                     (25)
  438.         Line feeds              (ON)
  439.         Computer type           (1)
  440.         Time left today
  441.         Max calls               (2)
  442.         Calls remaining         (1)
  443.         Time left this call
  444.         City
  445.  
  446. ************************
  447. ** 7 **  Other files  **
  448. ************************
  449.  
  450. The file TIMELOG.BBS has a somewhat different structure. The first 8 bytes
  451. contain the date in ASCII when the file was created. Then there are 24
  452. records (one for each hour, 3 bytes each) which contain the percentage of
  453. BBS usage in the first byte, and the number of 'entries' (calls in that
  454. hour) in the second and third byte :
  455.  
  456.         Percentage ........... 1 ....... Byte
  457.         Entries .............. 2 ....... Word
  458.  
  459. QuickBBS ST writes a file called 'EXITINFO.BBS' when exit-with-errorlevel
  460. is used:
  461.  
  462.         Baudrate ............. 2 ....... Word
  463.         User number .......... 2 ....... Word
  464.         Security level ....... 2 ....... Word
  465.         Echomail entered? .... 1 ....... Byte
  466.         Netmail entered? ..... 1 ....... Byte
  467.         Mode of operation .... 1 ....... Byte
  468.         Time of exit ......... 5 ....... HH:MM
  469.  
  470. Here again the time is written as a 5-byte string, no termination. The
  471. 'mode of operation' is there for possible future multitasking
  472. environments:
  473.  
  474.         Bit 0 On? - I/O to Modem
  475.         Bit 1 On? - I/O to Screen
  476.  
  477. this enables the screen to be switched off under - say - the Beckemayer
  478. multi-tasking shell. I haven't been able to get my hands on anything like
  479. this (exept MX2, and GfA doesn't like it!), so I can't implement any
  480. support yet. If anyone knows where to get a copy...
  481.  
  482. Last file is the SYSINFO.BBS file, written each time QuickBBS exits:
  483.  
  484.         Call count ..........   4 ....... Long
  485.         Last User ...........  36 ....... Pas[36]
  486.         - Reserved - ........ 128 ....... -
  487.  
  488. ******************************
  489. ** X **  That's All Folks!  **
  490. ******************************
  491.  
  492.