{ ************************************************************************ } { Mystic Bulletin Board System Free Pascal File Structures } { Copyright (C) 1997-2011 By James Coyle All Rights Reserved } { ************************************************************************ } Const SoftID = 'Mystic'; { Software name } Version = '1.09'; { Software version } {$IFDEF WIN32} PathChar = '\'; LineTerm = #13#10; OSID = 'Windows'; OSType = 0; {$ENDIF} {$IFDEF LINUX} PathChar = '/'; LineTerm = #10; OSID = 'Linux'; OSType = 1; {$ENDIF} {$IFDEF DARWIN} PathChar = '/'; LineTerm = #10; OSID = 'OSX'; OSType = 2; {$ENDIF} Max_Menu_Cmds = 75; { Maximum menu commands per menu } Max_Vote = 20; { Max number of voting questions } Total_Lang_Str = 465; { Total # of strings in language file } { IN PROGRESS: LIMITATION CONSTANTS } mysMaxAcsSize = 30; // Max ACS string size mysMaxMsgText = 500; // Max message base lines mysMaxInputHistory = 5; // Input history stack size mysMaxFileDescLen = 50; mysMaxBatchQueue = 50; mysMaxMenuNameLen = 20; Type SmallWord = System.Word; Integer = SmallInt; { force Integer to be a 2-byte signed } Word = SmallWord; RecMessageText = Array[1..mysMaxMsgText] of String[79]; AccessFlagType = Set of 1..25; { flags A to Z } RecEchoMailAddr = Record { FidoNet-style network address } Zone, Net, Node, Point : Word; End; ExtAddrType = Record Zone, Net, Node, Point : Word; Desc : String[15]; End; (* MYSTIC.DAT is found in the root Mystic BBS directory, and contains *) (* most of the general configuration options. *) ConfigRec = Record { MYSTIC.DAT in root BBS directory } Version : String[8]; SysPath, { System path (root BBS directory) } AttachPath, { File attach directory } DataPath, { Data file directory } MsgsPath, { Default JAM directory } ArcsPath, { Archive software directory } QwkPath, { Local QWK directory } ScriptPath, { Script file directory } LogsPath : String[40]; { Log file directory } BBSName, { BBS Name } SysopName : String[30]; { Sysop Name } SysopPW : String[15]; { Sysop Password } SystemPW : String[15]; { System Password } MaxNode : Byte; { Max # of nodes the BBS has } DefStartMNU : String[8]; { Default start menu } DefFallMNU : String[8]; { Default fallback menu } DefLangFile : String[8]; { Default language file } TermMode : Byte; { 0 = Ask } { 1 = Detect } { 2 = Detect, ask if none } { 3 = Force ANSI } ScreenBlank : Byte; { Mins before WFC screen saver starts} ChatStart : SmallInt; { Chat hour start, } ChatEnd : SmallInt; { Chat hour end: mins since midnight } ChatFeedback : Boolean; { E-mail sysop if page isn't answered} BBSListACS : String[20]; { BBS List Editor ACS } AllowNewUser : Boolean; { Allow new users? } NewUserPW : String[15]; { New user password } NewSec : SmallInt; { New user security level } AskRealName, { Ask new users for real name? } AskAlias, { Ask new users for an alias? } AskStreet, { Ask new user for street address? } AskCityState, { Ask new users for city/state? } AskZipCode, { Ask new users for ZIP code } AskHomePhone, { Ask new users for home phone #? } AskDataPhone, { Ask new users for data phone #? } AskBirthdate, { Ask new users for date of birth? } AskGender, { Ask new users for their gender? } AskLanguage, { Ask new users to select a language?} AskEmail, AskUserNote, AskOption1, AskOption2, AskOption3, UseUSA : Boolean; { Use XXX-XXX-XXXX format phone #s? } EditType : Byte; { 0 = Line Editor } { 1 = Full Editor } { 2 = Ask } DateType : Byte; { 1 = MM/DD/YY } { 2 = DD/MM/YY } { 3 = YY/DD/MM } { 4 = Ask } UseMatrix : Boolean; { Use MATRIX-style login? } MatrixMenu : String[8]; { Matrix Menu Name } MatrixPW : String[15]; { Matrix Password } SeeMatrixPW : String[20]; { ACS required to see Matrix PW } Feedback : Boolean; { Force new user feedback } MsgLBMIndex : Byte; { use lightbar email msg index? } UseQuoteWindow : Byte; { 0 = no, 1 = ues, 2 = ask } MsgLBIndex : Byte; { 0 = no, 1 = yes, 2 = ask } Option1 : String[10]; Option2 : String[10]; Option3 : String[10]; FCompress : Boolean; { Compress file area numbers? } ImportDIZ : Boolean; { Search for FILE_ID.DIZ? } AutoValACS : String[20]; { ACS to auto-validate uploads } SeeUnvalid : String[20]; { ACS to see unvalidated files } DLUnvalid : String[20]; { ACS to download unvalidated files } SeeFailed : String[20]; { ACS to see failed files } DLFailed : String[20]; { ACS to download failed files } TestUploads : Boolean; { Test uploaded files? } PassLevel : Byte; { Pass errorlevel } TestCmdLine : String[60]; { Upload processor command line } MaxFileDesc : Byte; { Max # of File Description Lines } FreeUL : LongInt; { Max space required for uploads } FreeCDROM : LongInt; { Free space required for CD Copy } MCompress : Boolean; { Compress message area numbers? } QWK_BBSID : String[8]; { QWK packet display name } QWK_Welcome : String[8]; { QWK welcome display file } QWK_News : String[8]; { QWK news display file } QWK_Goodbye : String[8]; { QWK goodbye display file } QWK_Archive : String[3]; { Default QWK archive } QWK_MaxBase : SmallInt; { Max # of messages per base (QWK) } QWK_MaxPacket : SmallInt; { Max # of messages per packet } NetAddr : Array[1..20] of ExtAddrType; { Network Addresses } Origin : String[50]; { Default origin line } MsgColorQuote : Byte; { Default quote color } MsgColorText : Byte; { Default text color } MsgColorTear : Byte; { Default tear line color } MsgColorOrigin : Byte; { Default origin line color } SystemCalls : LongInt; { Total calls to the BBS } InvLoginACS : String[20]; { Invisible login ACS } SysChatLOG : Boolean; { Record SysOp chat to CHAT.LOG? } StatusType : Byte; { 0 = 2 line, 1 = 1 line } FListType : Byte; { 0 = Normal, 1 = Lightbar, 2 = Ask } DispFileHdr : Boolean; { Redisplay file header after pause } SysMacro : Array[1..4] of String[80]; { Sysop Macros } UploadBase : SmallInt; { Default upload file base } AutoSigLen : Byte; { Max Auto-Sig lines } FListCol : Byte; { File area list columns } MListCol : Byte; { Message area list columns } netCrash : Boolean; { NetMail CRASH flag? } netHold : Boolean; { NetMail HOLD flag? } netKillSent : Boolean; { NetMail KILLSENT flag? } UserNameFMT : Byte; { user input format } DispMsgHdr : Boolean; { redisplay message header } DefScreenSize : Byte; { default screen length } DupeScan : Byte; { dupescan: 0=no,1=yes,2=yes global } TimeOut : Word; { Seconds before inactivity timeout } MReadType : Byte; { 0 = normal, 1 = ansi, 2 = ask } HotKeys : Byte; { 0 = no, 1 = yes, 2 = ask } PermPos : LongInt; { permanent user # position } SeeInvisible : String[20]; { ACS to see invisible users } FeedbackTo : String[30]; { Feedback to user } AllowMulti : Boolean; { Allow multiple node logins? } StartMGroup : Word; { new user msg group start } StartFGroup : Word; { new user file group start } ShowMBases : Boolean; ShowFBases : Boolean; UseFullTC : Byte; { 0 = no, 1 = yes, 2 = ask } AskScreenSize : Boolean; inetDomain : String[25]; inetSMTPUse : Boolean; inetSMTPPort : Word; inetSMTPMax : Word; inetPOP3Use : Boolean; inetPOP3Port : Word; inetPOP3Max : Word; inetTNUse : Boolean; inetTNPort : Word; inetTNDupes : Byte; inetIPBlocking : Boolean; inetIPLogging : Boolean; inetFTPUse : Boolean; inetFTPPort : Word; inetFTPMax : Word; inetFTPDupes : Byte; inetFTPPortMin : Word; inetFTPPortMax : Word; inetFTPAnon : Boolean; inetFTPTimeout : Word; Reserved : Array[1..192] of Byte; End; Const UserLockedOut = $01; UserNoRatio = $02; UserDeleted = $04; UserNoKill = $08; UserNoCaller = $10; Type UserRec = Record { USERS.DAT } Flags : Byte; { User Flags } Handle : String[30]; { Handle } RealName : String[30]; { Real Name } Password : String[15]; { Password } Address : String[30]; { Address } City : String[25]; { City } ZipCode : String[9]; { Zipcode } HomePhone : String[15]; { Home Phone } DataPhone : String[15]; { Data Phone } BDay : LongInt; Gender : Char; { M> Male F> Female } EmailAddr : String[35]; { email address } Option1 : String[35]; { optional question #1 } Option2 : String[35]; { optional question #2 } Option3 : String[35]; { optional question #3 } UserInfo : String[30]; { user comment field } AF1 : AccessFlagType; AF2 : AccessFlagType; { access flags set #2 } Security : SmallInt; { Security Level } StartMNU : String[8]; { Start menu for user } FirstOn : LongInt; { Date/Time of First Call } LastOn : LongInt; { Date/Time of Last Call } Calls : LongInt; { Number of calls to BBS } CallsToday: SmallInt; { Number of calls today } DLs : SmallInt; { # of downloads } DLsToday : SmallInt; { # of downloads today } DLk : LongInt; { # of downloads in K } DLkToday : LongInt; { # of downloaded K today } ULs : LongInt; { total number of uploads } ULk : LongInt; { total number of uploaded K } Posts : LongInt; { total number of msg posts } Emails : LongInt; { total number of sent email } TimeLeft : LongInt; { time left online for today } TimeBank : SmallInt; { number of mins in timebank } Qwk_Arc : String[3]; { default archive extension } Qwk_List : Boolean; { Include new files in QWK? } DateType : Byte; { Date format (see above) } ScrnPause : Byte; { user's screen length } Language : String[8]; { user's language file } LastFBase : Word; { Last file base } LastMBase : Word; { Last message base } LastMGroup: Word; { Last group accessed } LastFGroup: Word; { Last file group accessed } Vote : Array[1..Max_Vote] of Byte; { Voting booth data } EditType : Byte; { 0 = Line, 1 = Full, 2 = Ask } fListType : Byte; { 0 = Normal, 1 = Lightbar } SigUse : Boolean; { Use auto-signature? } SigOffset : LongInt; { offset to sig in AUTOSIG.DAT } SigLength : Byte; { number of lines in sig } HotKeys : Boolean; { does user have hotkeys on? } MReadType : Byte; { 0 = line 1 = full 2 = ask } PermIdx : LongInt; { permanent user number } UseLBIndex: Boolean; { use lightbar index? } UseLBQuote: Boolean; { use lightbar quote mode } UseLBMIdx : Boolean; { use lightbar index in email? } UseFullTC : Boolean; { use full screen teleconference } Reserved : Array[1..98] of Byte; End; NodeRec = Record { NODEx.DAT } ACS : String[20]; { ACS required to log into node } Port : Byte; { Modem comport } Baud : LongInt; { Modem baud rate } Telnet : Boolean; { Is a TELNET node? } RTSFlow : Boolean; { Use RTS/CTS Hardware flow? } XONFlow : Boolean; { Use XON/XOFF Software flow? } Init : String[80]; { Modem initialization command } Hangup : String[40]; { Modem hangup command } Offhook : String[20]; { Modem offhook command } rOK : String[20]; { Modem result "OK" } rRING : String[20]; { Modem result "RING" } rATA : String[20]; { Modem answer call command } rBaud : Array[1..18] of Record { Modem results } Rate : LongInt; { BAUD RATE } Result : String[20]; { "CONNECT" string for above baud } End; End; EventRec = Record { EVENTS.DAT } Active : Boolean; { Is event active? } Name : String[30]; { Event Name } Forced : Boolean; { Is this a forced event } ErrLevel : Byte; { Errorlevel to Exit } ExecTime : SmallInt; { Minutes after midnight } Warning : Byte; { Warn user before the event } Offhook : Boolean; { Offhook modem for event? } Node : Byte; { Node number. 0 = all } LastRan : LongInt; { Last time event was ran } End; (* SECURITY.DAT in the data directory holds 255 records, one for each *) (* possible security level. *) SecurityRec = Record { SECURITY.DAT } Desc : String[30]; { Description of security level } Time : SmallInt; { Time online (mins) per day } MaxCalls : SmallInt; { Max calls per day } MaxDLs : SmallInt; { Max downloads per day } MaxDLk : SmallInt; { Max download kilobytes per day } MaxTB : SmallInt; { Max mins allowed in time bank } DLRatio : Byte; { Download ratio (# of DLs per UL) } DLKRatio : SmallInt; { DL K ratio (# of DLed K per UL K } AF1 : AccessFlagType; { Access flags for this level A-Z } AF2 : AccessFlagType; { Access flags #2 for this level } Hard : Boolean; { Do a hard AF upgrade? } StartMNU : String[8]; { Start Menu for this level } PCRatio : SmallInt; { Post / Call ratio per 100 calls } Res1 : Byte; { reserved for future use } Res2 : LongInt; { reserved for future use } End; ArcRec = Record { ARCHIVE.DAT } Name : String[20]; { Archive description } Ext : String[3]; { Archive extension } Pack : String[60]; { Pack command line } Unpack : String[60]; { Unpack command line } View : String[60]; { View command line } End; (* RecArchive = Packed Record OSID : Byte; Desc : String[20]; Ext : String[4]; Pack : String[80]; Unpack : String[80]; View : String[80]; End; *) MScanRec = Record { *.SCN } NewScan : Byte; { Include this base in new scan? } QwkScan : Byte; { Include this base in qwk scan? } End; MBaseRec = Record { MBASES.DAT } Name : String[40]; { Message base name } QWKName : String[13]; { QWK (short) message base name } FileName : String[40]; { Message base file name } Path : String[40]; { Path where files are stored } BaseType : Byte; { 0 = JAM, 1 = Squish } NetType : Byte; { 0 = Local 1 = EchoMail } { 2 = UseNet 3 = NetMail } PostType : Byte; { 0 = Public 1 = Private } ACS, { ACS required to see this base } ReadACS, { ACS required to read messages } PostACS, { ACS required to post messages } SysopACS : String[20]; { ACS required for sysop options } Password : String[15]; { Password for this message base } ColQuote : Byte; { Quote text color } ColText : Byte; { Text color } ColTear : Byte; { Tear line color } ColOrigin: Byte; { Origin line color } NetAddr : Byte; { Net AKA to use for this base } Origin : String[50]; { Net origin line for this base } UseReal : Boolean; { Use real names? } DefNScan : Byte; { 0 = off, 1 = on, 2 = always } DefQScan : Byte; { 0 = off, 1 = on, 2 = always } MaxMsgs : Word; { Max messages to allow } MaxAge : Word; { Max age of messages before purge } Header : String[8]; { Display Header file name } Index : SmallInt; { QWK index - NEVER CHANGE THIS } End; FScanRec = Record { *.SCN } NewScan : Byte; { Include this base in new scan? } LastNew : LongInt; { Last file scan (packed datetime)} End; FBaseRec = Record { FBASES.DAT } Name : String[40]; { File base name } FtpName : String[60]; { FTP directory name } Filename : String[40]; { File name } DispFile : String[20]; { Pre-list display file name } Template : String[20]; { ansi file list template } ListACS, { ACS required to see this base } FtpACS, { ACS to see in FTP directory } SysopACS, { ACS required for SysOp functions} ULACS, { ACS required to upload files } DLACS : String[mysMaxAcsSize]; { ACS required to download files } Path : String[120]; { Path where files are stored } Password : String[20]; { Password to access this base } DefScan : Byte; { Default New Scan Setting } ShowUL : Boolean; IsCDROM : Boolean; IsFREE : Boolean; End; (* The file directory listing are stored as .DIR in *) (* the data directory. Each record stores the info on one file. File *) (* descriptions are stored in .DES in the data *) (* directory. FDirRec.Pointer points to the file position in the .DES *) (* file where the file description for the file begins. FDirRec.Lines is *) (* the number of lines in the file description. Each line is stored as a *) (* Pascal-like string (ie the first byte is the length of the string, *) (* followed by text which is the length of the first byte *) Const FDirOffline = $01; FDirInvalid = $02; FDirDeleted = $04; FDirFailed = $08; FDirFree = $10; Type FDirRec = Record { *.DIR } FileName : String[70]; { File name } Size : LongInt; { File size (in bytes) } DateTime : LongInt; { Date and time of upload } Uploader : String[30]; { User name who uploaded the file } Flags : Byte; { Set of FDIRFLAGS (see above) } Pointer : LongInt; { Pointer to file description } Lines : Byte; { Number of description lines } DLs : Word; { # of times this file was downloaded} End; GroupRec = Record { GROUP_*.DAT } Name : String[30]; { Group name } ACS : String[20]; { ACS required to access group } End; (* Mystic BBS stores it's menu files as text files. They *) (* have been stored this way to make it possible to edit them with a text *) (* editor (which is sometimes easier then using the menu editor). The *) (* following records do not need to be used, but provide one way of *) (* reading a menu into a record. *) MenuRec = Record Header : String[255]; Prompt : String[255]; DispCols : Byte; ACS : String[20]; Password : String[15]; TextFile : String[8]; FallBack : String[8]; MenuType : Byte; { 0 = standard, 1 = lightbar, 2 = lightbar grid } InputType : Byte; { 0 = user setting, 1 = longkey, 2 = hotkey } DoneX : Byte; DoneY : Byte; Global : Byte; { 0 = no, 1 = yes } End; MenuCmdRec = Record Text : String[79]; HotKey : String[8]; LongKey : String[8]; ACS : string[20]; Command : String[2]; Data : String[79]; X : Byte; Y : Byte; cUp : Byte; cDown : Byte; cLeft : Byte; cRight : Byte; LText : String[79]; LHText : String[79]; End; PercentRec = Record { percentage bar record } { 5 bytes } BarLen : Byte; LoChar : Char; LoAttr : Byte; HiChar : Char; HiAttr : Byte; End; LangRec = Record { LANGUAGE.DAT } FileName : String[8]; { Language file name } Desc : String[30]; { Language description } TextPath : String[40]; { Path where text files are stored } MenuPath : String[40]; { Path where menu files are stored } okASCII : Boolean; { Allow ASCII } okANSI : Boolean; { Allow ANSI } BarYN : Boolean; { Use Lightbar Y/N with this lang } FieldCol1 : Byte; { Field input color } FieldCol2 : Byte; FieldChar : Char; EchoCh : Char; { Password echo character } QuoteColor: Byte; { Color for quote lightbar } TagCh : Char; { File Tagged Char } FileHi : Byte; { Color of file search highlight } FileLo : Byte; { Non lightbar description color } NewMsgChar: Char; { Lightbar Msg Index New Msg Char } VotingBar : PercentRec; { voting booth bar } FileBar : PercentRec; { file list bar } MsgBar : PercentRec; { lightbar msg reader bar } Reserved : Array[1..100] of Byte; { RESERVED } End; BBSListRec = Record cType : Byte; Phone : String[15]; Telnet : String[40]; BBSName : String[30]; Location : String[25]; SysopName : String[30]; BaudRate : String[6]; Software : String[10]; Deleted : Boolean; AddedBy : String[30]; Verified : LongInt; Res : Array[1..6] of Byte; End; (* ONELINERS.DAT found in the data directory. This file contains all the one-liner data. It can be any number of records in size. *) OneLineRec = Record Text : String[79]; From : String[30]; End; (* Each record of VOTES.DAT is one question. Mystic only allows for up *) (* to 20 questions. *) VoteRec = Record { VOTES.DAT in DATA directory } Votes : SmallInt; { Total votes for this question } AnsNum : Byte; { Total # of Answers } User : String[30]; { User name who added question } ACS : String[20]; { ACS to see this question } AddACS : String[20]; { ACS to add an answer } ForceACS: String[20]; { ACS to force voting of question } Question: String[79]; { Question text } Answer : Array[1..15] of Record { Array[1..15] of Answer data } Text : String[40]; { Answer text } Votes : SmallInt; { Votes for this answer } End; End; (* CHATx.DAT is created upon startup, where X is the node number being *) (* loaded. These files are used to store all the user information for a *) (* node. *) ChatRec = Record { CHATx.DAT } Active : Boolean; { Is there a user on this node? } Name : String[30]; { User's name on this node } Action : String[40]; { User's action on this node } Location : String[30]; { User's City/State on this node } Gender : Char; { User's gender } Age : Byte; { User's age } Baud : String[6]; { User's baud rate } Invisible : Boolean; { Is node invisible? } Available : Boolean; { Is node available? } InChat : Boolean; { Is user in multi-node chat? } Room : Byte; { Chat room } End; (* Chat room record - partially used by the multi node chat functions *) RoomRec = Record Name : String[40]; { Channel Name } Reserved : Array[1..128] of Byte; { RESERVED } End; (* CALLERS.DAT holds information on the last ten callers to the BBS. This *) (* file is always 10 records long with the most recent caller being the *) (* 10th record. *) LastOnRec = Record { CALLERS.DAT } Handle : String[30]; { User's Name } City : String[25]; { City/State } Address : String[30]; { user's address } Baud : String[6]; { Baud Rate } DateTime : LongInt; { Date & Time (UNIX) } Node : Byte; { Node number of login } CallNum : LongInt; { Caller Number } EmailAddr : String[35]; { email address } UserInfo : String[30]; { user info field } Option1 : String[35]; { optional data 1 } Option2 : String[35]; { " " 2 } Option3 : String[35]; { " " 3 } End; HistoryRec = Record Date : LongInt; Emails : Word; Posts : Word; Downloads : Word; Uploads : Word; DownloadKB : LongInt; UploadKB : LongInt; Calls : LongInt; NewUsers : Word; End; RecProtocol = Record OSID : Byte; Active : Boolean; Batch : Boolean; Key : Char; Desc : String[40]; SendCmd : String[60]; RecvCmd : String[60]; End; PromptRec = String[255]; NodeMsgRec = Record FromNode : Byte; FromWho : String[30]; ToWho : String[30]; Message : String[250]; MsgType : Byte; { 1 = Chat Pub and broadcast } { 2 = System message } { 3 = User message } { 4 = Chat Private } { 5 = chat status note } { 6 = chat action } { 7 = chat topic update } Room : Byte; { Chat room number. 0 = chat broadcast } End;