home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / ROBODOC.ZIP / ROBOTECH.DOC
Encoding:
Text File  |  1993-01-20  |  20.1 KB  |  479 lines

  1. {  
  2. ──────────────────────────────────────────────────────────────────────────
  3.  ROBO-BOARD DATA FILE STRUCTURES - BY SETH HAMILTON           JAN 20, 1992
  4. ──────────────────────────────────────────────────────────────────────────
  5.  
  6.   Robo-Board 1.08 was  written in TURBO PASCAL 6.0,  therefor all of the
  7.   following header formats are in PASCAL format. A bit of information to
  8.   help 'C' or BASIC programmers is offered at the end of this text. 
  9.  
  10.   This code was written by  Seth Hamilton but is free for use by all who
  11.   wish to use  it for  the purpose  of creating  Robo-Board Utilities or
  12.   doors.
  13.  
  14.   Note: Hudson message base headers are not included in this text.  Most
  15.     Hudson information was aquired by myself through the  use of  my
  16.     HEX  editor and  the Front Door message editor.  Additional info
  17.     was  uploaded to me  by my users when  I displayed interest in a
  18.     new message  base format.  If I can  contact Mr. Hudson  and get
  19.     permission to use his file formats in this text, I will do so.
  20.  
  21. ──────────────────────────────────────────────────────────────────────────
  22.  
  23. }
  24.  
  25.  
  26. }
  27. ──────────────────────────────────────────────────────────────────────────
  28.  ROBOCFG RECORD
  29. ──────────────────────────────────────────────────────────────────────────
  30.  
  31.  This record type is used by ROBOCFG.EXE, the file ROBOBBS.CFG contains
  32.  one record made up the information below.
  33. }
  34. Type
  35.    RBOCFG = RECORD
  36.     CFG_BBSPATH      : string[45];  
  37.        {Path To the Robo-Board Bbs files}           
  38.     CFG_MSGPATH      : string[45];  
  39.        {Path to the Hudson message base files and LASTREAD.BBS}
  40.     CFG_PRTPATH      : string[45];
  41.        {Path to external protocols used by Robo-Board for terminal transfer}
  42.     CFG_GRFPATH      : string[45];
  43.        {Path to the grpahics and menu files used by Robo-Board}
  44.  
  45. {The following few records are in array format. Each record in an array
  46.  represents a node number}
  47.     CFG_BAUD         : array[1..9] of WORD;       {Modem MAX baud rate}
  48.     CFG_COM          : array[1..9] of BYTE;       {Modem Com port}
  49.     CFG_INIT         : array[1..9] of STRING[60]; {Modem configuration string}
  50.     CFG_ANSWER       : array[1..9] of STRING[10]; {Modem answer string}
  51.     Cfg_busy         : array[1..9] of String[10]; {String to make modem busy}
  52.     CFG_LOCKAT       : array[1..9] of WORD;       {Modem baud locked at}
  53.     CFG_allow1200    : array[1..9] of boolean;    {Allow 1200 toggle}
  54.     CFG_allow2400    : array[1..9] of boolean;    {Allow 2400 toggle}
  55.     CFG_ModemBreak   : array[1..9] of boolean;    {Send break to clear}
  56.     CFG_Busylocal    : boolean;                   {modem busy on local logon}
  57.     CFG_EVENT1       : shortint;                  {1 byte int for event hour}
  58.     CFG_EVENT2       : shortint;                  {1 byte int for event hour}
  59.     CFG_EVENT3       : shortint;                  {1 byte int for event hour}
  60.     CFG_EVENT4       : shortint;                  {1 byte int for event hour}
  61.     CFG_SYSOPNAME    : STRING[40];                {Sysops name}
  62.     CFG_BBSNAME      : STRING[40];                {Bbs's name}
  63.     CFG_NEWACCESS    : byte;                      {new user access/call back}
  64.     CFG_DEFAULTTIME  : WORD;                      {if access.def found}
  65.     CFG_NOTEMESSAGE  : STRING;                    {Displayed by SysOp}
  66.     CFG_RATIOUP      : BYTE;                      {if access.def found}
  67.     CFG_RATIODOWN    : BYTE;                      {if access.def found}
  68.     CFG_UPCREDIT     : STRING[5];                 {if access.def found}
  69.     CFG_TIMEOUT      : WORD;                      {Keyboard Timeout (seconds)}
  70.     CFG_PAGEFROM     : BYTE;                      {Page from hour (24hrs)}
  71.     CFG_PAGETO       : BYTE;                      {Page to hour (24hrs)}
  72.     CFG_DLSTARTTIME  : byte;                      {DL start hour (24hrs)}
  73.     CFG_DLENDTIME    : byte;                      {DL end hour (24hrs)}
  74.     CFG_ULSTARTTIME  : byte;                      {UL start hour (24hrs)}
  75.     CFG_ULENDTIME    : byte;                      {UL end hour (24hrs)}
  76.     CFG_MINSPEED     : word;                      {min baud for file transfers}
  77.     CFG_MINSPEEDEGA  : word;                      { RESERVED }
  78.     CFG_MINSPEEDMONO : word;                      { RESERVED }
  79.     CFG_MINSPEEDANSI : word;                      { RESERVED }
  80.     CFG_SCANBATCH    : string[12];                {Virus scan batch name}
  81.     CFG_SCANEGA      : boolean;                   {T=EGA F=ANSI on users end}
  82.     RESERVED1,
  83.     RESERVED2        : byte;                      { RESERVED }
  84.     CFG_Echomailfile : boolean;                   {make scan file}
  85.     CFG_Showoffline  : boolean;                   {Show offline files}
  86.     CFG_HDlimit      : longint;                   {Min HD space for uploads}
  87.     CFG_PHONEPLATE   : STRING[15];                {phone number template}
  88.     CFG_EGAVGAMINACC : BYTE;                      { RESERVED }
  89.     CFG_Pagecomment  : byte;                      {Comment message base}
  90.     CFG_Maxpages     : byte;                      {maxpages a user can make}
  91.     CFG_newmailcheck : boolean;                   {New mail check at logon}
  92.     CFG_REGISTERED   : STRING[50];                {Registration code}
  93.     CFG_SOUNDLEVEL   : Byte;                      {Ask of birthdate}
  94.     RESERVED3        : boolean;                   {Ask for handle}
  95.     RESERVED4        : boolean;                   {Ask home phone}
  96.     CFG_TimeBANKmax  : word;                      {time bank max (9999)}
  97.     CFG_Termname     : string[12];                {current terminal name}
  98.  
  99. {CFG MULTI NODE}
  100.     CFG_numofnodes   : byte;                      {9 max}
  101.  
  102. {CALL BACK VERIFY}
  103. {+} CFG_usecallback  : boolean;                   {Is call back active}
  104. {+} CFG_CALLACCESS   : BYTE;                      {access after call back}
  105. {+} CFG_AREACODE     : array [1..3] of string[3]; {3 area codes for call back}
  106. {+} CFG_CALLEXPACC   : byte;                      {access when user expires}
  107. {+} CFG_CALLEXPIRY   : word;                      {user expiry in Days}
  108. {+} CFG_CALLBACKDIAL : STRING[10];                {dial codes for modem}
  109. {+} CFG_verifyflags  : ARRAY[1..8] of boolean;    {flags after verify}
  110.  
  111. {STATS}
  112.     CFG_EVENT1_DONE,                              {is event 1 done}
  113.     CFG_EVENT2_DONE,                              {is event 2 done}
  114.     CFG_EVENT3_DONE,                              {is event 3 done}
  115.     CFG_EVENT4_DONE  : Boolean;                   {is event 4 done}
  116.     CFG_CALLSTODAY   : WORD;                      {number of calls today}
  117.     CFG_CALLSTOTAL   : WORD;                      {number of calls total}
  118.     CFG_LASTCALLER   : STRING[25];                {name of last caller}
  119.     CFG_BOGUSDAY     : byte;                      {Day of month - for events}
  120.     RESERVED5        : STRING[14];                { RESERVED }
  121.     CFG_OriginLine   : String[60];                {default message origin}
  122.  
  123. {MAIL}
  124.     CFG_Addresses    : Array[1..10] of string[15];
  125.     CFG_EXPANSION    : ARRAY[1..1024] of byte;    { RESEVED FOR EXPANSION }
  126.    end;
  127.  
  128. {
  129. ──────────────────────────────────────────────────────────────────────────
  130.  FILE AND MESSAGE BASES
  131. ──────────────────────────────────────────────────────────────────────────
  132.  
  133.  The following two record types are used in the files MSGAREA.DEF and
  134.  FILEAREA.DEF. Robo-Board supports 200 message and file areas. But in
  135.  actuality 201 records exist in each file. This is because Robo-Board
  136.  reserves the first record in each file for future header information
  137.  or just incase I need it. So don't write in it.  I  will tell you if
  138.  I ever do use it.
  139. }
  140.  
  141. MBaserecord  = record
  142.      Name           : String[40];
  143.      Attribute      : Byte;
  144.  
  145.       {LOCAL PRI/PUB  = 0    I will likely change the
  146.        LOCAL PUBLIC   = 1    way this works.
  147.        ECHO MAIL      = 2
  148.        LOCAL HANDLES  = 3
  149.        ECHO HANDLES   = 4}
  150.  
  151.      MaxMessages    : Word; {Max messages, used by ROBOUTIL}
  152.      ReadSecurity   : Word;
  153.      WriteSecurity  : Word;
  154.      RACCESSTYPE    : byte; { 1 is >=   2 is <=   3 is = }
  155.      WACCESSTYPE    : byte; { 1 is >=   2 is <=   3 is = }
  156.      SysopAccess    : Word; {assumed 255, never used}
  157.      OriginLine     : String[60];
  158.      MenuOnly       : String[12];
  159.      NETADDRESS     : string[15];
  160.      msgflags       : array[1..8] of boolean;
  161.      Freespace      : array[1..110] of byte;
  162.    end;
  163.  
  164. FBaserecord  = record
  165.      Name           : String[40];
  166.      Reserved1      : Byte; { RESERVED}
  167.      CDROMFILENUM   : Byte;
  168.      KILLOLDERTHAN  : Byte; {Will be used by ROBOUTIL}
  169.      ACCESSTYPE     : byte; { 1 is >=   2 is <=   3 is = }
  170.      Security       : Word; {Max 255, future in mind}
  171.      SysopSecurity  : Word; {assumed 255, never used}
  172.      Path           : String[60];
  173.      MenuOnly       : String[12];
  174.      fileflags      : array[1..8] of boolean;
  175.      expansion      : array[1..120] of byte;
  176.    end;
  177. {
  178. ──────────────────────────────────────────────────────────────────────────
  179.  NODE INFO
  180. ──────────────────────────────────────────────────────────────────────────
  181.  
  182.  This file contains 9 records . At the moment, ROBO-BOARDS chat follows a 
  183.  see it as you type it style profile, but, this file could be used easily 
  184.  (because of its 80 byte text buffer) for typical one line at a time chat. 
  185.  If  and  when  I ever support  the  line by line chat,  ROBO-BOARD could 
  186.  support from 50-100 or perhaps more lines of chat.
  187.  
  188.  This file is NOT locked, (don't lock it) I have not found any reason for
  189.  it to be locked, nothing is removed from it, nothing is inserted into it,
  190.  and  it is not moved while robo-board is running. Simply, 9 are read and 
  191.  one is updated by each node.
  192.  
  193. }
  194.   NINFOrecord  = record
  195.              NODE_UserPtr   : word; {Offset in user files to userrec}
  196.              NODE_Activity  : byte; 
  197.    {
  198.     NODE_ACTIVITY
  199.       0 : chat_temp := 'Idle';
  200.       1 : chat_temp := 'Logging On';
  201.       2 : chat_temp := 'Uploading File';
  202.       3 : chat_temp := 'Downloading File(s)';
  203.       4 : chat_temp := 'Entering Messages';
  204.       5 : chat_temp := 'Reading Messages';
  205.       6 : chat_temp := 'Scanning New Files';
  206.       7 : chat_temp := 'Listing Files';
  207.       8 : chat_temp := 'Viewing Files';
  208.       9 : chat_temp := 'Reading Text File';
  209.      10 : chat_temp := 'Viewing Graphics File';
  210.      11 : chat_temp := 'Downloading File(s)!';
  211.      12 : chat_temp := 'Settings Menu';
  212.      13 : chat_temp := 'Call Back Verify';
  213.      14 : chat_temp := 'Hangin Up';
  214.      15 : chat_temp := 'Nodel Chat (DIFFERENT FORUM)';
  215.      16 : chat_temp := 'Paging SysOp';
  216.      17 : chat_temp := 'Dos Program (ANSI/ASCII)';
  217.      18 : chat_temp := 'Dos Program (EGA/VGA)';
  218.      19 : chat_temp := 'Node Chat';
  219.      20 : chat_temp := 'Scanning New Mail';
  220.      21 : chat_temp := 'At Menu';
  221.      22 : chat_temp := 'Using Time Bank';
  222.    }
  223.              NODE_UserText  : Array [1..80] of Char; {Chat text}
  224.              NODE_TxtPtr    : byte;                  {Offset in text}
  225.              NODE_Forum     : byte;                  { RESERVED }
  226.              NODE_Paged     : byte;                  {node num paged by}
  227.              Expansion      : Array [1..16] Of Byte;
  228.            end;
  229.  
  230. {
  231. ──────────────────────────────────────────────────────────────────────────
  232.  THE USER FILES
  233. ──────────────────────────────────────────────────────────────────────────
  234.  
  235.  The record UD1 contains just the users name for fast access while searching
  236.  the user base at logon. If you have 400 users this method is appreciated.
  237.  
  238.  UD2 contains the rest of the user information. The records in ROBOUSR1.DAT,
  239.  ROBUSER2.DAT and LASTREAD.BBS all share the same record number. So if 
  240.  removing a user from one file it is important to do so to the other files.
  241.  The same goes for inserting or re-ordering the user base. The Hudson
  242.  LASTREAD.BBS file also corresponds record wise with these files.
  243.  
  244.  NOTE: The first records in the files are left empty (or rather garbled),
  245.        these records cannot be seen with ROBOUSER. Mainly, all garbage
  246.        caused by users dropping carrier before logon and stuff like that
  247.        is placed in these records.
  248. }
  249.  
  250.   UD1            = RECORD
  251.              NAME      : STRING[36];
  252.              HANDLE    : STRING[36];
  253.            END;
  254.  
  255.   UD2            = RECORD
  256.              PASS      : STRING[36];
  257.              PHONE1    : STRING[15]; {home}
  258.              PHONE2    : STRING[15]; {data}
  259.              CITY      : STRING[15];
  260.              LYEAR     : word;       {Last year called}
  261.              LMONTH    : word;       {Last month called}
  262.              LDAY      : word;       {Last day called}
  263.              LHOUR     : byte;       {Last hour called}
  264.              CALLS     : word;
  265.              TIMEL     : longint;    {Time left in minutes}
  266.              access    : BYTE;
  267.              BANK      : word;       {minutes in bank}
  268.              BIRTHDATE : STRING[8];  {MM/DD/YY}
  269.              UPLOADS,
  270.              DOWNLOADS : word;
  271.              Lastscan  : word;       {last scanned: kept but not used}
  272.              basestat  : Array[1..200] of boolean; {toggle status of
  273.                                 message bases}
  274.              userflags : Array[1..8] of boolean;
  275.              expiry    : longint;    {expiry in YYMMDD}
  276.              exp_access: byte;       {access after expiry}
  277.     {attributes}
  278.              non_delete: boolean;    
  279.              over_ride : boolean;
  280.              read_all  : boolean;
  281.              read_kill : boolean;
  282.              no_expire : boolean;
  283.              no_ratio  : boolean;
  284.              no_page   : boolean;
  285.              no_tlimit : boolean;
  286.              speedtime : boolean;
  287.              usersound : boolean;
  288.              mailcheck : boolean;
  289.              Street    : STRING[26];
  290.              Postalcode: STRING[9];
  291.              expansion : array[1..194] of byte;
  292.  
  293.        END;
  294.  
  295.    LastReadRec = array[1..200] of Word; {Used by Hudson for the last read}
  296.                     {pointers of the 200 message bases} 
  297.  
  298. {
  299. ──────────────────────────────────────────────────────────────────────────
  300.  DRAWING RECORDS
  301. ──────────────────────────────────────────────────────────────────────────
  302.  
  303.  The following is the Drawing record format found in .RBO files. 
  304.  There may be as many of these records as are needed within a file.
  305.  _Command may be one of the following:
  306.  
  307.  (assuming with)
  308. CASE _COMMAND OF
  309.   1,2 : line;                   From X1,Y1 to X2,Y2
  310.   3 : rectangle;                From X1,Y1 to X2,Y2
  311.   4 : fill_rectangle;           From X1,Y1 to X2,Y2
  312.   5 : ellipse;                  Center=X1,Y1  radius= X2,Y2
  313.   6 : fill_ellipse;             Center=X1,Y1  radius= X2,Y2
  314.   7 : BEGIN
  315.     case X2 of              X2 = font number in this case 
  316.       1 : setfont_font09;
  317.       2 : setfont_FONT14;
  318.       3 : setfont_COUNTDWN;
  319.       4 : setfont_FUTURE;
  320.       5 : setfont_FONTPC9;
  321.       6 : setfont_BROADWAY;
  322.      end;
  323.     text_write;
  324.        END;
  325.    8 : BEGIN
  326.     fstr := _iconfile;      icon library file name 
  327.     loadsprite;             loadsprite will not load if already loaded
  328.     sprite := x2;           sprite or icon index = X2 variable
  329.     showsprite;
  330.        END;
  331.    9 : r_paint;              fill at X1,Y1 in FC (forground colour) 
  332.                  to BC (border colour) 
  333.   10 : ;                     * RESERVED *
  334.   11,12 : Button;            draw button, offset controls white, gray etc
  335.   13 : Plain_window;         Draw window to fit X1,Y1,X2,Y2 with
  336.                  FC (forground colour) interior and
  337.                  BC (border colour) border
  338.                  Corner sprites defaulted to ROBO1_02.LIB's
  339.                  "!" icon.
  340.   15 : r_arc;     90 degree arcs. X1,Y1 is center of ellipse section
  341.           X2 and Y2 are radius
  342.   20 : cleargrph  This clears the screen, used by ROBODRAW when asking if
  343.           you want to clear the screen. On load by ROBODRAW this
  344.           record is skipped and must be added (to record #0) at save.
  345.  
  346.   Here is a hint on calculating box arcs....
  347.  
  348. ──────────────────────────────────
  349.   tII := abs(x1-x2); tIII := abs(y1-y2);
  350.  
  351.   if (x1 - x2 < 0) and (y1 - y2 > 0) then
  352.     begin
  353.      angle1 := 0;
  354.      angle2 := 90;
  355.     end;
  356.   if (x1 - x2 > 0) and (y1 - y2 < 0) then
  357.     begin
  358.      angle1 := 180;
  359.      angle2 := 270;
  360.     end;
  361.   if (x1 - x2 < 0) and (y1 - y2 < 0) then
  362.     begin
  363.      angle1 := 270;
  364.      angle2 := 360;
  365.     end;
  366.   if (x1 - x2 > 0) and (y1 - y2 > 0) then
  367.     begin
  368.      angle1 := 90;
  369.      angle2 := 180;
  370.     end;
  371.   Ellipse(X1, Y1, Angle1, Angle2, tii , tiii );
  372. ──────────────────────────────────
  373.  
  374.  end;
  375.  
  376.  NOTE: ROBO-BOARD  technical information can be requested for a full RBO100
  377.        Graphical Telecommunications Protocol breakdown. Also Source code in
  378.        TURBO PASCAL 6.0  can  be requested for  a RBO100  toolkit. Refer to
  379.        the  section  in  the  Robo-Board manual  titled  SUPPORT  for  more
  380.        information about requesting information or toolkits. 
  381.  
  382. }
  383.  
  384.  dr = record
  385.  
  386.    _x1, _y1, _x2, _y2  : integer;
  387.    _fc, _bc, _stroff,
  388.    _command, _offset   : byte;
  389.    _iconfile           : string[12];
  390.    _Flags              : array[1..8] of boolean; { Not used, to dangerous }
  391.    _Access             : byte;
  392.    _SecType            : byte; { 1 is >=   2 is <=   3 is = }
  393.   end;
  394.  
  395. {
  396. ──────────────────────────────────────────────────────────────────────────
  397.  MENU COMMANDS
  398. ──────────────────────────────────────────────────────────────────────────
  399.  
  400.  There may be a maximum of 50 records like the one listed below in a
  401.  .MNU file. For a .MNU file to be used in ROBO-BOARD a .RBO file with
  402.  the same name prefix must exist in the directory. ROBO-BOARD expects
  403.  (rather it needs) this file to be 50 records big, Robo-Board BLOCKREADs
  404.  this file into a large array.
  405.  
  406.  The first record in this file is reserved for future header information.
  407.  Therefor start reading at record 1, not record 0.
  408. }
  409.  mr = record
  410.   {Convenient 128 byte record }
  411.    m_x1, m_y1, m_x2, m_y2  : integer;               {Hot Spot rectangle Coords}
  412.    m_command               : byte;                  {Command number}
  413.    m_key                   : char;                  {Hot key for hot spot}
  414.    m_textdata1             : string[35];            {Used for command data}
  415.    m_textdata2             : string[35];            {Used for command data}
  416.    m_commandtogs           : array[1..10] of word;  {NOT USED YET, MAYBE L8R}
  417.    m_Flags                 : array[1..8] of boolean;
  418.    m_Access                : byte;
  419.    m_SecType               : byte;                  { 1 is >=   2 is <=   3 is = }
  420.    m_freespace             : array[1..16] of byte;  {Expansion}
  421.   end;
  422.  
  423.  
  424. {
  425. ──────────────────────────────────────────────────────────────────────────
  426.  ICON RECORDS
  427. ──────────────────────────────────────────────────────────────────────────
  428.  
  429.  Icon records are split into 900 byte segments. Each byte represents
  430.  a pixel on a 30x30 grid. Because the icon record approaches the 65k
  431.  mark, it is often required that this be a pointer type variable. An
  432.  icon can be displayed easily (BUT SLOWLY) with a simple routine like:
  433.  
  434.       for I := 1 to 30 do
  435.     for II := 1 to 30 do
  436.      if p^.pic1[sprite,((I-1)*30)+II ] <> 16 then
  437.         putpixel(X + I, 
  438.              Y + II, 
  439.              p^.spriterec[ sprite, ((I-1)*30)+II ] );
  440.  
  441.  NOTE: Colour 16 is transparent, so just skip by a colour 16 if one
  442.        is found. Colours range from 0-15 normally. Also note that the 1st
  443.        record (index 0) is reserved for future header information.
  444.  
  445.  When reading in icon files, you can do so by reading them with a BLOCKREAD
  446.  this is a LOT faster than reading them in record by record or byte by byte.
  447.  Icon files start at record 1, record 0 is 900 bytes big, but has been
  448.  reserved for future header information.
  449. }
  450.  
  451. record_t = RECORD
  452.        spriterec : array [1..65, 1..900] of byte;
  453.       END;
  454.  
  455. {
  456.  NOTE: For those of you who wish  to write utilities in 'C' or BASIC and 
  457.        don't have a solid understanding of the pascal string format here 
  458.        it is simply.
  459.  
  460.        Where ever it  says  STRING[nn] the  actual size  of  that entity
  461.        is nn + 1. A Pascal  string is  not null terminated,  it contains
  462.        a length in its first byte. So a  STRING[5]  looks like this:
  463.  
  464.         #ccccc   WHERE: c=character #=length of text in string.
  465.  
  466.         eg: 04h+'TEST'+01h+50h+E1h...(more random chars)
  467.  
  468.        The characters after the length  of the  text  inside  the string 
  469.        entity are  unpredictable. Pascal  does not  clean  its memory at
  470.        load  time such as basic would  leaving its variables filled with
  471.        random garbage. With out any way to signify an end of string, you
  472.        will probably be forced to write a string handler so you may both 
  473.        read and write in the Pascal format.
  474. }
  475.       
  476.  
  477.  
  478. end.
  479.