-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultnode.pas
1242 lines (1159 loc) · 36.9 KB
/
multnode.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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-}
Unit Multnode;
Interface
Uses crt, overlay, common;
procedure list_nodes;
procedure toggle_chat_avail;
procedure page_user;
procedure check_status;
procedure multiline_Chat;
procedure dump_node;
procedure send_message(const b:astr);
implementation
uses ShortMsg, Script, timefunc, menus, doors;
procedure pick_node(var x:word; ischat:boolean);
var s:string[5];
begin
list_nodes;
prt('Which node: ');
input(s, sizeof(s) - 1);
x := value(s);
nl;
if (x > 0) and (x <= maxnodes) and (x <> node) then
with noder do
begin
loadnode(x);
if (not (NActive in Status) or (not (NAvail in Status) and ischat)) and not
((NInvisible in Status) and not CoSysOp) then
begin
print('That node is unavailable.');
x:=0;
end;
if (User = 0) or not (NAvail in Status) or ((NInvisible in Status) and not CoSysOp) then
x := 0;
end
else
x := 0;
end;
procedure dump_node;
var x:word;
begin
pick_node(x, FALSE);
if (x > 0) then
if pynq('Hang up user on node '+cstr(x)+'? ') then
begin
loadnode(x);
if pynq('Recycle node '+cstr(x)+' after logoff? ') then
noder.status := noder.status + [NHangup]
else
noder.status := noder.status + [NRecycle];
savenode(x);
end;
end;
procedure page_user;
var b:word;
begin
if not general.multinode then exit;
pick_node(b, TRUE);
if (b>0) and (b<>node) then
send_message(cstr(b) + ';^8' + Caps(thisuser.name)+' on node '+cstr(node)+' has paged you for chat.'^M^J);
end;
procedure check_status;
var j:byte;
f:file;
s:string[255];
begin
loadnode(node);
with noder do
begin
if (NUpdate in status) then
begin
j := thisuser.waiting;
reset(uf);
seek(uf,usernum);
read(uf,thisuser);
close(uf);
Lasterror := IOResult;
update_screen;
if thisuser.waiting > j then
print(^M^J'^8You have new private mail waiting.'^M^J'');
status := status - [NUpdate];
savenode(node);
if (smw in thisuser.flags) then
begin
rsm;
nl;
end;
end;
if (NHangup in status) or
(NRecycle in status) then
begin
hangup := TRUE;
if (NRecycle in status) then
QuitAfterDone := TRUE;
end;
if (not MultinodeChat) and (maxchatrec > nodechatlastrec) then
begin
assign(f,general.multpath + 'message.'+cstr(node));
reset(f,1);
seek(f,nodechatlastrec);
while not eof(f) do
begin
blockread(f,s[0],1);
blockread(f,s[1],ord(s[0]));
print(s);
end;
close(f);
Lasterror := IOResult;
nodechatlastrec := maxchatrec;
Pausescr(FALSE);
end;
end;
end;
procedure LowLevelSend(s:string; node:integer);
var
f:file;
begin
if (node < 0) then exit;
assign(f, general.multpath + 'message.' + cstr(node));
reset(f,1);
if (ioresult = 2) then
rewrite(f,1);
seek(f, filesize(f));
blockwrite(f, s[0], length(s) + 1);
close(f);
Lasterror := IOResult;
end;
procedure multiline_chat;
type
WhyNot = (NotModerator, NotOnline, NotRoom, NotInRoom);
var
done,ChannelOnly:boolean;
s:string[255];
s2,s3,execs:astr;
i,j:integer;
ActionsFile:Text;
oldactivity:byte;
c:char;
u:userrec;
RoomFile:file of RoomRec;
Room:RoomRec;
OldTimeOut, OldTimeOutBell:integer;
SaveName:string[36];
function ActionMCI(s:astr):string;
var
Temp:Astr;
Index:integer;
begin
Temp := '';
for Index := 1 to length(s) do
if (s[Index] = '%') then
case (upcase(s[Index + 1])) of
'S':begin
Temp := Temp + Caps(Thisuser.Name);
inc(Index);
end;
'R':begin
Temp := Temp + Caps(SaveName);
inc(Index);
end;
'G':begin
Temp := Temp + aonoff(thisuser.sex = 'M', 'his', 'her');
inc(Index);
end;
'H':begin
Temp := Temp + aonoff(thisuser.sex = 'M', 'him', 'her');
inc(Index);
end;
end
else
Temp := Temp + s[Index];
ActionMCI := Temp;
end;
procedure loadRoom(var chan:integer);
begin
reset(RoomFile);
seek(RoomFile, Chan - 1);
read(RoomFile, Room);
close(RoomFile);
Lasterror := IOResult;
end;
procedure saveRoom(var chan:integer);
begin
reset(RoomFile);
seek(RoomFile, Chan - 1);
write(RoomFile, Room);
close(RoomFile);
Lasterror := IOResult;
end;
procedure sendmessage(s:string; showhere:boolean);
var
i:word;
trap:text;
begin
if (General.TrapTeleConf) then
begin
assign(trap, General.LogsPath + 'ROOM'+cstr(RoomNumber) + '.TRP');
append(trap);
if (ioResult = 2) then
rewrite(trap);
writeln(trap, stripcolor(s));
close(trap);
end;
with noder do
for i:=1 to maxnodes do
begin
loadnode(i);
if (i <> node) and ((not ((Node mod 8) in Forget[Node div 8])) and
((not ChannelOnly) and (Activity = 7) and (Room = RoomNumber)) or
((Noder.Channel = ChatChannel) and (ChatChannel > 0) and ChannelOnly)) then
LowLevelSend(s,i);
end;
if (ShowHere) then
begin
if Multinodechat and not aacs(general.TeleConfMCI) then
mciallowed := FALSE;
print(s);
mciallowed := TRUE;
end;
end;
procedure AddToRoom(var Chan:integer);
var
People:word;
i:word;
begin
if (not Invisible) and not ((Chan Mod 8) in Noder.Booted[Chan div 8]) then
sendmessage('^0[ ^9' + Caps(Thisuser.Name) + ' ^0has entered the room. ]', FALSE);
print('^1You are now in conference room ^3' + cstr(Chan));
loadRoom(Chan);
if (not room.occupied) then
begin
room.occupied := TRUE;
saveRoom(Chan);
end;
People := 0;
for i:=1 to maxnodes do
begin
if (i = node) then continue;
loadnode(i);
with noder do
if (room = Chan) and (Activity = 7) then
inc(People);
end;
with room do
begin
if (Chan = 1) then
Topic := 'Main';
if (Topic <> '') then
print('^1The Current Topic is: ^3' + Topic);
if (People = 0) then
print('^1You are the only one present.')
else
print('^1There ' + aonoff(People = 1, 'is','are') + ' ' + cstr(People) +
' other ' + aonoff(People = 1,'person','people') + ' present.');
end;
loadnode(node);
Noder.Room := Chan;
savenode(node);
end;
procedure RemoveFromRoom(var Chan:integer);
var
People:word;
i:word;
begin
if (not Invisible) and not ((Chan Mod 8) in Noder.Booted[Chan div 8]) then
sendmessage('^0[^9 ' + Caps(Thisuser.Name) + '^0 has left the room. ]', FALSE);
loadRoom(Chan);
with Room do
begin
if (Moderator = Usernum) then
Moderator := 0;
{ if (people = 0) then
fillchar(Room,sizeof(Room),0); }
end;
People := 0;
for i:=1 to maxnodes do
begin
if (i = node) then continue;
loadnode(i);
with noder do
if (room = Chan) and (Activity = 7) then
inc(People);
end;
if (People = 1) then
room.occupied := FALSE;
if (not Invisible) then
saveRoom(Chan);
end;
function Name2Number(var s, sname:astr):integer;
var
i:integer;
Temp:string;
begin
Name2Number := 0;
if (pos(' ',s) > 0) then
Sname := copy(s,1,pos(' ',s))
else
Sname := s;
i := value(sqoutsp(Sname));
if (sqoutsp(Sname) = cstr(i)) and ((i > 0) and (i <= MaxNodes)) then
begin
loadnode(i);
with Noder do
if (User > 0) then
begin
if ((not (NInvisible in status)) or (CoSysOp)) then
Name2Number := i
else
Name2Number := 0;
writeln('here-', username);
s := copy(s, length(Sname) + 1, 255);
Sname := Caps(username);
exit;
end;
end;
i := 1;
Sname := '';
if (pos(' ',s) > 0) then
Temp := allcaps(copy(s,1, pos(' ',s) - 1))
else
Temp := allcaps(s);
while (i <= MaxNodes) do
begin
loadnode(i);
with noder do
if (User > 0) then
begin
if ((username = allcaps(copy(s,1,length(username)))) or
(pos(Temp, Username) > 0)) then
begin
Name2Number := i;
if (username = allcaps(copy(s,1,length(username)))) then
s := copy(s, length(username) + 2, 255)
else
s := copy(s, length(temp) + 2, 255);
sname := Caps(username);
break;
end;
end;
inc(i);
end;
end;
procedure Nope(Reason:WhyNot);
begin
case Reason of
NotModerator:print(^M^J'|10You are not the moderator.'^M^J);
NotOnline:print(^M^J'|10That user is not logged on.'^M^J);
NotRoom:print(^M^J'|10Invalid room number.'^M^J);
NotInRoom:print(^M^J'|10That user is not in this room.'^M^J);
end;
end;
procedure showroom(Chan:integer);
var
People:word;
i:word;
begin
loadRoom(Chan);
if (not room.occupied) then exit;
People := 0;
for i:=1 to maxnodes do
begin
if (i = node) then continue;
loadnode(i);
with noder do
if (room = Chan) and (Activity = 7) then
inc(People);
end;
if (People > 0) then
begin
nl;
if (Room.Moderator > 0) then
loadurec(u,Room.Moderator)
else
U.Name := 'Nobody';
printacr('^9Conference Room: ^3' + mn(Chan,5) + ' ^9Moderator: ^3' + Caps(U.Name));
if (Room.Private) then
s := 'Private'
else
s := 'Public';
printacr('^9Type: ^3' + mln(s,17) + '^9Topic: ^3' + Room.Topic);
if (Room.Anonymous) then
printacr('This room is in anonymous mode.');
nl;
j := 1;
while (J <= MaxNodes) and (not abort) do
begin
loadnode(j);
if (Noder.Activity = 7) and (Noder.Room = Chan) then
if not (NInvisible in Noder.Status) or (CoSysOp) then
printacr('^1' + Caps(noder.username) + ' on node ' + cstr(j));
inc(j);
end;
nl;
end;
end;
procedure inputmain(var s:string);
var os,cs:string;
cp:integer;
c:char;
ml, origcolor:byte;
cb:word;
LastCheck:longint;
procedure dobackspace;
var i,j,c:byte;
wascolor:boolean;
procedure set_color;
begin
c:=origcolor;
i:=1;
while (i < cp) do begin
if (s[i]='^') then begin
c:=Scheme.Color[ord(s[i+1]) + ord('1')];
inc(i);
end;
if (s[i]='|') and (i + 1 < length(s)) and
(s[i + 1] in ['0'..'9']) and (s[i + 2] in ['0'..'9']) then begin
cs:=s[i + 1] + s[i + 2];
case cb of
0..15:c := (c - (c mod 16) + cb);
16..23:c:= ((cb - 16) * 16) + (c mod 16);
end;
end;
inc(i);
end;
setc(c);
end;
begin
wascolor:=FALSE;
if (cp>1) then begin
dec(cp);
if (cp>1) then begin
if (s[cp] in ['0'..'9']) then begin
if (s[cp-1]='^') then begin
dec(cp);
wascolor:=TRUE;
set_color;
end else begin
j:=0;
while (s[cp-j]<>'|') and (s[cp-j] in ['0'..'9']) and (j<cp) do begin
inc(j);
end;
if s[cp-j]='|' then begin
wascolor:=TRUE;
dec(cp,j);
set_color;
end;
end;
end;
end;
if not wascolor then begin
backspace;
if (trapping) then write(trapfile,^H' '^H);
end;
end;
end;
begin
origcolor := curco; os:=s; s:='';
ml := 253 - length(MCI(Liner.TeleConfNormal));
checkhangup;
if (hangup) then exit;
cp := 1;
LastCheck := 0;
repeat
mlc:=s;
MultiNodeChat := TRUE;
if (cp > 1) and MultiNodeChat and not Thisuser.TeleConfInt then
MultiNodeChat := FALSE;
c := char(getkey);
if (Timer - LastCheck > 1) then
begin
loadnode(node);
if ((RoomNumber mod 8) in Noder.Booted[RoomNumber div 8]) then
begin
s := '';
print('^5You have been ^0EJECTED^5 from the room.'^M^J);
if (RoomNumber = 1) then
Done := TRUE
else
begin
RemoveFromRoom(RoomNumber);
RoomNumber := 1;
AddToRoom(RoomNumber);
end;
exit;
end
end;
case c of
^H:dobackspace;
^P:if (cp < ml) then begin
c := char(getkey);
if (c in ['0'..'9']) then
begin
UserColor(ord(c)-48);
s[cp]:='^'; s[cp+1]:=c;
inc(cp,2);
end;
end;
#32..#123,#125..#255:
if (cp <= ml) then
begin
s[cp]:=c; inc(cp);
outkey(c);
if (trapping) then write(trapfile,c);
end;
'|':if (cp + 1 <= ml) then
begin
cs:='';
c:='0';
cb:=0;
while (c in ['0'..'9']) and (cb < 2) do
begin
c := char(getkey);
if (c in ['0'..'9']) then
cs:=cs+c;
inc(cb);
end;
cb:=value(cs);
case cb of
0..15:setc(curco - (curco mod 16) + cb);
16..23:setc(((cb - 16) * 16) + (curco mod 16));
end;
if not (c in ['0'..'9']) then
begin
outkey(c);
if (trapping) then write(trapfile,c);
cs:=cs+c; {here was buf}
end;
s:=s+'|'+cs;
inc(cp,length(cs)+1);
end
else
if (cp <= ml) then
begin
s[cp]:=c; inc(cp); outkey(c);
if (trapping) then write(trapfile,c);
end;
^X:begin while (cp<>1) do dobackspace; setc(origcolor); end;
end;
s[0]:=chr(cp-1);
until ((c=^M) or (c=^N) or (hangup));
mlc:='';
nl;
end;
begin
mlc:='';
RoomNumber := 1;
if exist(general.multpath + 'ACTIONS.LST') then
assign(ActionsFile, general.multpath + 'ACTIONS.LST')
else
assign(ActionsFile, general.miscpath + 'ACTIONS.LST');
reset(ActionsFile);
if (IOResult = 2) then
rewrite(ActionsFile);
close(ActionsFile);
assign(RoomFile,general.multpath + 'ROOM.DAT');
reset(RoomFile);
if (IOResult = 2) then
rewrite(RoomFile);
fillchar(Room,sizeof(Room),0);
seek(RoomFile,filesize(RoomFile));
while (filesize(RoomFile) < 255) do
write(RoomFile, Room);
close(RoomFile);
if (IOResult <> 0) then
exit;
OldTimeOut := General.TimeOut; General.TimeOut := -1;
OldTimeOutBell := General.TimeOutBell; General.TimeOutBell := -1;
nodechatlastrec:=0;
kill(general.multpath + 'message.' + cstr(node));
loadnode(node);
ChannelOnly := FALSE;
oldactivity:=noder.activity;
noder.activity:=7;
savenode(node);
cls;
sysoplog('Entered Teleconferencing');
printf('teleconf');
if (nofile) then
print('^0 Welcome to Teleconferencing. Type ^5/?^0 for help or ^5/Q^0 to quit.'^M^J);
AddToRoom(RoomNumber);
nl;
done:=FALSE;
while (not done) and (not hangup) do begin
tleft;
MultiNodeChat:=TRUE;
loadnode(node);
Usercolor(3);
check_status;
inputmain(s);
ChannelOnly := FALSE;
MultiNodeChat:=FALSE;
if (hangup) then
s := '/Q';
if (s = '`') then
if (ChatChannel > 0) then
begin
j := 1;
print('^0The following people are in global channel '+cstr(ChatChannel)+': '^M^J);
while (J <= MaxNodes) and (not abort) do
begin
loadnode(j);
with noder do
if (Activity = 7) and (Channel = ChatChannel) and (j <> Node) then
begin
printacr('^9' + Caps(username) + ' on node ' + cstr(j));
ChannelOnly := TRUE;
end;
inc(j);
end;
if not ChannelOnly then
print('^9None.')
else
ChannelOnly := FALSE;
nl;
s := '';
end
else
begin
print('^0You are not in a global channel.'^M^J);
s := '';
end;
if (not done) and (s <> '') and (s[1]='/') then begin
c:=upcase(s[2]);
s3 := allcaps(copy(s,2,255));
if (pos(' ',s3) > 0) then
begin
SaveName := copy(s3, pos(' ',s3) + 1, 255);
s3 := copy(s3, 1, pos(' ', s3) - 1);
end
else
SaveName := '';
s2 := SaveName;
if (SaveName <> '') then
begin
i := Name2Number(s2, SaveName);
if (SaveName = '') then
i := -1;
end
else
i := 0;
writeln(savename,'-',i);
reset(ActionsFile);
while not eof(ActionsFile) do
begin
readln(ActionsFile, s2); { Action word }
if (Allcaps(s2) = s3) then
begin
readln(ActionsFile, s2); { What sender sees }
s2 := MCI(s2);
if (copy(allcaps(s2), 1, 5) <> ':EXEC') then
begin
print('^0'+ActionMCI(s2));
execs := '';
end
else
execs := copy(s2, 6, 255); { strip ":EXEC" }
readln(ActionsFile, s2); { What everybody else sees }
if (i = 0) then
readln(ActionsFile, s2); { What evrybdy sees if no rcvr }
s2 := MCI(s2);
s2 := '^0' + ActionMCI(s2);
with noder do
for j := 1 to maxnodes do
begin
loadnode(j);
if (Activity = 7) and (Room = RoomNumber) and
(j <> node) and not ((Node mod 8) in Forget[Node div 8]) and
(j <> i) then
LowLevelSend(s2,j);
end;
if (i > 0) then
readln(ActionsFile, s2);
readln(ActionsFile, s2); { What receiver sees }
s2 := MCI(s2);
if (i > 0) then
begin
loadnode(i);
if (Noder.Activity = 7) and (Noder.Room = RoomNumber) and
not ((Node mod 8) in noder.Forget[Node div 8]) then
LowLevelSend('^0'+ActionMCI(s2), i);
end;
s := '';
if (execs <> '') then
begin
c := execs[1];
execs := copy(execs, 2, 255);
dodoorfunc(c, execs);
end;
break;
end
else
for j := 1 to 4 do
readln(ActionsFile, s2);
end;
close(ActionsFile);
if (s <> '') then
case c of
'/':if (copy(s,2,3) = '/\\') and (so) then
domenucommand(done, Allcaps(copy(s, 5, 255)), s2);
'F':if (Allcaps(copy(s,2,6)) = 'FORGET') then
begin
s := copy(s,pos(' ',s) + 1,length(s));
i := Name2Number(s, SaveName);
s := '';
if (i > 0) and (i <= maxnodes) then
begin
loadurec(u, noder.user);
if (aacs1(u, noder.user, General.csop)) then
print('^9You cannot forget a sysop.'^M^J)
else
begin
loadnode(node);
Noder.Forget[i div 8] := Noder.Forget[i div 8] + [i mod 8];
savenode(node);
print('^0' + SaveName + '^9 has been forgotten.');
end;
end
else
Nope(NotOnLine);
end;
'R':if (Allcaps(copy(s,2,8)) = 'REMEMBER') then
begin
s := copy(s,pos(' ',s) + 1, 255);
i := Name2Number(s,SaveName);
writeln(savename,'-',i);
if (i > 0) and (i <= maxnodes) then
begin
loadnode(node);
Noder.Forget[i div 8] := Noder.Forget[i div 8] - [i mod 8];
savenode(node);
print('^0' + SaveName + '^9 has been remembered.');
end
else
Nope(NotOnLine);
end
else
begin
s:= copy(s,pos(' ',s) + 1, 255);
i := SearchUser(s, FALSE);
readasw(i, 'registry');
s := '';
end;
'A':if (Allcaps(copy(s,2,4)) <> 'ANON') then
begin
s := copy(s,4,length(s) - 3);
s := '^0' + Caps(thisuser.name) + ' ' + s;
end
else
begin
if (Room.Moderator = Usernum) or (CoSysOp) then
begin
loadRoom(RoomNumber);
Room.Anonymous := not Room.Anonymous;
saveRoom(RoomNumber);
sendmessage('^0[ This room is now in ^2' + aonoff(Room.Anonymous,'Anonymous','Regular') +
'^0 ]', TRUE);
end
else
Nope(NotModerator);
end;
'I':if (Allcaps(Copy(s,2,9)) = 'INTERRUPT') then
begin
Thisuser.TeleConfInt := not Thisuser.TeleConfInt;
print('^9Your message interruption is now ' + onoff(Thisuser.TeleConfInt));
end
else
begin
if (Room.Moderator = Usernum) or (CoSysOp) then
begin
if (length(s) = 2) then
begin
loadRoom(RoomNumber);
Room.Private := not Room.Private;
saveRoom(RoomNumber);
sendmessage('^0[ This room is now ^2'+aonoff(Room.Private,'private','public') + '^0 ]', TRUE);
end
else
begin
s := copy(s,4,length(s)-3);
i := Name2Number(s,SaveName);
if (i > 0) and (i <= maxnodes) then
begin
loadnode(i);
s := ^M^J+'^9[^0 ' + Caps(thisuser.name) + '^9 is inviting you to join conference room ' +
cstr(RoomNumber) + ' ]';
noder.invited[RoomNumber div 8] := noder.invited[RoomNumber div 8] + [RoomNumber mod 8];
noder.booted[RoomNumber div 8] := noder.booted[RoomNumber div 8] - [RoomNumber mod 8];
print('^0' + SaveName + '^9 on node ' + cstr(i) + ' has been invited.');
savenode(i);
if (i <> node) then
LowLevelSend(s,i);
end
else
Nope(NotOnline);
s := '';
end;
end
else
Nope(NotModerator);
end;
'W':list_nodes;
'G':if (Allcaps(copy(s,2,6)) = 'GLOBAL') then
begin
loadnode(node);
noder.channel := value(copy(s,pos(' ',s) + 1,255));
print(^M^J'^0You are now in global channel ' + cstr(noder.channel)+'.'^M^J);
ChatChannel := Noder.Channel;
savenode(node);
ChannelOnly := TRUE;
if (not Invisible) then
sendmessage('^9' + Caps(Thisuser.Name) + ' has joined global channel '+cstr(chatchannel)+'.', FALSE);
end
else
if (AllCaps(s) = '/G') and pynq('Are you sure you want to disconnect? ') then
begin
if (not Invisible) then
sendmessage('^0[ ^2' + Caps(Thisuser.Name) + '^0 has disconnected on node ' + cstr(node) + ' ]',FALSE);
hangup := TRUE;
end;
'E':begin
if (Allcaps(copy(s,2,4)) = 'ECHO') then
begin
Thisuser.TeleConfEcho := not Thisuser.TeleConfEcho;
print('^9Your message echo is now ' + onoff(Thisuser.TeleConfEcho));
end
else
if (Allcaps(copy(s,2,5)) = 'EJECT') then
begin
if (Room.Moderator = Usernum) or (CoSysOp) then
begin
s := copy(s,pos(' ',s) + 1,length(s));
i := Name2Number(s,SaveName);
if (i > 0) and (i <= MaxNodes) then
begin
loadnode(i);
if (noder.activity = 7) and (Noder.Room = RoomNumber) then
begin
loadurec(u, noder.user);
if (aacs1(u, noder.user, General.csop)) then
print('^9You cannot eject that person.'^M^J)
else
begin
Noder.Booted[RoomNumber div 8] := Noder.Booted[RoomNumber div 8] + [RoomNumber mod 8];
Noder.Room := 1;
savenode(i);
if (not Invisible) then
sendmessage('^0' + SaveName + '^9 has just been ejected from the room by ^0'+
caps(thisuser.name), TRUE);
sysoplog('Ejected ' + SaveName);
end;
end
else
Nope(NotInRoom);
end
else
Nope(NotOnline);
s := '';
end
else
Nope(NotModerator);
end;
end;
'S':begin
i := 1; abort := FALSE;
while (i <= 255) and (not abort) do
begin
ShowRoom(i);
inc(i);
end;
loadRoom(RoomNumber);
s := '';
end;
'M':begin
s := copy(s,4,40);
nl;
if (CoSysOp) or (Room.Moderator = Usernum) or ((Room.Moderator = 0) and (RoomNumber <> 1)) then
begin
loadRoom(RoomNumber);
Room.Topic := S;
if (not Invisible) then
sendmessage('^0[ Conference ''^2' + Room.Topic + '^0'' is now moderated by ^2' +
Caps(Thisuser.Name) + '^0 ]', TRUE);
if (Room.Moderator = 0) then
begin
for i := 1 to MaxNodes do
begin
loadnode(i);
noder.invited[RoomNumber div 8] := noder.invited[RoomNumber div 8] - [RoomNumber mod 8];
noder.booted[RoomNumber div 8] := noder.booted[RoomNumber div 8] - [RoomNumber mod 8];
savenode(i);
end;
end;
Room.Moderator := Usernum;
saveRoom(RoomNumber);
end
else
Nope(NotModerator);
s := '';
end;
'P':begin
s := copy(s,4,length(s) - 3);
i := Name2Number(s,SaveName);
if (i > 0) and (i <= maxnodes) then
begin
loadnode(i);
if ((Node mod 8) in Noder.Forget[Node div 8]) then
print('^9That user has forgotten you.'^M^J)
else
if not (NAvail in Noder.status) then
print('^9That user is unavailable.'^M^J)
else
if not (NInvisible in Noder.status) then
begin
print('^9Private message sent to ^0' + SaveName);
if aacs(general.TeleConfMCI) then
s := MCI(s);
s := MCI(Liner.TeleConfPrivate) + s;
LowLevelSend(s,i)
end
else
Nope(NotOnline);
end
else
Nope(NotOnline);
s := '';
end;
'J':begin
s := copy(s, 4, length(s) - 3);
i := value(s);
nl;
if (i > 0) and (i <= 255) then
begin
loadnode(node);
if ((i Mod 8) in Noder.Booted[i div 8]) then
begin