home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / DEVELOP.ZIP / USERNET.DOC < prev    next >
Text File  |  1996-07-23  |  5KB  |  110 lines

  1.   WARNING:  This document is subject to change at any time.  Any changes made
  2.   will be indicated by a vertical bar (|) in column 1 of the file.
  3.  
  4. | Last update: 07/23/96
  5.  
  6. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7.  
  8.   The later versions of PCBoard must accomodate a much larger number of nodes
  9.   which precludes the ability to load the entire USERNET.DAT file into memory
  10.   for processing.  For that reason the file format has been changed to allow
  11.   picking up of status changes without having to scan the entire file.  In
  12.   addition, new capabilities have been added.
  13.  
  14.   The following constitutes the file format and file handling for usernet.xxx
  15.   from the v15.0 version of PCBoard on up to the present.
  16.  
  17.     USERNET.XXX header
  18.     ==================
  19.     typedef struct {
  20.       unsigned Version;        PCBoard Compatibility Version Number (150)
  21.       unsigned NumOfNodes;     The number of nodes supported in the file
  22.       unsigned SizeOfRec;      The record size for each node
  23.     } usernethdrtype;
  24.  
  25.     typedef struct {
  26.       char     Status;         Node status
  27.       bool     MailWaiting;    Flag to show mail posted while caller is online
  28.       unsigned Pager;          Node number of pager (if node has been paged)
  29.       char     Name[26];       Caller's Name (if a caller is online)
  30.       char     City[25];       Caller's City (if a caller is online)
  31.       char     Operation[49];  Current operation (door name, etc)
  32.       char     Message[80];    For broadcast messages
  33.       char     Channel;        Channel number of pager (if node has been paged)
  34. | **  long     LastUpdate;     hour:min:sec of last update on this record
  35.     } noderectype;
  36.  
  37.       NOTE:  Prior to v15.0 the Message, Channel and LastUpdate fields did not
  38.       exist.  However, the function of the Message field was performed thru the
  39.       Operation field.
  40.  
  41. | **  NOTE:  Versions 15.0 through 15.21 used a simple long integer to store
  42. |     the only the "time" of the last update of the usernet record.  Beginning
  43. |     in version 15.22 this field has changed to a more complex structure
  44. |     as shown below:
  45. |
  46. |        typedef union {
  47. |          long DateTime;
  48. |          struct {
  49. |            unsigned short Time;   /* seconds past midnight divided by 2 */
  50. |            unsigned short Date;   /* julian date */
  51. |          } Split;
  52. |        } updttype;
  53. |
  54. |     As you can see, the structure is still a 4-byte value.  But realizing
  55. |     that the old 4-byte LastUpdate value really only used 3 bytes (the top
  56. |     byte was always 0), it was decided that both DATE and TIME could be
  57. |     stored inside the same 4 bytes if the time was simply divided by 2.
  58. |     Now it is possible to accurately determine how long it has been since
  59. |     the last time the usernet record was updated even if the time has
  60. |     crossed midnight.
  61.  
  62.   The actual layout of the file is the following:
  63.  
  64.      1) header information
  65.      2) attention bit flags
  66.      3) up status bit flags
  67.      4) node records (1 record for each node)
  68.  
  69.   The bit flags are set up such that one byte holds 8 flags, i.e.  nodes 1-8
  70.   fit in the first byte, nodes 9-16 fit in the second byte and so on.  The
  71.   number of bytes used for the bit flags is equal to the number of nodes
  72.   indicated in the header divided by 8 and rounded up to a full byte.
  73.  
  74.   The "attention bit flags" are used to get another node's attention.  For
  75.   instance, if one node wants to chat with another it sets the attention bit
  76.   flag for the target node ON.  The same is used for dropping an alternate node
  77.   to DOS or forcing it to logoff.
  78.  
  79.   The "up status bit flags" are used to indicate if a node is up or not.  This
  80.   is used so that a complete scan of the usernet.dat file is never needed in
  81.   order to find out which nodes are up.  (if a 1000-node version were in use
  82.   this means scanning only 125 bytes instead of the 100K or so that would be
  83.   the complete size of the usernet.xxx file)
  84.  
  85.   Status Letters
  86.   --------------
  87.        0   =    Ascii 0 is used to signify that a node is not up
  88.       ' '  =    Space denotes that the node is up but no caller is online
  89.       'A'  =    Available for Chat
  90.       'B'  =    Remote Drop to DOS
  91.       'C'  =    Chatting with sysop
  92.       'D'  =    Out to DOS - in a door
  93.       'E'  =    Entering a Message
  94.       'F'  =    Viewing a File
  95.       'G'  =    Group Chat
  96.       'H'  =    Handling Mail
  97.       'L'  =    Logoff Pending
  98.       'M'  =    Received broadcast message
  99.       'N'  =    Running Event
  100.       'O'  =    Logging Into System
  101.       'P'  =    Paging the Sysop
  102. |     'Q'  =    Run On Connect (PCBoard displays no caller this node)
  103.       'R'  =    Recycle BBS
  104.       'S'  =    Answering a script questionnaire
  105.       'T'  =    Transfering a File
  106.       'U'  =    Unavailable for Chat
  107.       'W'  =    Drop to DOS (wait for caller to logoff)
  108.       'X'  =    Drop to DOS (now)
  109.  
  110.