-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdropfiles.pas
353 lines (251 loc) · 10.1 KB
/
dropfiles.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
unit DropFiles;
{$mode objfpc}{$h+}
interface
uses
Classes, SysUtils;
procedure ReadDoor32(AFileName: String);
procedure ReadDoorSys(AFileName: String);
procedure ReadDorinfo(AFileName: String);
procedure ReadLordInfo(AFileName: String);
implementation
uses
Door;
{
Read the DOOR32.SYS file AFILE
}
procedure ReadDoor32(AFileName: String);
var
F: Text;
S: String;
begin
if (FileExists(AFileName)) then
begin
Assign(F, AFileName);
{$I-}Reset(F);{$I+}
if (IOResult = 0) then
begin
ReadLn(F, S); {1 - Comm Type (0=Local, 1=Serial, 2=Telnet)}
DoorDropInfo.ComType := StrToIntDef(S, 0);
ReadLn(F, S); {2 - Comm Or Socket Handle}
DoorDropInfo.ComNum := StrToIntDef(S, -1);
ReadLn(F, S); {3 - Baud Rate}
DoorDropInfo.Baud := StrToIntDef(S, 38400);
ReadLn(F, S); {4 - BBSID (Software Name & Version}
ReadLn(F, S); {5 - User's Record Position (1 Based)}
DoorDropInfo.RecPos := StrToIntDef(S, 1) - 1;
ReadLn(F, S); {6 - User's Real Name}
DoorDropInfo.RealName := S;
ReadLn(F, S); {7 - User's Handle/Alias}
DoorDropInfo.Alias := S;
ReadLn(F, S); {8 - User's Access Level}
DoorDropInfo.Access := StrToIntDef(S, 0);
ReadLn(F, S); {9 - User's Time Left (In Minutes)}
DoorDropInfo.MaxSeconds := StrToIntDef(S, 0) * 60;
ReadLn(F, S); {10 - Emulation (0=Ascii, 1=Ansi, 2=Avatar, 3=RIP, 4=MaxGfx)}
if (StrToIntDef(S, 1) = 0) then
DoorDropInfo.Emulation := etASCII
else
DoorDropInfo.Emulation := etANSI;
ReadLn(F, S); {11 - Current Node Number}
DoorDropInfo.Node := StrToIntDef(S, 0);
Close(F);
end;
end;
end;
{
Read the DOOR.SYS file AFILE
}
procedure ReadDoorSys(AFileName: String);
var
F: Text;
S: String;
begin
if (FileExists(AFileName)) then
begin
Assign(F, AFileName);
{$I-}Reset(F);{$I+}
if (IOResult = 0) then
begin
ReadLn(F, S); {1 - Comm Or Socket Handle}
DoorDropInfo.ComNum := StrToIntDef(Copy(S, 4, Length(S) - 4), 0);
if (DoorDropInfo.ComNum > 0) then
DoorDropInfo.ComType := 1;
ReadLn(F, S); {2 - Line Speed}
ReadLn(F, S); {3 - Data Bits}
ReadLn(F, S); {4 - Current Node Number}
DoorDropInfo.Node := StrToIntDef(S, 0);
ReadLn(F, S); {5 - Modem Speed}
DoorDropInfo.Baud := StrToIntDef(S, 38400);
ReadLn(F, S); {6 - Screen Display}
ReadLn(F, S); {7 - Syslog Printer}
ReadLn(F, S); {8 - Page Bell}
ReadLn(F, S); {9 - Caller Alarm}
ReadLn(F, S); {10 - User's Real Name}
DoorDropInfo.RealName := S;
ReadLn(F, S); {11 - City, State}
ReadLn(F, S); {12 - Phone Number}
ReadLn(F, S); {13 - Data Phone Number}
ReadLn(F, S); {14 - Password}
ReadLn(F, S); {15 - User's Access Level}
DoorDropInfo.Access := StrToIntDef(S, 0);
ReadLn(F, S); {16 - Number Of Logons}
ReadLn(F, S); {17 - Date Last Logged On}
ReadLn(F, S); {18 - User's Time Left (In Seconds)}
DoorDropInfo.MaxSeconds := StrToIntDef(S, 0);
ReadLn(F, S); {19 - User's Time Left (In Minutes)}
ReadLn(F, S); {20 - Emulation (GR=Ansi, NG=Ascii, 7E=7-Bit)}
if (UpperCase(S) = 'GR') then
DoorDropInfo.Emulation := etANSI
else
DoorDropInfo.Emulation := etASCII;
ReadLn(F, S); {21 - Lines On Screen}
ReadLn(F, S); {22 - Menu Status}
ReadLn(F, S); {23 - Conferences}
ReadLn(F, S); {24 - Current Conference}
ReadLn(F, S); {25 - Expiration Date}
ReadLn(F, S); {26 - User's Record Position (1 Based)}
DoorDropInfo.RecPos := StrToIntDef(S, 1) - 1;
ReadLn(F, S); {27 - Default Protocol}
ReadLn(F, S); {28 - kB Uploaded}
ReadLn(F, S); {29 - kB Downloaded}
ReadLn(F, S); {30 - Downloaded Today}
ReadLn(F, S); {31 - Maximum Downloaded Today}
ReadLn(F, S); {32 - User's Birthday}
ReadLn(F, S); {33 - BBS Data Directory}
ReadLn(F, S); {34 - BBS Text Files Directory}
ReadLn(F, S); {35 - SysOp Name}
ReadLn(F, S); {36 - User's Handle/Alias}
DoorDropInfo.Alias := S;
ReadLn(F, S); {37 - Event Time}
ReadLn(F, S); {38 - Dont Know}
ReadLn(F, S); {39 - Ansi Ok But Disable Graphics}
ReadLn(F, S); {40 - Record Locking}
ReadLn(F, S); {41 - Base Text Colour}
ReadLn(F, S); {42 - Time In Time Bank}
ReadLn(F, S); {43 - Last New Message Scan Date}
ReadLn(F, S); {44 - Dont Know}
ReadLn(F, S); {45 - Time Last Call}
ReadLn(F, S); {46 - Max Files Downloaded Per Day}
ReadLn(F, S); {47 - Number Of Files Downloaded Today}
ReadLn(F, S); {48 - kB Uploaded}
ReadLn(F, S); {49 - kB Downloaded}
ReadLn(F, S); {50 - User Note}
ReadLn(F, S); {51 - Number Of Doors Run}
ReadLn(F, S); {52 - Number Of Messages Posted}
Close(F);
end;
end;
end;
{
Read the DORINFO*.DEF file AFILE
}
procedure ReadDorinfo(AFileName: String);
var
F: Text;
S: String;
begin
if (FileExists(AFileName)) then
begin
Assign(F, AFileName);
{$I-}Reset(F);{$I+}
if (IOResult = 0) then
begin
ReadLn(F, S); {1 - BBS Name}
ReadLn(F, S); {2 - Sysop's First Name}
ReadLn(F, S); {3 - Sysop's Last Name}
ReadLn(F, S); {4 - Comm Number in COMxxx Form}
DoorDropInfo.ComNum := StrToIntDef(Copy(S, 4, Length(S) - 3), 0);
if (DoorDropInfo.ComNum > 0) then
DoorDropInfo.ComType := 1;
ReadLn(F, S); {5 - Baud Rate in 57600 BAUD,N,8,1 Form}
DoorDropInfo.Baud := StrToIntDef(Copy(S, 1, Pos(' ', S) - 1), 38400);
ReadLn(F, S); {6 - Networked?}
ReadLn(F, S); {7 - User's First Name / Alias}
DoorDropInfo.Alias := S;
ReadLn(F, S); {8 - User's Last Name}
if (S = '') then
DoorDropInfo.RealName := DoorDropInfo.Alias
else
DoorDropInfo.RealName := DoorDropInfo.Alias + ' ' + S;
ReadLn(F, S); {9 - User's Location (City, State, etc.)}
ReadLn(F, S); {10 - User's Emulation (1=Ansi)}
if (StrToIntDef(S, 1) = 1) then
DoorDropInfo.Emulation := etANSI
else
DoorDropInfo.Emulation := etASCII;
ReadLn(F, S); {11 - User's Access Level}
DoorDropInfo.Access := StrToIntDef(S, 0);
ReadLn(F, S); {12 - User's Time Left (In Minutes)}
DoorDropInfo.MaxSeconds := StrToIntDef(S, 0) * 60;
ReadLn(F, S); {13 - Fossil?}
Close(F);
end;
end;
end;
{
Read the INFO.* file AFILE
}
procedure ReadLordInfo(AFileName: String);
var
F: Text;
S: String;
begin
if (FileExists(AFileName)) then
begin
Assign(F, AFileName);
{$I-}Reset(F);{$I+}
if (IOResult = 0) then
begin
ReadLn(F, S); {1 - Account Number (0 Based)}
DoorDropInfo.RecPos := StrToIntDef(S, 0);
ReadLn(F, S); {2 - Emulation (3=Ansi, Other = Ascii)}
if (StrToIntDef(S, 3) = 3) then
DoorDropInfo.Emulation := etANSI
else
DoorDropInfo.Emulation := etASCII;
ReadLn(F, S); {3 - RIP YES or RIP NO}
ReadLn(F, S); {4 - FAIRY YES or FAIRY NO}
if (UpperCase(S) = 'FAIRY YES') then
DoorDropInfo.Fairy := True
else
DoorDropInfo.Fairy := False;
ReadLn(F, S); {5 - User's Time Left (In Minutes)}
DoorDropInfo.MaxSeconds := StrToIntDef(S, 0) * 60;
ReadLn(F, S); {6 - User's Handle/Alias}
DoorDropInfo.Alias := S;
ReadLn(F, S); {7 - User's First Name}
DoorDropInfo.RealName := S;
ReadLn(F, S); {8 - User's Last Name}
if (S <> '') then
DoorDropInfo.RealName := DoorDropInfo.RealName + ' ' + S;
ReadLn(F, S); {9 - Comm Port}
DoorDropInfo.ComNum := StrToIntDef(S, 0);
ReadLn(F, S); {10 - Caller Baud Rate}
DoorDropInfo.Baud := StrToIntDef(S, 38400);
ReadLn(F, S); {11 - Port Baud Rate}
ReadLn(F, S); {12 - FOSSIL or INTERNAL}
if (UpperCase(S) = 'LOCAL') then
DoorDropInfo.ComType := 0
else
if (UpperCase(S) = 'TELNET') then
DoorDropInfo.ComType := 2
else
if (UpperCase(S) = 'WC5') then
DoorDropInfo.ComType := 3
else
DoorDropInfo.ComType := 1;
ReadLn(F, S); {13 - REGISTERED or UNREGISTERED}
if (UpperCase(S) = 'REGISTERED') then
DoorDropInfo.Registered := True
else
DoorDropInfo.Registered := False;
ReadLn(F, S); {14 - CLEAN MODE ON or CLEAN MODE OFF}
if (UpperCase(S) = 'CLEAN MODE ON') then
DoorDropInfo.Clean := True
else
DoorDropInfo.Clean := False;
Close(F);
end;
end;
end;
end.