home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / vrac / sap408_a.zip / EXTERN.DOC < prev    next >
Text File  |  1994-01-01  |  16KB  |  346 lines

  1.  
  2.    ===========================================================================
  3.    ===                                                                     ===
  4.    ===                          DOORS AND EVENTS                           ===
  5.    ===                                                                     ===
  6.    ===========================================================================
  7.  
  8.  
  9.    The information presented in this chapter is addressed to experienced
  10.    sysops.  If you are new to the joys of sysoping, it would probably be best
  11.    to avoid the DOORS and EVENTS commands until you are more familiar with
  12.    your new BBS.
  13.  
  14.    Sapphire will function perfectly well without DOORS and EVENTS installed,
  15.    so you can safely skip this chapter and come back to it later.
  16.  
  17.    This chapter gives a good overview of doors and events.  A detailed
  18.    explanation of door processing is available in the HOWDOOR tutorial, which
  19.    is shipped with registered copies of Sapphire.  You can also obtain HOWDOOR
  20.    by calling our support BBS at 514-345-8654.
  21.  
  22.    
  23.  
  24.                                    -----------
  25.                                    DEFINITIONS
  26.                                    -----------
  27.  
  28.    Doors and events are both instances where the Sapphire program ends and
  29.    control is returned back to DOS.  In the case of a door, the shut-down is
  30.    initiated by a user; for events, the shut-down happens automatically, ac-
  31.    cording to a schedule you set up.
  32.  
  33.  
  34.  
  35.                         ---------------------------------
  36.                         APPLICATIONS FOR EVENT PROCESSING
  37.                         ---------------------------------
  38.  
  39.    Consider the following batch file.  (Note that the <-- arrow and following
  40.    text are comments, not part of the batch file.)
  41.  
  42.    REM Batch File Autoback            <-- A batch file comment (REMark)
  43.    :START                             <-- A batch file label
  44.    SRUN                               <-- The main Sapphire program
  45.    COPY SAPPHIRE.USR A:SAPPHIRE.SAV   <-- Copy the user list
  46.    GOTO START                         <-- Start over again
  47.  
  48.    If you could arrange to have the BBS come down every night at 3:00, it
  49.    could make a spare copy of the user list on the A: drive.  This would be
  50.    very useful, although of course you would have to make sure that the A:
  51.    drive always had a floppy inserted and ready to go!
  52.  
  53.    Set up in this way, you could leave town for a long weekend, confident that
  54.    the user list was being backed up every day.
  55.  
  56.    NOTE:  The example actually contains some inaccuracies.  In an actual event
  57.    batch file, only the COPY line would be necessary; the rest of the batch
  58.    file would be "understood" by Sapphire.  See "How EXTERNAL.BAT Works" for
  59.    details.)
  60.  
  61.    Another possible application is automatic dial-out via your favourite
  62.    communications program (to pick up mail, perhaps).  Of course, you would
  63.    have to write a "script" (i.e. a program that your communications program
  64.    understands) in order to have it dial out, sign on, pick up the mail,
  65.    then return to DOS.
  66.  
  67.    One very common use for event processing is to support network systems such
  68.    as Fido -- a very complicated topic beyond the scope of this manual.
  69.  
  70.  
  71.  
  72.                         ---------------------------------
  73.                         APPLICATIONS FOR DOORS PROCESSING
  74.                         ---------------------------------
  75.  
  76.    A door is an external program that a user can run from Sapphire.  A door
  77.    program is designed to handle its own modem communications -- Sapphire is
  78.    not running when the door program is in operation.
  79.  
  80.       IMPORTANT:  A door is NOT an ordinary DOS program.  DOS programs
  81.       are NOT designed to be run as doors.  You can use certain shareware
  82.       utilities to make SOME DOS programs work as doors, but most do not.
  83.  
  84.    There are dozens of door programs available.  One example is the Pyroto
  85.    Mountain gaming system, which (like Sapphire) was written by Pinnacle
  86.    Software.  You can call it as a door, giving your members a chance to play
  87.    this intriguing game of magic and politics.  We also publish the Free
  88.    Speech "open forum" system, which can be run as a door.
  89.  
  90.    Before making a door available to your members, you should review it care-
  91.    fully.  The quality of door software varies greatly; some may crash,
  92.    thereby failing to return to DOS and consequently taking your BBS "off the
  93.    air".
  94.  
  95.    In order to run most doors (i.e. those not created by Pinnacle Software),
  96.    you will require a door-data conversion program such as DoorMaster or
  97.    DoorWay or a specific converter program such as SP2QBBS.  The latest
  98.    version of these converters can usually be obtained from our support BBS,
  99.    or your local or national BBS, or from a telecomputing service such as
  100.    GEnie or CompuServe.  If you call our BBS, check the files list for special
  101.    tutorials on door techniques.
  102.  
  103.  
  104.  
  105.                              -----------------------
  106.                              CODING YOUR BATCH FILES
  107.                              -----------------------
  108.  
  109.    In an environment using doors and events or both, everything is tied
  110.    together with batch (.BAT) files.  (For detailed information about batch
  111.    files, consult your DOS reference manual.)
  112.  
  113.    The simplest kind of batch file was illustrated in the "automatic user list
  114.    back-up" example shown earlier.  This was a just a loop, executing one
  115.    function.  One problem, though ... you'll note that there was no way to get
  116.    out of the loop!  So it was not a particularly useful program.
  117.  
  118.    If you want to call Sapphire from any directory, put a batch file like the
  119.    following one (which you could call S.BAT) in one of the directories in
  120.    your PATH:
  121.  
  122.    ECHO OFF                      <-- Stop display of batch lines
  123.    C:                            <-- Change to the right drive
  124.    CD \SAPPHIRE                  <-- Change to your Sapphire directory
  125.    SAPPHIRE %1 %2                <-- Jump to batch file SAPPHIRE.BAT
  126.  
  127.    SAPPHIRE.BAT is a batch file that comes with Sapphire.  It looks like this:
  128.  
  129.    ECHO OFF                      <-- Stop display of batch lines
  130.    SAPPHIRE %1 %2                <-- Start up Sapphire
  131.    EXTERNAL                      <-- Jump to batch file EXTERNAL.BAT
  132.  
  133.    This batch file must be in the directory where SRUN.EXE resides.
  134.  
  135.    The %1 and %2 after the SAPPHIRE allows you to pass parameters to Sapphire,
  136.    so you can start up the batch file with  SAPPHIRE LOCAL  to run without a
  137.    modem.  (This is how the SYSOP batch file does it.)
  138.  
  139.  
  140.  
  141.                               ----------------------
  142.                               HOW EXTERNAL.BAT WORKS
  143.                               ----------------------
  144.  
  145.    Don't look for a file named EXTERNAL.BAT in the Sapphire package -- there
  146.    isn't one.  EXTERNAL.BAT is created whenever Sapphire ends.
  147.  
  148.    If Sapphire is shutting down because you are closing it (using the CLOSE
  149.    command, for example), EXTERNAL.BAT will be empty.  As a result, you'll
  150.    drop straight through to the DOS prompt.
  151.  
  152.    For a doors or an event, however, Sapphire copies the associated batch file
  153.    into EXTERNAL.BAT.  So whatever was in the associated batch file will get
  154.    executed.
  155.  
  156.    But how does this get us back to Sapphire?
  157.  
  158.    After Sapphire copies the other batch file into EXTERNAL.BAT, it appends
  159.    some additional instructions, as in this example:
  160.  
  161.    C:                  <-- Switch to Sapphire's "home" drive
  162.    CD \SAPPHIRE        <-- Switch to Sapphire's "home" directory
  163.    SAPPHIRE            <-- Jump to the SAPPHIRE.BAT batch file
  164.  
  165.    And thus, the circle is completed.  Of course, the extra instructions may
  166.    vary, depending on where your copy of SRUN.EXE resides and the way you
  167.    started up Sapphire.
  168.  
  169.  
  170.  
  171.                                  ---------------
  172.                                  BATCH TEMPLATES
  173.                                  ---------------
  174.  
  175.    You will use the DOORS and EVENTS commands to specify which batch files
  176.    will be copied to EXTERNAL.BAT.  We will call these files "Batch Tem-
  177.    plates", because although they end in .BAT, they are never actually run
  178.    directly; they are copied to EXTERNAL.BAT, as explained previously.
  179.  
  180.    You can write the templates without regard to what happens after the
  181.    program ends, because that's taken care of when Sapphire copies them to
  182.    EXTERNAL.BAT.
  183.  
  184.    NOTE:  A template must not call another batch file, unless that batch file
  185.    contains the code to get back to SAPPHIRE.BAT.  You can, however, use the
  186.    batch file command "CALL", which is explained in your DOS reference manual.
  187.  
  188.    Sapphire's method of handling batch files as templates makes for very
  189.    simple batch files for doors and events.  For example, to call up the
  190.    PYROTO door, you could write a template file named PYROTO.BAT, which
  191.    contains only three lines:
  192.  
  193.    C:                  <-- Make sure you are on the right drive
  194.    CD \PYROTO          <-- Change to the Pyroto directory
  195.    PYROTO              <-- Start up the program
  196.  
  197.  
  198.  
  199.                          -------------------------------
  200.                          WRITING DOOR AND EVENT PROGRAMS
  201.                          -------------------------------
  202.  
  203.    When Sapphire calls a door or event, it creates a file in the root
  204.    directory, named SAPPHIRE.DAT.  This file contains important information
  205.    for doors and events.  If you plan to write door or event programs, you'll
  206.    need access to this data.
  207.  
  208.    Turbo Pascal source code describing the layout of the file is available in
  209.    the file named SDOOR.INC, included in the SAPPHC (optional material) file
  210.    set.
  211.  
  212.  
  213.  
  214.    ===========================================================================
  215.    ===                                                                     ===
  216.    ===                            FILE TRANSFER                            ===
  217.    ===                                                                     ===
  218.    ===========================================================================
  219.  
  220.  
  221.                               ----------------------
  222.                               WHAT IS FILE TRANSFER?
  223.                               ----------------------
  224.  
  225.    With Sapphire's file-transfer feature installed (see SYSOP:DSZ), you will
  226.    be able to exchange software with people who dial into your system, using
  227.    the popular Xmodem, Ymodem and Zmodem protocols.
  228.  
  229.    Sapphire maintains a list of up to 500 programs (providing there is enough
  230.    space on your hard disk), along with statistics and documentation.
  231.  
  232.    The file-transfer feature requires a system equipped with a hard-disk with
  233.    a minimum of 1 Megabyte free space.
  234.  
  235.  
  236.  
  237.                              ------------------------
  238.                              INSTALLING FILE TRANSFER
  239.                              ------------------------
  240.  
  241.    In order to enable file-transfer (Xmodem, Ymodem and Zmodem), you must
  242.    install the DSZ file-transfer program, which is included in the Sapphire
  243.    package with the permission of its author, Chuck Forsberg.
  244.  
  245.    You can install DSZ via SYSOP:DSZ (i.e. select the DSZ option on the main
  246.    menu of the SYSOP utility).  This will enable the GET, GIVE, PROTOCOL and
  247.    FILES commands.
  248.  
  249.  
  250.  
  251.                              -----------------------
  252.                              ADDING SOFTWARE LOCALLY
  253.                              -----------------------
  254.  
  255.    To add a file to the software collection while you are at the console, you
  256.    must first place the file in the files directory (which is usually named
  257.    C:\SAPPHIRE\FILES).  Sapphire's DOS command comes in handy here, for
  258.    moving files around.
  259.  
  260.    Afterwards, use the GIVE command.  For example, if you had moved the file
  261.    PYROTO.LZH into the files directory, you would then enter this command:
  262.  
  263.    ==> GIVE PYROTO.LZH
  264.  
  265.    You would then be asked who this file is for (everybody, sysop, etc.), then
  266.    asked to write some documentation about the file.  (This step is described
  267.    later, in more detail.)
  268.  
  269.  
  270.  
  271.                              ------------------------
  272.                              ADDING SOFTWARE REMOTELY
  273.                              ------------------------
  274.  
  275.    A remote user follows essentially the same steps as a local user, but
  276.    obviously he cannot place the file directly into the files directory.  So
  277.    he must upload the file, using one of the file-transfer protocols used by
  278.    Sapphire (Xmodem-Checksum, Xmodem-CRC, Ymodem, Zmodem).
  279.  
  280.    As a reward for contributing software, he is granted "double-your-minutes-
  281.    back for this visit and the next".  For example, if it took him 10 minutes,
  282.    he gets an extra 20 minutes for the current visit, plus 20 extra minutes
  283.    for the next session.
  284.  
  285.  
  286.  
  287.                           ------------------------------
  288.                           HOW ONLINE DOCUMENTATION WORKS
  289.                           ------------------------------
  290.  
  291.    After contributing a file, the contributor may write up to 48 lines of
  292.    documentation, which other people will be able to read before deciding
  293.    whether or not to download this file.
  294.  
  295.    Online documentation that has already been written can be re-used.  For
  296.    example, if you are making available a multi-file software package, you can
  297.    tell Sapphire to use one documentation file for all of the files.
  298.  
  299.    Incidentally, if one of those software files is deleted, the documentation
  300.    file is retained -- as long as some other file is using it.
  301.  
  302.    The documentation step uses the usual text editor that you use for writing
  303.    messages.  No new skills need be learned.  In fact, you can even include
  304.    private and exclusive messages in your documentation.
  305.  
  306.       NOTE:  If the entire documentation is private (i.e. the first line,
  307.       [summary line] is private), then the file can be accessed only
  308.       by the people listed in the private header.  This enables you to
  309.       exchange files privately with a limited group of people.
  310.  
  311.    The documentation is saved in the files directory, in a file with the same
  312.    root-name as the original file.  For example, a file named VARITALE.ARC
  313.    would have a documentation file named VARITALE.S-D associated with it. (The
  314.    S-D extension stands for Software Documentation.)  If you don't like the
  315.    documentation that a user has written, you can copy some better
  316.    documentation over the S-D file.  All S-D files are standard text files,
  317.    prepared with a text editor.
  318.  
  319.    If you don't like the extension S-D, you can change it to something else,
  320.    using SYSOP:CONFIG:ADVANCED:GENERAL:PATHS.
  321.  
  322.  
  323.  
  324.                                 ------------------
  325.                                 TRANSFER PROTOCOLS
  326.                                 ------------------
  327.  
  328.    The Ymodem supported by Sapphire is proper Ymodem, per the original specif-
  329.    ication.  Some very respectable communications programs confuse the proto-
  330.    col Xmodem-1K with Ymodem.  If your users complain that Ymodem doesn't work
  331.    for them, suggest they switch their communications program from Ymodem to
  332.    Ymodem-Batch.
  333.  
  334.    You should encourage your users to use the Zmodem protocol, because it has
  335.    built-in crash recovery.  That means that if the user is cut off while
  336.    downloading a file, he can call back and pick up where he left off.
  337.  
  338.    Crash recovery also works on uploaded files.  If the user is disconnected
  339.    during an Xmodem or Ymodem transfer, Sapphire has no choice but to delete
  340.    the partial file.  But if the user used Zmodem, Sapphire retains the
  341.    partial file in the files directory -- though it does not add it to the
  342.    files list.  This enables the user to call back and pick up where he left
  343.    off, using Zmodem's crash recovery.
  344.  
  345.  
  346.