1 |
root |
1.1 |
#! perl |
2 |
|
|
|
3 |
|
|
# check client version and string for old clients and possibly issue warnings for them |
4 |
|
|
|
5 |
|
|
sub on_login { |
6 |
|
|
my ($pl, $host) = @_; |
7 |
|
|
|
8 |
|
|
my $client = $pl->client; |
9 |
|
|
|
10 |
root |
1.2 |
my $is_cf = $client =~ /^(?:GTK|X11) (?:Unix|Win32) Client ([.0-9]+)/ |
11 |
|
|
? join "", map chr, split /\./, $1 |
12 |
|
|
: undef; |
13 |
root |
1.1 |
|
14 |
root |
1.2 |
if ($is_cf && $is_cf lt v1.9.2) { |
15 |
|
|
$pl->ob->message ("(enabling workaround for client buffer overflow)", cf::NDI_RED | cf::NDI_UNIQUE); |
16 |
|
|
$pl->buggy_mapscroll; |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
if ($is_cf && $is_cf lt v1.9.1) { |
20 |
root |
1.1 |
$pl->ob->message (<<EOF, cf::NDI_RED | cf::NDI_UNIQUE); |
21 |
|
|
|
22 |
|
|
*** *** *** *** *** *** *** *** *** *** *** *** *** *** |
23 |
|
|
*** *** *** *** *** *** *** *** *** *** *** *** *** *** |
24 |
|
|
*** WARNING: Your client is BUGGY |
25 |
|
|
*** *** *** *** *** *** *** *** *** *** *** *** *** *** |
26 |
|
|
*** *** *** *** *** *** *** *** *** *** *** *** *** *** |
27 |
|
|
|
28 |
root |
1.2 |
Your client ($client) is known to be buggy. Upgrading is highly recommended, otherwise you may experience crashes, strange lockups or other problems. |
29 |
root |
1.1 |
|
30 |
|
|
EOF |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
() |
34 |
|
|
} |