More work towards QWK networking

This commit is contained in:
mysticbbs 2013-08-29 06:04:20 -04:00
parent 37c48d3182
commit 1fe5fbfd2d
58 changed files with 395 additions and 776 deletions

View File

@ -40,10 +40,9 @@ Implementation
Uses
m_Strings,
bbs_Ansi_MenuBox,
bbs_Core,
bbs_Common,
bbs_dataBase,
BBS_Records,
BBS_Ansi_MenuBox,
BBS_Core,
MPL_Execute;
Constructor TAnsiMenuHelp.Create;

View File

@ -6,9 +6,8 @@ Interface
Uses
m_Types,
bbs_Ansi_MenuInput,
bbs_dataBase,
bbs_Common;
BBS_Records,
BBS_Ansi_MenuInput;
Const
FormMaxItems = 60;
@ -137,8 +136,9 @@ Implementation
Uses
m_FileIO,
m_Strings,
bbs_Core,
bbs_Ansi_MenuBox;
BBS_Common,
BBS_Core,
BBS_Ansi_MenuBox;
Constructor TAnsiMenuForm.Create;
Begin

View File

@ -11,11 +11,12 @@ Implementation
Uses
m_FileIO,
m_Strings,
bbs_Common,
bbs_dataBase,
bbs_Ansi_MenuBox,
bbs_Ansi_MenuForm,
bbs_cfg_Common;
BBS_Records,
BBS_DataBase,
BBS_Common,
BBS_Ansi_MenuBox,
BBS_Ansi_MenuForm,
BBS_Cfg_Common;
Procedure EditArchive (Var Arc: RecArchive);
Var

View File

@ -6,8 +6,7 @@ Interface
Uses
BBS_Core,
BBS_Common,
bbs_dataBase;
BBS_Records;
Function GetNodeByIndex (Num: LongInt; Var TempNode: RecEchoMailNode) : Boolean;
Procedure AddExportByBase (Var MBase: RecMessageBase; Idx: LongInt);
@ -27,7 +26,9 @@ Uses
bbs_Ansi_MenuBox,
bbs_Ansi_MenuForm,
bbs_cfg_Common,
bbs_Cfg_MsgBase;
bbs_Cfg_MsgBase,
BBS_Common,
BBS_DataBase;
Function IsExportNode (Var MBase: RecMessageBase; Idx: LongInt) : Boolean;
Var
@ -239,7 +240,7 @@ Begin
NewIdx := Configuration_MessageBaseEditor(False);
If NewIdx <> -1 Then
If Session.Msgs.GetBaseByIndex(NewIdx, MBase) Then Begin
If GetMBaseByIndex(NewIdx, MBase) Then Begin
If MBase.EchoTag = '' Then
ShowMsgBox(0, 'Missing ECHOTAG for ' + strStripPipe(MBase.Name))
Else
@ -248,7 +249,7 @@ Begin
End;
'D' : If List.ListMax > 0 Then
If ShowMsgBox(1, 'Delete this entry?') Then
If Session.Msgs.GetBaseByIndex (strS2I(strWordGet(1, List.List[List.Picked]^.Name, ' ')), MBase) Then Begin
If GetMBaseByIndex (strS2I(strWordGet(1, List.List[List.Picked]^.Name, ' ')), MBase) Then Begin
RemoveExportFromBase(MBase, Node.Index);
End;

View File

@ -12,11 +12,12 @@ Uses
m_Strings,
m_DateTime,
m_FileIO,
bbs_Common,
bbs_dataBase,
bbs_ansi_MenuBox,
bbs_ansi_MenuForm,
bbs_cfg_Common;
BBS_Records,
BBS_DataBase,
BBS_Common,
BBS_Ansi_MenuBox,
BBS_Ansi_MenuForm,
BBS_Cfg_Common;
Procedure EditEvent (Var Event: RecEvent);
Var

View File

@ -13,11 +13,12 @@ Uses
m_Strings,
m_FileIO,
m_QuickSort,
bbs_Ansi_MenuBox,
bbs_Ansi_MenuForm,
bbs_Common,
bbs_DataBase,
bbs_cfg_Common;
BBS_Ansi_MenuBox,
BBS_Ansi_MenuForm,
BBS_Records,
BBS_DataBase,
BBS_Common,
BBS_Cfg_Common;
Type
RecFileBaseFile = File of RecFileBase;

View File

@ -9,11 +9,12 @@ Implementation
Uses
m_FileIO,
m_Strings,
bbs_Ansi_MenuBox,
bbs_Ansi_MenuForm,
bbs_cfg_Common,
bbs_dataBase,
bbs_Common;
BBS_Ansi_MenuBox,
BBS_Ansi_MenuForm,
BBS_Cfg_Common,
BBS_Records,
BBS_DataBase,
BBS_Common;
Procedure EditGroup (Var Group: RecGroup);
Var

View File

@ -19,6 +19,7 @@ Uses
bbs_Ansi_MenuForm,
BBS_Core,
BBS_Common,
BBS_Records,
BBS_MenuData,
bbs_dataBase,
bbs_cfg_Theme,

View File

@ -18,8 +18,9 @@ Uses
bbs_Ansi_MenuForm,
bbs_Cfg_Common,
bbs_Cfg_EchoMail,
bbs_Common,
bbs_dataBase;
BBS_Records,
BBS_DataBase,
BBS_Common;
Type
RecMessageBaseFile = File of RecMessageBase;

View File

@ -11,11 +11,12 @@ Implementation
Uses
m_FileIO,
m_Strings,
bbs_Common,
bbs_dataBase,
bbs_ansi_MenuBox,
bbs_ansi_MenuForm,
bbs_cfg_Common;
BBS_Records,
BBS_DataBase,
BBS_Common,
BBS_Ansi_MenuBox,
BBS_Ansi_MenuForm,
BBS_Cfg_Common;
Procedure EditProtocol (Var Prot: RecProtocol);
Var

View File

@ -11,11 +11,11 @@ Implementation
Uses
m_Strings,
m_FileIO,
bbs_Common,
bbs_dataBase,
bbs_Ansi_MenuBox,
bbs_Ansi_MenuForm,
bbs_Cfg_Common;
BBS_Records,
BBS_DataBase,
BBS_Ansi_MenuBox,
BBS_Ansi_MenuForm,
BBS_Cfg_Common;
Procedure EditLevel (Var Sec: RecSecurity);
Var

View File

@ -26,10 +26,10 @@ Implementation
Uses
m_Strings,
bbs_Common,
bbs_dataBase,
bbs_ansi_MenuBox,
bbs_ansi_MenuForm;
BBS_Records,
BBS_DataBase,
BBS_Ansi_MenuBox,
BBS_Ansi_MenuForm;
Procedure Configuration_SysPaths;
Var

View File

