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
|
sub stream {
&secure_checkid($alias, $tmpid);
my $pid = $$;
$SIG{'CHLD'} = 'IGNORE';
++$|;
open RSTAT, "<data/online/rstat/$room";
my(@rstat) = <RSTAT>;
close RSTAT;
if ($rstat[0] eq "1\n") {
if (3 <= &hierachie($alias)) {
print "<font color='ffffff'>Der Raum <font color='ffa500'>$room</font> ist leider abgesperrt! Du wirst in den Ram <b>$standardroom</b> umgeleitet ...</font>";
$room = $standardroom;
}
}
print qq[<html>\n <head>\n<script language="JavaScript">\n<!--\n open('chat?request=online&room=$room&alias=$alias&tmpid=$tmpid','online');\n open('chat?request=input&alias=$alias&room=$room&col=$col&secol=$secol&tmp=login&tmpid=$tmpid&maxVerlauf=$maxVerlauf&verlaufOrder=$verlaufOrder','input');\n\n// open('chat?request=input&alias=$alias&room=$room&col=$col&secol=$secol&tmpid=$tmpid&maxVerlauf=$maxVerlauf&verlaufOrder=$verlaufOrder','input');\n\n// Scroll-Routine von Anklepper (http://www.anklepper.de)\n// speziell f\374r yChat (http://www.yChat.de), Copyright 2000\nscrolling = true;\nmoves_steps = 4;\nmoves_interval = 4;\nfunction moves()\n{\n if( scrolling != false )\n window.scrollBy( 0, moves_steps );\n window.setTimeout( "moves()", moves_interval );\n}\nmoves();\n//-->\n</script>\n</head>\n<body bgcolor="$chatbg">\n];
unlink "data/online/rooms/$loginplace/$alias";
&check_online;
print "<font size=1 color=ffffff face=arial>$title - Letzte Änderung $datum\n; Der Chat wird geladen...\n<br>";
sleep 1;
print "<b>Hallo <font color=$col>$alias</font></b>, mit dem Befehl /menu kannst du das Chat-Menü aufrufen!<br>";
sleep 1;
print "Du befindest dich im Raum <b>$room</b>: " . get_theme($room) . "<br>\n";
print "</font>\n";
if (-f "data/user/memos/$alias") {
open MEMOS, "<data/user/memos/$alias";
my(@memos) = <MEMOS>;
close MEMOS;
my $memos;
foreach $_ (@memos) {
$memos .= $_;
}
print $memos;
unlink "data/user/memos/$alias";
}
OPENMSGFILE: my $change_room = 0;
my $startime = time;
my $flooding = 0;
my @ignore;
my @flood;
unless (-f "data/online/rstat/$room") {
open DATEI, ">data/online/rstat/$room";
print DATEI "0\n\n$alias<;1\n";
close DATEI;
}
open DATEI, ">data/online/users/$alias";
print DATEI time;
close DATEI;
open DATEI, ">data/online/rooms/$room/$alias";
print DATEI time;
close DATEI;
if (-e "data/msgs/$room") {
open MSGFILE, "<data/msgs/$room";
mkdir 'data/online/pids', 511 unless -d 'data/online/pids';
mkdir "data/online/pids/$room", 511 unless -d "data/online/pids/$room";
open PID, ">data/online/pids/$room/$pid";
print PID time;
close PID;
}
else {
sleep 1;
goto OPENMSGFILE;
}
&sendmsgs;
while (-f "data/online/users/$alias") {
local $SIG{'USR1'} = \&sendmsgs;
goto OPENMSGFILE if $change_room == 1;
sleep 15;
print "\n";
}
sub sendmsgs {
for ($curpos = tell MSGFILE; defined($_ = <MSGFILE>); $curpos = tell MSGFILE) {
my($address, $stamp, $command, $action, $message, $from) = split(/<;/, $_, 7);
if ($address =~ /$\!/ or $address eq $alias) {
if ($stamp > $startime) {
if ($command eq 'col') {
($col, $secol) = split(/;/, $action, 3);
}
elsif ($command eq 'cr') {
unlink "data/online/pids/$room/$pid";
$room = $action;
close MSGFILE;
$change_room = 1;
}
elsif ($command eq 'ig') {
my @temp;
my $add2list = 1;
foreach $_ (@ignore) {
if ($action ne $_) {
push @temp, $_;
}
else {
$add2list = 0;
}
}
if ($add2list == 1) {
push @ignore, $action;
print "<font color='#ffffff'><font color='#ffa500'>$action</font> wird nun ignoriert!</font><br>\n";
&post_prv_extra($action, "<font color='#ff0000'>Du wirst nun von $alias ignoriert!</font>");
}
else {
@ignore = @temp;
print "<font color='#ffffff'><font color='#ffa500'>$action</font> wird nun nicht mehr ignoriert!</font><br>\n";
&post_prv_extra($action, "<font color='#ff0000'>Du wirst nun von $alias nicht mehr ignoriert!</font>");
}
}
elsif ($command eq 'igl') {
my $ignored;
foreach $_ (@ignore) {
$ignored .= "$_ ";
}
if ($#ignore == -1) {
print "<font color='#ffffff'>Momentan wird keine Person von dir ignoriert!</font><br>\n";
}
else {
print "<font color='#ffffff'>Folgende Personen werden von dir ignoriert: <font color='#ffa500'>$ignored</font>!</font><br>\n";
}
}
elsif ($command eq 'quit') {
print "<script language='JavaScript'>\n";
print "open('chat?request=online&room=$loginplace&alias=$alias&tmpid=$tmpid','online');\n";
print "open('chat?request=htdocs','input');\n";
print "open('chat?request=loggedin&alias=$alias&col=$col&secol=$secol&tmpid=$tmpid&maxVerlauf=$maxVerlauf&verlaufOrder=$verlaufOrder','main');\n";
print "</script>\n";
last;
}
elsif ($change_room != 1) {
my $ignored = 0;
foreach $_ (@ignore) {
if ($_ eq $from) {
$ignored = 1;
last;
}
}
if ($ignored != 1) {
print "$message\n";
}
else {
$address =~ s/!//;
&post_prv_extra($from, "<font color='#ff0000'>Du wirst von $alias ignoriert!</font>") if $address eq $alias;
}
}
push @flood, $address . $command . $action . $message . $from;
if ($flood[0] eq $flood[1] and $flood[0] eq $flood[2] and $flood[0] eq $flood[3]) {
print "<i><font color=red>$from flutet den Chat !</font></i><br>\n";
if ($from eq $alias and $flooding++ and $flooding >= 4) {
print "<script language='JavaScript'>open('chat?request=start&tmp=autokick','_top');</script>\n";
&rm_alias($alias, $room);
&post($room, q[<i><font color='ffffff'>] . ×tring . " <font color='ffa500'><b>Das System</b></font> katapultiert <b>$alias</b> wegen Fluten des Chats nach draussen ... </font></i>", $alias);
}
}
else {
$flooding = 0;
}
shift @flood if $#flood > 2;
}
}
}
seek MSGFILE, $curpos, 0;
}
unlink "data/online/pids/$room/$pid";
}
sub post_prv_extra {
my($alias, $message) = @_;
my $helpid = fork;
if ($helpid == 0) {
&post_prv($alias, $message);
exit 0;
}
}
1;
|