@ -12,13 +12,14 @@ Uses
m_Types,
m_FileIO,
m_Strings,
bbs_Ansi_MenuBox,
bbs_Ansi_MenuForm,
bbs_Ansi_MenuInput,
bbs_Core,
bbs_Common,
bbs_dataBase,
bbs_Cfg_Common;
BBS_Ansi_MenuBox,
BBS_Ansi_MenuForm,
BBS_Ansi_MenuInput,
BBS_Core,
BBS_Records,
BBS_DataBase,
BBS_Common,
BBS_Cfg_Common;
(*
Procedure CompileTheme (Var Theme: RecTheme);

View File

@ -3,8 +3,7 @@ Unit bbs_Cfg_UserEdit;
Interface
Uses
bbs_Common,
bbs_dataBase;
BBS_Records;
Procedure Configuration_EditUser (Var U: RecUser);
Procedure Configuration_UserEditor;
@ -22,6 +21,8 @@ Uses
bbs_io,
bbs_Core,
bbs_General,
BBS_Common,
BBS_DataBase,
bbs_Cfg_SecLevel;
Procedure Configuration_EditUser (Var U: RecUser);

View File

@ -18,7 +18,7 @@ Uses
m_Input,
m_DateTime,
m_FileIO,
bbs_dataBase;
BBS_Records;
// This unit is very old (like 1994) and its functions need to be phased out
// This is the stuff that hasn't been worked into a class somewhere or
@ -26,7 +26,6 @@ Uses
Const
WinConsoleTitle = mysSoftwareID + ' Node ';
CopyID = 'Copyright (C) ' + mysCopyYear + ' By James Coyle';
DateTypeStr : Array[1..4] of String[8] = ('MM/DD/YY', 'DD/MM/YY', 'YY/DD/MM', 'Ask ');
Var
@ -36,7 +35,6 @@ Var
ConfigFile : File of RecConfig;
ChatFile : File of ChatRec;
RoomFile : File of RoomRec;
Chat : ChatRec;
Room : RoomRec;
LastOnFile : File of RecLastOn;
LastOn : RecLastOn;
@ -60,6 +58,7 @@ Implementation
Uses
DOS,
bbs_Core,
BBS_DataBase,
{$IFNDEF UNIX}
bbs_SysOpChat,
{$ENDIF}

View File

@ -13,8 +13,7 @@ Uses
m_Strings,
m_Pipe,
m_DateTime,
bbs_dataBase,
// BBS_Common,
BBS_Records,
BBS_IO,
BBS_MsgBase,
BBS_User,
@ -40,6 +39,7 @@ Type
ThemeFile : File of RecTheme;
VoteFile : File of VoteRec;
Vote : VoteRec;
Chat : ChatRec;
CommHandle : LongInt;
ShutDown : Boolean;
TempPath : String;
@ -103,6 +103,9 @@ Var
Implementation
Uses
BBS_DataBase;
Constructor TBBSCore.Create;
Begin
Inherited Create;

View File

@ -1,20 +1,14 @@
Unit bbs_dataBase;
// This unit us a work in progress designed to move lower level functions
// away from session-tied objects and into a unit usable for external
// utilities. Keeping them procedural instead of object-based also has some
// additional smartlinking benefits in the long run.
// The drawback of a non-abstract object is that we cannot easily define
// alternate data sources such as a INI or SQL backend. Because of that,
// this MAY change in the future -- particularly if we can smartlink at the
// method level of classes in future FP releases.
Unit BBS_DataBase;
{$I M_OPS.PAS}
Interface
{$I RECORDS.PAS}
Uses
BBS_Records,
BBS_MsgBase_ABS,
BBS_MsgBase_JAM,
BBS_MsgBase_Squish;
Var
bbsCfg : RecConfig;
@ -33,6 +27,7 @@ Function PutBaseConfiguration (Var TempCfg: RecConfig) : Boolean;
// MESSAGE BASE
Function MBaseOpenCreate (Var Msg: PMsgBaseABS; Var Area: RecMessageBase; TP: String) : Boolean;
Function GetMBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
Procedure GetMessageScan (UN: Cardinal; TempBase: RecMessageBase; Var TempScan: MScanRec);
Procedure PutMessageScan (UN: Cardinal; TempBase: RecMessageBase; TempScan: MScanRec);
@ -41,11 +36,16 @@ Procedure PutMessageScan (UN: Cardinal; TempBase: RecMessageBase; TempSca
Function GetTotalFiles (Var TempBase: RecFileBase) : LongInt;
// USER
Function IsThisUser (U: RecUser; Str: String) : Boolean;
Implementation
Uses
DOS,
m_FileIO;
m_FileIO,
m_Strings;
Function GetBaseConfiguration (UseEnv: Boolean; Var TempCfg: RecConfig) : Byte;
Var
@ -168,6 +168,33 @@ Begin
Close (ScanFile);
End;
Function MBaseOpenCreate (Var Msg: PMsgBaseABS; Var Area: RecMessageBase; TP: String) : Boolean;
Begin
Result := False;
Case Area.BaseType of
0 : Msg := New(PMsgBaseJAM, Init);
1 : Msg := New(PMsgBaseSquish, Init);
End;
Msg^.SetMsgPath (Area.Path + Area.FileName);
Msg^.SetTempFile (TP + 'msgbuf.');
If Not Msg^.OpenMsgBase Then
If Not Msg^.CreateMsgBase (Area.MaxMsgs, Area.MaxAge) Then Begin
Dispose (Msg, Done);
Exit;
End Else
If Not Msg^.OpenMsgBase Then Begin
Dispose (Msg, Done);
Exit;
End;
Result := True;
End;
Function GetTotalFiles (Var TempBase: RecFileBase) : LongInt;
Begin
Result := 0;
@ -180,6 +207,12 @@ Begin
Result := Result DIV SizeOf(RecFileList);
End;
Function IsThisUser (U: RecUser; Str: String) : Boolean;
Begin
Str := strUpper(Str);
Result := (strUpper(U.RealName) = Str) or (strUpper(U.Handle) = Str);
End;
Initialization
bbsCfgStatus := GetBaseConfiguration(True, bbsCfg);

View File

@ -18,10 +18,11 @@ Uses
m_Strings,
m_DateTime,
m_FileIO,
bbs_Common,
bbs_dataBase,
bbs_Core,
bbs_User;
BBS_Records,
BBS_Common,
BBS_DataBase,
BBS_Core,
BBS_User;
Const
Ending : String[2] = #13#10;

View File

@ -6,7 +6,7 @@ Interface
Uses
m_FileIO,
bbs_MsgBase_ANSI;
BBS_MsgBase_Ansi;
Const
fseMaxCutText = 60;
@ -89,10 +89,9 @@ Implementation
Uses
m_Strings,
bbs_Core,
bbs_DataBase,
bbs_Common,
bbs_Ansi_MenuBox;
BBS_Records,
BBS_Core,
BBS_Ansi_MenuBox;
Constructor TEditorANSI.Create (Var O: Pointer; TemplateFile: String);
Begin

View File

@ -12,11 +12,12 @@ Implementation
Uses
m_Strings,
m_FileIO,
bbs_Common,
bbs_DataBase,
bbs_Core,
bbs_FileBase,
bbs_User;
BBS_Common,
BBS_Records,
BBS_DataBase,
BBS_Core,
BBS_FileBase,
BBS_User;
Var
CurLine : Integer;

View File

@ -19,11 +19,12 @@ Uses
m_Strings,
m_FileIO,
m_DateTime,
bbs_Common,
bbs_dataBase,
bbs_General,
bbs_NodeInfo,
bbs_Ansi_MenuBox,
BBS_Records,
BBS_Common,
BBS_DataBase,
BBS_General,
BBS_NodeInfo,
BBS_Ansi_MenuBox,
AView,
{$IFDEF USEALTPROT}
m_Prot_Base,

View File

@ -11,8 +11,8 @@ Uses
Windows,
bbs_SysopChat,
{$ENDIF}
bbs_Common,
bbs_database,
BBS_Records,
BBS_Common,
bbs_Edit_ANSI,
bbs_Edit_Line;
@ -51,6 +51,7 @@ Uses
m_FileIO,
m_QuickSort,
bbs_Core,
BBS_DataBase,
bbs_MsgBase_Ansi,
bbs_NodeInfo;

View File

@ -18,8 +18,7 @@ Uses
m_FileIO,
m_Strings,
m_Term_Ansi,
bbs_Common,
bbs_dataBase;
BBS_Records;
Const
TBBSIOBufferSize = 4 * 1024 - 1;
@ -119,7 +118,9 @@ Implementation
Uses
DOS,
bbs_Core,
BBS_Core,
BBS_DataBase,
BBS_Common,
bbs_General,
bbs_NodeInfo;
@ -602,7 +603,7 @@ Begin
'G' : LastMCIValue := strI2S(DaysAgo(TBBSCore(Core).User.ThisUser.Birthday, 1) DIV 365);
'O' : AllowAbort := False;
'S' : LastMCIValue := OutON(TBBSCore(Core).User.ThisUser.SigUse);
'V' : LastMCIValue := OutYN(Chat.Available);
'V' : LastMCIValue := OutYN(Session.Chat.Available);
End;
'B' : Case Code[2] of
'D' : If TBBSCore(Core).LocalMode Then
@ -656,7 +657,7 @@ Begin
FmtString := True;
FmtType := 12;
End;
'L' : LastMCIValue := OutON(Chat.Invisible);
'L' : LastMCIValue := OutON(Session.Chat.Invisible);
'S' : Begin
FmtString := True;
FmtType := 14;

View File

@ -6,7 +6,7 @@ Interface
Uses
m_Strings,
bbs_dataBase;
BBS_Records;
Type
TMenuData = Class

View File

@ -5,8 +5,9 @@ Unit BBS_Menus;
Interface
Uses
BBS_Records,
BBS_Common,
bbs_dataBase,
BBS_DataBase,
BBS_MenuData,
MPL_Execute;

View File

@ -7,8 +7,8 @@ Interface
Uses
m_FileIO,
m_DateTime,
bbs_Common,
bbs_dataBase,
BBS_Records,
BBS_Common,
bbs_General,
bbs_MsgBase_ABS,
bbs_MsgBase_JAM,
@ -35,12 +35,12 @@ Type
Destructor Destroy; Override;
Function IsQuotedText (Str: String) : Boolean;
Function OpenCreateBase (Var Msg: PMsgBaseABS; Var Area: RecMessageBase) : Boolean;
// Function OpenCreateBase (Var Msg: PMsgBaseABS; Var Area: RecMessageBase) : Boolean;
Procedure AppendMessageText (Var Msg: PMsgBaseABS; Lines: Integer; ReplyID: String);
Procedure AssignMessageData (Var Msg: PMsgBaseABS; Var TempBase: RecMessageBase);
Function GetBaseByNum (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
Function GetBaseCompressed (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
Function GetBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
// Function GetBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
Function GetMessageStats (List, ShowPrompt, ShowYou: Boolean; Var ListPtr: LongInt; Var TempBase: RecMessageBase; NoFrom, NoRead: Boolean; Var Total, New, Yours: LongInt) : Boolean;
Procedure GetMailStats (Var Total, UnRead: LongInt);
Function GetMatchedAddress (Orig, Dest: RecEchoMailAddr) : RecEchoMailAddr;
@ -80,6 +80,9 @@ Implementation
Uses
m_Strings,
// BBS_Records,
// BBS_Common,
BBS_DataBase,
bbs_Core,
bbs_User,
bbs_NodeInfo,
@ -303,6 +306,7 @@ Begin
Result := (Temp > 0) and (Temp < 5);
End;
(*
Function TMsgBase.OpenCreateBase (Var Msg: PMsgBaseABS; Var Area: RecMessageBase) : Boolean;
Begin
Result := False;
@ -327,6 +331,7 @@ Begin
Result := True;
End;
*)
Function TMsgBase.GetBaseByNum (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
Var
@ -374,6 +379,7 @@ Begin
Result := Count = Num;
End;
(*
Function TMsgBase.GetBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
Var
F : File;
@ -395,6 +401,7 @@ Begin
Close (F);
End;
*)
Function TMsgBase.GetTotalBases (Compressed: Boolean) : LongInt;
Var
@ -429,7 +436,7 @@ Begin
If TempBase.Name = 'None' Then Exit;
If OpenCreateBase(TempMsg, TempBase) Then Begin
If MBaseOpenCreate(TempMsg, TempBase, Session.TempPath) Then Begin
Result := TempMsg^.NumberOfMsgs;
TempMsg^.CloseMsgBase;
@ -449,7 +456,7 @@ Begin
If TempBase.Name = 'None' Then Exit;
If OpenCreateBase(TempMsg, TempBase) Then Begin
If MBaseOpenCreate(TempMsg, TempBase, Session.TempPath) Then Begin
Total := TempMsg^.NumberOfMsgs;
TempMsg^.SeekFirst(TempMsg^.GetLastRead(Session.User.UserNum) + 1);
@ -550,7 +557,7 @@ Begin
Read (MBaseFile, TempBase);
Close (MBaseFile);
If OpenCreateBase (MsgBase, TempBase) Then Begin
If MBaseOpenCreate (MsgBase, TempBase, Session.TempPath) Then Begin
MsgBase^.SeekFirst (1);
While MsgBase^.SeekFound Do Begin
@ -1404,7 +1411,7 @@ Begin
If Editor(Lines, ColumnValue[Session.Theme.ColumnSize] - 2, mysMaxMsgLines, False, fn_tplMsgEdit, Subj) Then Begin
Session.io.OutFull (Session.GetPrompt(107));
If Not OpenCreateBase(MsgNew, ReplyBase) Then Exit;
If Not MBaseOpenCreate(MsgNew, ReplyBase, Session.TempPath) Then Exit;
AssignMessageData(MsgNew, ReplyBase);
@ -1666,7 +1673,7 @@ Var
Session.io.OutFullLn (Session.GetPrompt(318));
If Not OpenCreateBase(MsgNew, TempBase) Then Break;
If Not MBaseOpenCreate(MsgNew, TempBase, Session.TempPath) Then Break;
MsgNew^.StartNewMsg;
@ -3151,7 +3158,7 @@ Begin
{ notifications out to the sysop for various things (configurable) }
{ also could be used in mass email rewrite and qwk .REP rewrite }
If Not OpenCreateBase(MsgBase, MBase) Then Begin
If Not MBaseOpenCreate(MsgBase, MBase, Session.TempPath) Then Begin
MBase := Old;
Session.User.IgnoreGroup := SaveGroup;
@ -3238,7 +3245,7 @@ Begin
Exit;
End;
If OpenCreateBase (MsgBase, MBase) Then Begin
If MBaseOpenCreate (MsgBase, MBase, Session.TempPath) Then Begin
MsgBase^.SeekFirst (1);
While MsgBase^.SeekFound Do Begin
@ -3288,7 +3295,8 @@ End;
Procedure TMsgBase.SetMessagePointers (ForceGlobal: Boolean);
Var
NewDate : LongInt;
NewDate : LongInt;
TempBase : RecMessageBase;
Procedure UpdateBase;
Var
@ -3296,12 +3304,12 @@ Var
Begin
Found := False;
Case MBase.BaseType of
Case TempBase.BaseType of
0 : MsgBase := New(PMsgBaseJAM, Init);
1 : MsgBase := New(PMsgBaseSquish, Init);
End;
MsgBase^.SetMsgPath (MBase.Path + MBase.FileName);
MsgBase^.SetMsgPath (TempBase.Path + TempBase.FileName);
If MsgBase^.OpenMsgBase Then Begin
MsgBase^.SeekFirst(1);
@ -3344,14 +3352,18 @@ Begin
If ForceGlobal Then Begin
ioReset (MBaseFile, SizeOf(RecMessageBase), fmRWDN);
ioRead (MBaseFile, MBase);
ioRead (MBaseFile, TempBase);
While Not Eof(MBaseFile) Do Begin
ioRead (MBaseFile, MBase);
ioRead (MBaseFile, TempBase);
UpdateBase;
End;
End Else
End Else Begin
TempBase := MBase;
UpdateBase;
End;
End;
Procedure TMsgBase.MessageNewScan (Data: String);
@ -3844,7 +3856,7 @@ Begin
// 3) add autosig? if we cannot use the assignmsgdata things
Result := False;
If Not OpenCreateBase(Msg, mArea) Then Exit;
If Not MBaseOpenCreate(Msg, mArea, Session.TempPath) Then Exit;
Msg^.StartNewMsg;
Msg^.SetLocal (True);
@ -4238,7 +4250,7 @@ Var
Begin
MsgAdded := 0;
If Not OpenCreateBase(MsgBase, MBase) Then Exit;
If Not MBaseOpenCreate(MsgBase, MBase, Session.TempPath) Then Exit;
Session.io.OutFull (Session.GetPrompt(231));
@ -4389,7 +4401,7 @@ Begin
FileMode := 66;
Old := MBase;
Temp := strPadR('Produced By ' + mysSoftwareID + ' v' + mysVersion + '. ' + CopyID, 128, ' ');
Temp := strPadR('Produced By ' + mysSoftwareID + ' v' + mysVersion + '. ' + mysCopyNotice, 128, ' ');
Assign (DataFile, Session.TempPath + 'messages.dat');
ReWrite (DataFile, 1);
@ -4484,13 +4496,14 @@ Begin
Dispose(MsgBase, Done);
End;
Close (QwkLRFile);
Close (MBaseFile);
End;
End Else
Session.io.OutFullLn (Session.GetPrompt(228));
Session.User.IgnoreGroup := False;
Close (MBaseFile);
// Close (MBaseFile);
MBase := Old;
@ -4521,7 +4534,7 @@ Var
Begin
OldBase := MBase;
If GetBaseByIndex(Idx, MBase) Then Begin
If GetMBaseByIndex(Idx, MBase) Then Begin
GetMessageScan;
MScan.QwkScan := Mode;
@ -4580,9 +4593,9 @@ Begin
QwkBlock[0] := #7;
If GetBaseByIndex(strS2I(QwkBlock), TempBase) Then Begin
If GetMBaseByIndex(strS2I(QwkBlock), TempBase) Then Begin
If OpenCreateBase(MsgBase, TempBase) Then Begin
If MBaseOpenCreate(MsgBase, TempBase, Session.TempPath) Then Begin
AssignMessageData(MsgBase, TempBase);

View File

@ -7,7 +7,7 @@ Unit BBS_MsgBase_ABS;
Interface
Uses
bbs_dataBase;
BBS_Records;
Type
MsgMailType = (mmtNormal, mmtEchoMail, mmtNetMail);

View File

@ -6,8 +6,7 @@ Interface
Uses
m_Strings,
BBS_Common,
bbs_dataBase;
BBS_Records;
Type
RecAnsiBufferChar = Record

View File

@ -11,9 +11,9 @@ Interface
Uses
m_Strings,
bbs_Common,
bbs_dataBase,
bbs_MsgBase_ABS;
BBS_Records,
BBS_Common,
BBS_MsgBase_ABS;
Const
JamIdxBufSize = 200;

View File

@ -1,19 +1,13 @@
Unit bbs_MsgBase_QWK;
// networking notes:
// no control files
// no file list
// no index files
// extended = selectable by user's setting
// archive = selectable by user's setting
{$I M_OPS.PAS}
Interface
Uses
m_FileIO,
bbs_DataBase;
BBS_Records,
BBS_DataBase;
Const
QWK_EOL = #13#10;
@ -48,26 +42,29 @@ Type
Pos : LongInt;
End;
TQWKEngine_HasAccess = Function (AcsStr: String) : Boolean;
TQWKEngine_HasAccess = Function (AcsStr: String) : Boolean;
TQWKEngine_Status = Procedure (Sender: Pointer; State: Byte);
TQWKEngine = Class
StatusUpdate : TQWKEngine_Status;
HasAccess : TQWKEngine_HasAccess;
IsExtended : Boolean;
IsNetworked : Boolean;
WorkPath : String;
PacketID : String;
UserRecord : RecUser;
UserNumber : Cardinal;
HasAccess : TQWKEngine_HasAccess;
TotalMessages : Cardinal;
TotalBases : Cardinal;
TotalMessages : LongInt;
TotalBases : LongInt;
RepOK : LongInt;
RepFailed : LongInt;
RepBaseAdd : LongInt;
RepBaseDel : LongInt;
DataFile : TFileBuffer;
MBase : RecMessageBase;
Constructor Create (QwkPath, QwkID: String; UN: Cardinal; UR: RecUser);
Procedure LONG2MSB (Index : LongInt; Var MS : BSingle);
Procedure LONG2MSB (Index: LongInt; Var MS: BSingle);
Procedure WriteDOORID;
Procedure WriteTOREADEREXT;
Procedure WriteCONTROLDAT;
@ -80,7 +77,10 @@ Implementation
Uses
m_Strings,
m_DateTime;
m_DateTime,
BBS_MsgBase_ABS,
BBS_MsgBase_JAM,
BBS_MsgBase_Squish;
Constructor TQWKEngine.Create (QwkPath, QwkID: String; UN: Cardinal; UR: RecUser);
Begin
@ -208,7 +208,7 @@ Begin
Write (TempFile, QWK_EOL);
Write (TempFile, QWK_EOL);
Write (TempFile, bbsCfg.SysopName + QWK_EOL);
Write (TempFile, '0,' + bbsCfg.qwkBBSID + QWK_EOL);
Write (TempFile, '0,' + PacketID + QWK_EOL);
Write (TempFile, DateDos2Str(CurDateDos, 1), ',', TimeDos2Str(CurDateDos, 0) + QWK_EOL);
Write (TempFile, strUpper(UserRecord.Handle) + QWK_EOL);
Write (TempFile, QWK_EOL);
@ -254,6 +254,7 @@ Var
LastRead : LongInt;
QwkIndex : LongInt;
TooBig : Boolean;
MsgBase : PMsgBaseABS;
Procedure DoString (Str: String);
Var
@ -275,7 +276,7 @@ Var
Begin
MsgAdded := 0;
If Not OpenCreateBase(MsgBase, MBase) Then Exit;
If Not MBaseOpenCreate(MsgBase, MBase, WorkPath) Then Exit;
LastRead := MsgBase^.GetLastRead(UserNumber) + 1;
@ -285,24 +286,24 @@ Begin
If Not IsNetworked Then
If ((bbsCfg.QwkMaxBase > 0) and (MsgAdded = bbsCfg.QwkMaxBase)) or
((bbsCfg.QwkMaxPacket > 0) and (TotalMsgs = bbsCfg.QwkMaxPacket)) Then Break;
((bbsCfg.QwkMaxPacket > 0) and (TotalMessages = bbsCfg.QwkMaxPacket)) Then Break;
MsgBase^.MsgStartUp;
If MsgBase^.IsPriv And Not Session.User.IsThisUser(MsgBase^.GetTo) Then Begin
If MsgBase^.IsPriv And Not IsThisUser(UserRecord, MsgBase^.GetTo) Then Begin
MsgBase^.SeekNext;
Continue;
End;
Inc (MsgAdded);
Inc (TotalMsgs);
Inc (TotalMessages);
LastRead := MsgBase^.GetMsgNum;
Chunks := 0;
BufStr := '';
TooBig := False;
QwkIndex := FileSize(DataFile) DIV 128 + 1;
QwkIndex := DataFile.FileSizeRaw DIV 128 + 1;
MsgBase^.MsgTxtStartUp;
@ -335,13 +336,15 @@ Begin
' ' +
' ';
If MsgAdded = 1 Then Begin
Assign (NdxFile, WorkPath + strPadL(strI2S(MBase.Index), 3, '0') + '.ndx');
ReWrite (NdxFile);
End;
If Not IsNetworked Then Begin
If MsgAdded = 1 Then Begin
Assign (NdxFile, WorkPath + strPadL(strI2S(MBase.Index), 3, '0') + '.ndx');
ReWrite (NdxFile);
End;
LONG2MSB (QwkIndex, NdxHdr.MsgPos);
Write (NdxFile, NdxHdr);
LONG2MSB (QwkIndex, NdxHdr.MsgPos);
Write (NdxFile, NdxHdr);
End;
DataFile.WriteBlock (Header[1], 128);
@ -386,9 +389,11 @@ Begin
MsgBase^.SeekNext;
End;
If MsgAdded > 0 Then Close (NdxFile);
If Not IsNetworked And (MsgAdded > 0) Then
Close (NdxFile);
MsgBase^.CloseMsgBase;
Dispose (MsgBase, Done);
Result := LastRead;
@ -400,7 +405,6 @@ Var
QwkLR : QwkLRRec;
QwkLRFile : File of QwkLRRec;
MBaseFile : File;
MBase : RecMessageBase;
MScan : MScanRec;
Begin
DataFile := TFileBuffer.Create(4 * 1024);
@ -432,6 +436,8 @@ Begin
GetMessageScan (UserNumber, MBase, MScan);
If MScan.QwkScan > 0 Then Begin
Inc (TotalBases);
QwkLR.Base := FilePos(MBaseFile);
QwkLR.Pos := WriteMSGDAT;
@ -460,520 +466,3 @@ Begin
End;
End.
Function TMsgBase.WriteMSGDAT (Extended: Boolean) : LongInt;
Var
DataFile : File;
NdxFile : File of QwkNdxHdr;
NdxHdr : QwkNdxHdr;
Header : String[128];
Chunks : Word;
BufStr : String[128];
MsgAdded : Integer;
LastRead : LongInt;
QwkIndex : LongInt;
TooBig : Boolean;
Procedure DoString (Str: String);
Var
Count : SmallInt;
Begin
For Count := 1 to Length(Str) Do Begin
BufStr := BufStr + Str[Count];
If BufStr[0] = #128 Then Begin
BlockWrite (DataFile, BufStr[1], 128);
BufStr := '';
End;
End;
End;
Var
TempStr : String;
Begin
MsgAdded := 0;
If Not OpenCreateBase(MsgBase, MBase) Then Exit;
Session.io.OutFull (Session.GetPrompt(231));
Assign (DataFile, Session.TempPath + 'messages.dat');
Reset (DataFile, 1);
Seek (DataFile, FileSize(DataFile));
LastRead := MsgBase^.GetLastRead(Session.User.UserNum) + 1;
MsgBase^.SeekFirst (LastRead);
While MsgBase^.SeekFound Do Begin
If ((bbsCfg.QwkMaxBase > 0) and (MsgAdded = bbsCfg.QwkMaxBase)) or
((bbsCfg.QwkMaxPacket > 0) and (TotalMsgs = bbsCfg.QwkMaxPacket)) Then Break;
MsgBase^.MsgStartUp;
If MsgBase^.IsPriv And Not Session.User.IsThisUser(MsgBase^.GetTo) Then Begin
MsgBase^.SeekNext;
Continue;
End;
Inc (MsgAdded);
Inc (TotalMsgs);
LastRead := MsgBase^.GetMsgNum;
Chunks := 0;
BufStr := '';
TooBig := False;
QwkIndex := FileSize(DataFile) DIV 128 + 1;
MsgBase^.MsgTxtStartUp;
While Not MsgBase^.EOM Do Begin
TempStr := MsgBase^.GetString(79);
If TempStr[1] = #1 Then Continue;
Inc (Chunks, Length(TempStr));
End;
If Chunks MOD 128 = 0 Then
Chunks := Chunks DIV 128 + 1
Else
Chunks := Chunks DIV 128 + 2;
Header :=
' ' +
strPadR(strI2S(MsgBase^.GetMsgNum), 7, ' ') +
MsgBase^.GetDate +
MsgBase^.GetTime +
strPadR(strUpper(MsgBase^.GetTo), 25, ' ') +
strPadR(strUpper(MsgBase^.GetFrom), 25, ' ') +
strPadR(strUpper(MsgBase^.GetSubj), 25, ' ') +
strPadR('', 12, ' ') +
strPadR(strI2S(MsgBase^.GetRefer), 8, ' ') +
strPadR(strI2S(Chunks), 6, ' ') +
#255 +
' ' +
' ' +
' ';
If MsgAdded = 1 Then Begin
Assign (NdxFile, Session.TempPath + strPadL(strI2S(MBase.Index), 3, '0') + '.ndx');
ReWrite (NdxFile);
End;
LONG2MSB (QwkIndex, NdxHdr.MsgPos);
Write (NdxFile, NdxHdr);
BlockWrite (DataFile, Header[1], 128);
If Extended Then Begin
If Length(MsgBase^.GetFrom) > 25 Then Begin
DoString('From: ' + MsgBase^.GetFrom + #227);
TooBig := True;
End;
If Length(MsgBase^.GetTo) > 25 Then Begin
DoString('To: ' + MsgBase^.GetTo + #227);
TooBig := True;
End;
If Length(MsgBase^.GetSubj) > 25 Then Begin
DoString('Subject: ' + MsgBase^.GetSubj + #227);
TooBig := True;
End;
If TooBig Then DoString(#227);
End;
MsgBase^.MsgTxtStartUp;
While Not MsgBase^.EOM Do Begin
TempStr := MsgBase^.GetString(79) + #227;
If TempStr[1] = #1 Then Continue;
DoString (TempStr);
End;
If BufStr <> '' Then Begin
BufStr := strPadR (BufStr, 128, ' ');
BlockWrite (DataFile, BufStr[1], 128);
End;
MsgBase^.SeekNext;
End;
Close (DataFile);
If MsgAdded > 0 Then Close (NdxFile);
Session.io.PromptInfo[1] := strI2S(MBase.Index);
Session.io.PromptInfo[2] := MBase.Name;
Session.io.PromptInfo[3] := MBase.QwkName;
Session.io.PromptInfo[4] := strI2S(MsgBase^.NumberOfMsgs);
Session.io.PromptInfo[5] := strI2S(MsgAdded);
MsgBase^.CloseMsgBase;
Dispose (MsgBase, Done);
Session.io.OutBS (Screen.CursorX, True);
Session.io.OutFullLn (Session.GetPrompt(232));
Result := LastRead;
End;
Procedure TMsgBase.DownloadQWK (Extended: Boolean; Data: String);
Type
QwkLRRec = Record
Base : Word;
Pos : LongInt;
End;
Var
Old : RecMessageBase;
DataFile : File;
Temp : String;
QwkLR : QwkLRRec;
QwkLRFile : File of QwkLRRec;
Begin
If Session.User.ThisUser.QwkFiles Then
Session.FileBase.ExportFileList(True, True);
FileMode := 66;
Old := MBase;
Temp := strPadR('Produced By ' + mysSoftwareID + ' v' + mysVersion + '. ' + CopyID, 128, ' ');
Assign (DataFile, Session.TempPath + 'messages.dat');
ReWrite (DataFile, 1);
BlockWrite (DataFile, Temp[1], 128);
Close (DataFile);
Assign (QwkLRFile, Session.TempPath + 'qlr.dat');
ReWrite (QwkLRFile);
Reset (MBaseFile);
Session.io.OutFullLn (Session.GetPrompt(230));
TotalMsgs := 0;
TotalConf := 0;
Session.User.IgnoreGroup := Pos('/ALLGROUP', strUpper(Data)) > 0;
While Not Eof(MBaseFile) Do Begin
Read (MBaseFile, MBase);
If Session.User.Access(MBase.ReadACS) Then Begin
Inc (TotalConf);
GetMessageScan;
If MScan.QwkScan > 0 Then Begin
QwkLR.Base := FilePos(MBaseFile);
QwkLR.Pos := WriteMsgDAT(Extended);
Write (QwkLRFile, QwkLR);
End;
End;
End;
Close (QwkLRFile);
WriteControlDAT (Extended);
WriteDOORID (Extended);
If Extended Then WriteTOREADEREXT;
If TotalMsgs > 0 Then Begin
Session.io.PromptInfo[1] := strI2S(TotalMsgs);
Session.io.PromptInfo[2] := strI2S(TotalConf);
Session.io.OutFullLn (Session.GetPrompt(233));
Temp := bbsCfg.qwkBBSID + '.qwk';
Session.io.OutFullLn (Session.GetPrompt(234));
Session.io.PromptInfo[1] := Temp;
If FileExist(bbsCfg.QwkWelcome) Then FileCopy(bbsCfg.qwkWelcome, Session.TempPath + JustFile(bbsCfg.qwkWelcome));
If FileExist(bbsCfg.QwkNews) Then FileCopy(bbsCfg.qwkNews, Session.TempPath + JustFile(bbsCfg.qwkNews));
If FileExist(bbsCfg.QwkGoodbye) Then FileCopy(bbsCfg.qwkGoodbye, Session.TempPath + JustFile(bbsCfg.qwkGoodbye));
// Session.SystemLog('DEBUG: Archiving QWK packet');
If Session.LocalMode Then Begin
FileErase (bbsCfg.QWKPath + Temp);
Session.FileBase.ExecuteArchive (bbsCfg.QWKPath + Temp, Session.User.ThisUser.Archive, Session.TempPath + '*', 1);
Session.io.OutFullLn (Session.GetPrompt(235));
End Else Begin
Session.FileBase.ExecuteArchive (Session.TempPath + Temp, Session.User.ThisUser.Archive, Session.TempPath + '*', 1);
Session.FileBase.SendFile (Session.TempPath + Temp);
End;
If Session.io.GetYN (Session.GetPrompt(236), True) Then Begin
Reset (MBaseFile);
Reset (QwkLRFile);
While Not Eof(QwkLRFile) Do Begin
Read (QwkLRFile, QwkLR);
Seek (MBaseFile, QwkLR.Base - 1);
Read (MBaseFile, MBase);
Case MBase.BaseType of
0 : MsgBase := New(PMsgBaseJAM, Init);
1 : MsgBase := New(PMsgBaseSquish, Init);
End;
MsgBase^.SetMsgPath (MBase.Path + MBase.FileName);
If MsgBase^.OpenMsgBase Then Begin
MsgBase^.SetLastRead (Session.User.UserNum, QwkLR.Pos);
MsgBase^.CloseMsgBase;
End;
Dispose(MsgBase, Done);
End;
Close (QwkLRFile);
End;
End Else
Session.io.OutFullLn (Session.GetPrompt(228));
Session.User.IgnoreGroup := False;
Close (MBaseFile);
MBase := Old;
DirClean (Session.TempPath, '');
End;
Procedure TMsgBase.UploadREP;
Var
DataFile : File;
TempBase : RecMessageBase;
OldBase : RecMessageBase;
QwkHeader : QwkDATHdr;
QwkBlock : String[128];
Line : String;
A : SmallInt;
B : SmallInt;
Chunks : SmallInt;
LineCount : SmallInt;
IsControl : Boolean;
GotControl : Boolean;
ExtFile : Text;
StatOK : LongInt = 0;
StatFailed : LongInt = 0;
StatBaseAdd : LongInt = 0;
StatBaseDel : LongInt = 0;
Procedure QwkControl (Idx: LongInt; Mode: Byte);
Begin
OldBase := MBase;
If GetBaseByIndex(Idx, MBase) Then Begin
GetMessageScan;
MScan.QwkScan := Mode;
If Mode = 0 Then Inc (StatBaseDel);
If Mode = 1 Then Inc (StatBaseAdd);
SetMessageScan;
End;
MBase := OldBase;
End;
Begin
If Session.LocalMode Then
Session.FileBase.ExecuteArchive (bbsCfg.QWKPath + bbsCfg.qwkBBSID + '.rep', Session.User.ThisUser.Archive, '*', 2)
Else Begin
If Session.FileBase.SelectProtocol(True, False) = 'Q' Then Exit;
Session.FileBase.ExecuteProtocol(1, Session.TempPath + bbsCfg.qwkBBSID + '.rep');
If Not Session.FileBase.DszSearch(bbsCfg.qwkBBSID + '.rep') Then Begin
Session.io.PromptInfo[1] := bbsCfg.qwkBBSID + '.rep';
Session.io.OutFullLn (Session.GetPrompt(84));
Exit;
End;
Session.FileBase.ExecuteArchive (Session.TempPath + bbsCfg.qwkBBSID + '.rep', Session.User.ThisUser.Archive, '*', 2)
End;
Assign (DataFile, FileFind(Session.TempPath + bbsCfg.qwkBBSID + '.msg'));
If Not ioReset(DataFile, 1, fmRWDN) Then Begin
Session.io.OutFull (Session.GetPrompt(238));
DirClean (Session.TempPath, '');
Exit;
End;
BlockRead (DataFile, QwkBlock[1], 128);
QwkBlock[0] := #128;
If Pos(strUpper(bbsCfg.qwkBBSID), strUpper(QwkBlock)) = 0 Then Begin
Session.io.OutFullLn (Session.GetPrompt(239));
Close (DataFile);
DirClean(Session.TempPath, '');
Exit;
End;
Session.io.OutFull (Session.GetPrompt(240));
While Not Eof(DataFile) Do Begin
BlockRead (DataFile, QwkHeader, SizeOf(QwkHeader));
Move (QwkHeader.MsgNum, QwkBlock[1], 7);
QwkBlock[0] := #7;
If GetBaseByIndex(strS2I(QwkBlock), TempBase) Then Begin
If OpenCreateBase(MsgBase, TempBase) Then Begin
AssignMessageData(MsgBase, TempBase);
QwkBlock[0] := #25;
Move (QwkHeader.UpTo, QwkBlock[1], 25);
MsgBase^.SetTo(strStripR(QwkBlock, ' '));
Move (QwkHeader.Subject, QwkBlock[1], 25);
MsgBase^.SetSubj(strStripR(QwkBlock, ' '));
Move (QwkHeader.ReferNum, QwkBlock[1], 6);
QwkBlock[0] := #6;
MsgBase^.SetRefer(strS2I(strStripR(QwkBlock, ' ')));
Move(QwkHeader.NumChunk, QwkBlock[1], 6);
Chunks := strS2I(QwkBlock) - 1;
Line := '';
LineCount := 0;
IsControl := MsgBase^.GetTo = qwkControlName;
GotControl := False;
If IsControl And ((MsgBase^.GetSubj = 'ADD') or (MsgBase^.GetSubj = 'DROP')) Then
QwkControl (TempBase.Index, Ord(MsgBase^.GetSubj = 'ADD'));
For A := 1 to Chunks Do Begin
BlockRead (DataFile, QwkBlock[1], 128);
QwkBlock[0] := #128;
QwkBlock := strStripR(QwkBlock, ' ');
For B := 1 to Length(QwkBlock) Do Begin
If QwkBlock[B] = #227 Then Begin
Inc (LineCount);
If (LineCount < 4) and (Copy(Line, 1, 5) = 'From:') Then
GotControl := True
// Mystic uses the username of the person who uploaded the
// reply package, based on the alias/realname setting of the
// base itself. This prevents people from spoofing "From"
// fields.
// If QWK networking will need to allow this of course
Else
If (LineCount < 4) and (Copy(Line, 1, 3) = 'To:') Then Begin
MsgBase^.SetTo(strStripB(Copy(Line, 4, Length(Line)), ' '));
GotControl := True;
End Else
If (LineCount < 4) and (Copy(Line, 1, 8) = 'Subject:') Then Begin
MsgBase^.SetSubj(strStripB(Copy(Line, 9, Length(Line)), ' '));
GotControl := True;
End Else
If GotControl And (Line = '') Then
GotControl := False
Else
MsgBase^.DoStringLn(Line);
Line := '';
End Else
Line := Line + QwkBlock[B];
End;
End;
If Line <> '' Then MsgBase^.DoStringLn(Line);
If TempBase.NetType > 0 Then Begin
MsgBase^.DoStringLn (#13 + '--- ' + mysSoftwareID + '/QWK v' + mysVersion + ' (' + OSID + ')');
MsgBase^.DoStringLn (' * Origin: ' + ResolveOrigin(TempBase) + ' (' + strAddr2Str(MsgBase^.GetOrigAddr) + ')');
End;
If Not IsControl Then Begin
MsgBase^.WriteMsg;
Inc (StatOK);
Inc (Session.User.ThisUser.Posts);
Inc (Session.HistoryPosts);
End;
MsgBase^.CloseMsgBase;
Dispose (MsgBase, Done);
End Else
Inc (StatFailed);
End Else
Inc (StatFailed);
End;
Close (DataFile);
Assign (ExtFile, FileFind(Session.TempPath + 'todoor.ext'));
{$I-} Reset (ExtFile); {$I+}
If IoResult = 0 Then Begin
While Not Eof(ExtFile) Do Begin
ReadLn (ExtFile, Line);
If strWordGet(1, Line, ' ') = 'AREA' Then Begin
QwkBlock := strWordGet(3, Line, ' ');
If Pos('a', QwkBlock) > 0 Then QwkControl(strS2I(strWordGet(2, Line, ' ')), 1);
If Pos('D', QwkBlock) > 0 Then QwkControl(strS2I(strWordGet(2, Line, ' ')), 0);
End;
End;
Close (ExtFile);
End;
DirClean (Session.TempPath, '');
Session.io.PromptInfo[1] := strI2S(StatOK);
Session.io.PromptInfo[2] := strI2S(StatFailed);
Session.io.PromptInfo[3] := strI2S(StatBaseAdd);
Session.io.PromptInfo[4] := strI2S(StatBaseDel);
Session.io.OutFullLn(Session.GetPrompt(503));
End;
End.
// need one of these for the file list compiler now too which MAYBE can be
// used in MUTIL also. lets template and build that out first.. then...
// create and upload QWK/REP packets without relying on BBS specific stuff
Type
TMsgBaseQWK = Class
User : RecUser;
Extended : Boolean;
Constructor Create (UD: RecUser; Ext: Boolean);
Function CreatePacket : Boolean;
Function ProcessReply (bbsid, temppath, usernum, var user, forcefrom ): Boolean;
Destructor Destroy; Override;
End;

View File

@ -5,9 +5,8 @@ Unit BBS_MsgBase_Squish;
Interface
Uses
BBS_MsgBase_Abs,
BBS_Common,
bbs_dataBase,
BBS_Records,
BBS_MsgBase_ABS,
DOS;
Const

View File

@ -12,11 +12,12 @@ Uses
m_Strings,
m_DateTime,
m_FileIO,
bbs_NodeInfo,
bbs_Common,
bbs_dataBase,
bbs_User,
bbs_Core;
BBS_Records,
BBS_DataBase,
BBS_Common,
BBS_NodeInfo,
BBS_User,
BBS_Core;
Var
ChatSize : Integer;
@ -59,12 +60,12 @@ Begin
Read (RoomFile, Room);
Close (RoomFile);
Chat.Room := R;
Session.Chat.Room := R;
CurRoom := R;
Assign (CF, bbsCfg.DataPath + 'chat' + strI2S(Session.NodeNum) + '.dat');
Reset (CF);
Write (CF, Chat);
Write (CF, Session.Chat);
Close (CF);
Send_Node_Message (5, strI2S(Session.NodeNum) + ';' + 'Now chatting in channel ' + strI2S(CurRoom), 0); //++lang
@ -367,13 +368,13 @@ Begin
Set_Node_Action (Session.GetPrompt(347));
Avail := Chat.Available;
Chat.InChat := True;
Chat.Available := False;
Avail := Session.Chat.Available;
Session.Chat.InChat := True;
Session.Chat.Available := False;
Assign (ChatFile, bbsCfg.DataPath + 'chat' + strI2S(Session.NodeNum) + '.dat');
Reset (ChatFile);
Write (ChatFile, Chat);
Write (ChatFile, Session.Chat);
Close (ChatFile);
FileErase(Session.TempPath + 'chat.tmp');
@ -478,14 +479,14 @@ Begin
Session.io.GetKeyCallBack := NIL;
Chat.InChat := False;
Chat.Available := Avail;
Session.Chat.InChat := False;
Session.Chat.Available := Avail;
Session.AllowMessages := True;
Assign (ChatFile, bbsCfg.DataPath + 'chat' + strI2S(Session.NodeNum) + '.dat');
Reset (ChatFile);
Write (ChatFile, Chat);
Write (ChatFile, Session.Chat);
Close (ChatFile);
FileErase(Session.TempPath + 'chat.tmp');

View File

@ -5,8 +5,7 @@ Unit bbs_NodeInfo;
Interface
Uses
bbs_Common,
bbs_dataBase;
BBS_Records;
Function GetChatRecord (Node: Byte; Var Chat: ChatRec) : Boolean;
Function IsUserOnline (UserName: String) : Word;
@ -22,9 +21,11 @@ Uses
m_DateTime,
m_Strings,
m_FileIO,
bbs_Core,
bbs_User,
bbs_UserChat;
BBS_DataBase,
BBS_Common,
BBS_Core,
BBS_User,
BBS_UserChat;
Function GetChatRecord (Node: Byte; Var Chat: ChatRec) : Boolean;
Begin
@ -62,25 +63,26 @@ Begin
ReWrite (ChatFile);
If Action <> '' Then Begin
Chat.Active := True;
Chat.Name := Session.User.ThisUser.Handle;
Chat.Location := Session.User.ThisUser.City;
Chat.Action := Action;
Chat.Gender := Session.User.ThisUser.Gender;
Chat.Age := DaysAgo(Session.User.ThisUser.Birthday, 1) DIV 365;
Session.Chat.Active := True;
Session.Chat.Name := Session.User.ThisUser.Handle;
Session.Chat.Location := Session.User.ThisUser.City;
Session.Chat.Action := Action;
Session.Chat.Gender := Session.User.ThisUser.Gender;
Session.Chat.Age := DaysAgo(Session.User.ThisUser.Birthday, 1) DIV 365;
If Session.LocalMode Then
Chat.Baud := 'LOCAL' {++lang}
Session.Chat.Baud := 'LOCAL' {++lang}
Else
Chat.Baud := 'TELNET'; {++lang}
Session.Chat.Baud := 'TELNET'; {++lang}
End Else Begin
Chat.Active := False;
Chat.Invisible := False;
Chat.Available := False;
Chat.Age := 0;
Chat.Gender := '?';
Session.Chat.Active := False;
Session.Chat.Invisible := False;
Session.Chat.Available := False;
Session.Chat.Age := 0;
Session.Chat.Gender := '?';
End;
Write (ChatFile, Chat);
Write (ChatFile, Session.Chat);
Close (ChatFile);
{$IFDEF WINDOWS}

View File

@ -6,7 +6,8 @@ Interface
Uses
BBS_Common,
bbs_DataBase;
BBS_Records,
BBS_DataBase;
Type
RecNodeSearch = Record

View File

@ -8,14 +8,15 @@ Uses
m_FileIO,
m_Strings,
m_DateTime,
bbs_Common,
bbs_dataBase,
bbs_General,
bbs_MsgBase,
bbs_FileBase,
bbs_Menus,
bbs_NodeInfo,
mpl_Execute;
BBS_Records,
BBS_DataBase,
BBS_Common,
BBS_General,
BBS_MsgBase,
BBS_FileBase,
BBS_Menus,
BBS_NodeInfo,
MPL_Execute;
Type
TBBSUser = Class
@ -74,7 +75,7 @@ Type
Implementation
Uses
bbs_Core;
BBS_Core;
Constructor TBBSUser.Create (Var Owner: Pointer);
Begin
@ -166,8 +167,8 @@ Var
'M' : Res := strS2I(Data) < strS2I(Copy(TimeDos2Str(CurDateDos, 0), 4, 2));
'N' : Res := strS2I(Data) = Session.NodeNum;
'O' : Case Data[1] of
'A' : Res := Chat.Available;
'I' : Res := Chat.Invisible;
'A' : Res := Session.Chat.Available;
'I' : Res := Session.Chat.Invisible;
'K' : Res := AcsOkFlag;
'M' : Begin
Res := Access(Session.Msgs.MBase.SysopACS);
@ -1026,9 +1027,11 @@ Begin
Write (UserFile, ThisUser);
Close (UserFile);
Reset (ConfigFile);
Write (ConfigFile, bbsCfg);
Close (ConfigFile);
PutBaseConfiguration(bbsCfg);
// Reset (ConfigFile);
// Write (ConfigFile, bbsCfg);
// Close (ConfigFile);
Session.SystemLog ('Created Account: ' + ThisUser.Handle);
@ -1056,14 +1059,14 @@ Begin
{$IFDEF LOGGING} Session.SystemLog('Logon3'); {$ENDIF}
Chat.Available := True;
Session.Chat.Available := True;
If Access(bbsCfg.AcsInvisLogin) Then
Chat.Invisible := Session.io.GetYN(Session.GetPrompt(308), False);
Session.Chat.Invisible := Session.io.GetYN(Session.GetPrompt(308), False);
{ update last caller information }
If Not Session.LocalMode And Not Chat.Invisible And (ThisUser.Flags AND UserNoLastCall = 0) Then Begin
If Not Session.LocalMode And Not Session.Chat.Invisible And (ThisUser.Flags AND UserNoLastCall = 0) Then Begin
Reset (LastOnFile);
If FileSize(LastOnFile) >= 10 Then
@ -1262,7 +1265,7 @@ Begin
End;
Session.io.OutFullLn ('|CL' + mysSoftwareID + ' v' + mysVersion + ' for ' + OSID + ' Node |ND');
Session.io.OutFullLn (CopyID);
Session.io.OutFullLn (mysCopyNotice);
If bbsCfg.DefTermMode = 0 Then
GetGraphics
@ -1426,11 +1429,11 @@ Begin
Session.LoadThemeData(Data);
15 : GetEditor(True);
16 : If Access(bbsCfg.AcsInvisLogin) Then Begin
Chat.Invisible := Not Chat.Invisible;
Set_Node_Action (Chat.Action);
Session.Chat.Invisible := Not Session.Chat.Invisible;
Set_Node_Action (Session.Chat.Action);
End;
17 : GetFileList(True);
18 : Chat.Available := Not Chat.Available;
18 : Session.Chat.Available := Not Session.Chat.Available;
19 : GetHotKeys(True);
20 : GetMsgList(True);
21 : ThisUser.UseLBIndex := Not ThisUser.UseLBIndex;

View File

@ -13,10 +13,10 @@ Uses
m_Strings,
m_FileIO,
m_DateTime,
bbs_Core,
bbs_Common,
bbs_dataBase,
bbs_NodeInfo;
BBS_Records,
BBS_DataBase,
BBS_Core,
BBS_NodeInfo;
Procedure PageUserForChat;
Var

View File

@ -542,6 +542,8 @@ Begin
Console.SetWindowTitle(WinTitle);
// process command lines here and exit
If Not ServerStartup Then Begin
Console.ClearScreen;
Console.WriteLine('ERROR: No servers are configured as active.');

View File

@ -691,6 +691,9 @@ Var
Res : LongInt;
Begin
If LoggedIn Then Begin
// if name = bbsid.qwk or if user is network and name is userid.qwk then
// send file here
// else do the normal stuff
TempPos := FindDirectory(TempBase);
If TempPos = -1 Then Begin

View File

@ -7,7 +7,8 @@ Interface
Uses
DOS,
m_FileIO,
bbs_dataBase,
BBS_Records,
BBS_DataBase,
BBS_Common;
{$I MPL_TYPES.PAS}

View File

@ -33,6 +33,7 @@ Uses
m_Strings,
m_FileIO,
m_IniReader,
BBS_Records,
mUtil_Common,
mUtil_Status,
mUtil_ImportNA,

View File

@ -14,7 +14,7 @@ Uses
m_FileIO,
mUtil_Common,
mUtil_Status,
bbs_DataBase;
BBS_Records;
Const
TotalFiles : Cardinal = 0;

View File

@ -8,7 +8,7 @@ Uses
m_Output,
m_IniReader,
mutil_Status,
bbs_DataBase,
bbs_Records,
bbs_MsgBase_Abs,
bbs_MsgBase_Squish,
bbs_MsgBase_JAM;

View File

@ -9,7 +9,7 @@ Uses
m_FileIO,
m_Strings,
m_DateTime,
bbs_DataBase,
BBS_Records,
mUtil_Common;
Const

View File

@ -17,10 +17,10 @@ Uses
mUtil_Common,
mUtil_Status,
mUtil_EchoCore,
bbs_DataBase,
bbs_MsgBase_ABS,
bbs_MsgBase_JAM,
bbs_MsgBase_Squish;
BBS_Records,
BBS_MsgBase_ABS,
BBS_MsgBase_JAM,
BBS_MsgBase_Squish;
Procedure AddToFLOQueue (FloName, PacketFN: String);
Var

View File

@ -13,7 +13,7 @@ Implementation
Uses
m_Strings,
bbs_DataBase;
BBS_Records;
Function ProcessedByAreaFix (Var PKT: TPKTReader) : Boolean;
Var

View File

@ -13,7 +13,7 @@ Uses
m_FileIO,
m_Strings,
AView,
bbs_DataBase,
BBS_Records,
BBS_MsgBase_ABS,
BBS_MsgBase_JAM,
BBS_MsgBase_Squish,

View File

@ -14,7 +14,7 @@ Uses
m_FileIO,
mUtil_Common,
mUtil_Status,
bbs_DataBase;
BBS_Records;
Procedure uImportFileBone;
Var

View File

@ -14,7 +14,7 @@ Uses
m_DateTime,
mUtil_Common,
mUtil_Status,
bbs_DataBase;
BBS_Records;
Procedure uImportFilesBBS;
Var

View File

@ -14,7 +14,7 @@ Uses
m_Strings,
mUtil_Common,
mUtil_Status,
bbs_DataBase;
BBS_Records;
Procedure uImportMessageBases;
Var

View File

@ -12,7 +12,7 @@ Uses
m_Strings,
mUtil_Common,
mUtil_Status,
bbs_DataBase;
BBS_Records;
Procedure uImportNA;
Var

View File

@ -11,10 +11,10 @@ Implementation
Uses
m_FileIO,
m_Strings,
BBS_Records,
BBS_Common,
mUtil_Common,
mUtil_Status,
bbs_Common,
bbs_DataBase;
mUtil_Status;
Procedure uPostMessages;
Const

View File

@ -13,7 +13,7 @@ Uses
m_DateTime,
mUtil_Common,
mUtil_Status,
bbs_DataBase,
bbs_Records,
bbs_MsgBase_ABS,
bbs_MsgBase_JAM,
bbs_MsgBase_Squish;

View File

@ -14,7 +14,7 @@ Uses
m_FileIO,
mUtil_Common,
mUtil_Status,
bbs_DataBase;
BBS_Records;
Type
TopListType = (TopCall, TopPost, TopDL, TopUL, TopPCR);

View File

@ -13,7 +13,7 @@ Uses
m_DateTime,
mUtil_Common,
mUtil_Status,
bbs_DataBase;
BBS_Records;
Procedure uMassUpload;
Var

View File

@ -41,6 +41,7 @@ Uses
m_Output,
m_Input,
m_Pipe,
BBS_Records,
bbs_Common,
bbs_DataBase,
bbs_Core,

View File

@ -22,9 +22,10 @@
Const
mysSoftwareID = 'Mystic BBS';
mysCopyYear = '1997-2013'; // its been a long time!
mysVersion = '1.10 A37'; // current version
mysDataChanged = '1.10 A11'; // version of last records change
mysCopyYear = '1997-2013';
mysVersion = '1.10 A37';
mysDataChanged = '1.10 A11';
mysCopyNotice = 'Copyright (C) ' + mysCopyYear + ' By James Coyle';
{$IFDEF WIN32}
PathChar = '\';

View File

@ -37,6 +37,11 @@ BUGS AND POSSIBLE ISSUES
FUTURE / IDEAS / WORK IN PROGRESS / NOTES
=========================================
- externalize qwk and file list compiler class. qwk for mystic/mis filelist
for mystic/mutil. add compiler templates, file include, and new vs all
generation for all.
- abstract ansi browser to be used for ansi archive viewer and sysop file
manager (as well as the ANSI gallery).
- when mutil is tossing a packet and auto creates an area figure out if there
can be a way to automatically create the uplink back to the originating
node.
@ -49,7 +54,6 @@ FUTURE / IDEAS / WORK IN PROGRESS / NOTES
way which i think is the best approach actually.
- ESC moves back in ANSI gallery only exits if dir = root?
- Color, boxtype, and input configuration for configuration
- Toggle base scan settings Select [A]ll, [D]eselect All
- global file editor like msg base
- redo voting booth externalize user storage and allow unlimited questions
plus maybe categories. or at least up it to like 50 questions or
@ -64,7 +68,6 @@ FUTURE / IDEAS / WORK IN PROGRESS / NOTES
- Echomail export saves last scanned pointers
- Echomail export support for netmail routing
- FileFix / TIC
- Add "Add Export To" to global msgbase editor. Also Del Export?
! Use NetReply in RecMB also Reply to another base?
- QWK put/get per individual users via FTP
- EXCLUDE from all files list. important.
@ -78,10 +81,6 @@ FUTURE / IDEAS / WORK IN PROGRESS / NOTES
- MUTILs new DIR import of msg bases could have optional config to reference
a series of .NA files to get the name/description of bases.
- QWK via email
- Either add Public/Private fusion type message base or allow reply via
email or netmail option.
- mUTIL scans MSGS directory and auto-creates anything that has data files
not related to a BBS message base.. uses a template
- Blind upload for single file upload (also message upload)
- Email validation
- Recode FCHECK into MUTIL, but also add the option to phsyically delete the
@ -91,8 +90,8 @@ FUTURE / IDEAS / WORK IN PROGRESS / NOTES
- Outbound telnet feature
- Add "PREVIEW" option to message editors
- Finish Threaded message reader
- Gallows Pole MPL
- Add "high roller/smack talk" into BlackJack
- Add better MIS logging per server (connect, refuse, blocked, etc)
- BBS email autoforwarded to Internet email
- Ability to send internet email to people from within the BBS.
- ANSI post-processor for message uploads via FSE
@ -131,7 +130,6 @@ FUTURE / IDEAS / WORK IN PROGRESS / NOTES
- ANSI message upload post processor option: Auto/Disabled/Ask
- Finish optional user prompts
- MCI code for FS ansi viewer?
- MCI code for # of files in current file area
- Redo random ANSI system to use A-Z instead of 1-9 can have upgrade util
rename them automatically.
- LastOn revamp make sure its not global and new stuff is populated
@ -279,8 +277,6 @@ ReplaceLine
- Needs additional research
! POSSIBLE removal of local console in Windows and STDIO usage in Linux
^ Massive performance increase possible here as well as:
! POSSIBLE FTN tosser.
! POSSIBLE FTN mailer (transx, FTP, binkP)
! MIS event system (possible 1.10)
! Password reset via email (possible 1.10)
! Email verification system (for access upgrades) (possible 1.10)
@ -290,4 +286,59 @@ ReplaceLine
- Rewrite of MBBSWEB or integrated HTML server? still need a good designer
that actually will put a lot of time into it
- Rewrite of ANSI template system (.ini files or mystic2 format?)
! Revamp logging system and add additional logging to MIS
=================================================
CODE RESTRUCTURE naming (possibly remove mystic_ prefix):
mystic
mystic_records
mystic_common (called db now)
mystic_server_binkp
mystic_server_telnet
mystic_server_ftp
mystic_server_pop3
mystic_server
mystic_client
mystic_client_smtp
mystic_server_events
mystic_cmd_server
mystic_cmd_fidopoll
mystic_cmd_terminal
mystic_class_binkp
mystic_class_qwk
mystic_class_menudata
mystic_class_msgbase
mystic_class_msgbase_jam
mystic_class_msgbase_squish
mystic_class_arcview
mystic_class_arcview_zip
mystic_class_arcview_rar
mystic_class_nodelist
mystic_class_logging (on-the-fly log rolling, trimming, etc)
mystic_config_filearea
mystic_ansi_intro
mystic_ansi_monitor
mystic_ansi_terminal
mystic_bbs_core
mystic_bbs_msgbase
mystic_bbs_filebase
mystic_bbs_general
mystic_bbs_doors
mystic_bbs_user
mystic_bbs_nodechat
mystic_bbs_userchat
mystic_bbs_sysopchat
mystic_bbs_ansibox
mystic_bbs_ansimenu
mystic_bbs_ansihelp
mystic_bbs_ansiinput
mystic_bbs_ansidir
mystic_bbs_lineedit
mystic_bbs_fulledit
mystic_bbs_menus
mystic_bbs_io
mystic_bbs_mplexecute
mystic_bbs_mpltypes
mystic_bbs_mplcommon
mystic_bbs_mplcompile

View File

@ -3588,4 +3588,7 @@
wants to update their current base, and will instead force the update for
all message bases.
! Mystic was changing the user's message base to the last base processed
when globally resetting the new message scan date.
<ALPHA 37 RELEASED>