ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/schmorp-clientchk.ext
Revision: 1.5
Committed: Fri Dec 15 19:06:29 2006 UTC (17 years, 5 months ago) by root
Branch: MAIN
Changes since 1.4: +3 -3 lines
Log Message:
new accessors

File Contents

# User Rev Content
1 root 1.1 #! perl
2    
3     # check client version and string for old clients and possibly issue warnings for them
4    
5 root 1.3 cf::attach_to_players
6     on_login => sub {
7     my ($pl) = @_;
8    
9 root 1.5 my $client = $pl->socket->client;
10 root 1.3
11     my $is_cf = $client =~ /^(?:GTK|X11) (?:Unix|Win32) Client ([.0-9]+)/
12     ? join "", map chr, split /\./, $1
13     : undef;
14    
15 root 1.4 my $is_jx = $client =~ /^JCrossclient 1.0 alpha-(\d+)/
16     ? join "", map chr, split /\./, $1
17     : undef;
18    
19     if ($is_cf) { # && $is_cf lt v1.9.2) {
20 root 1.3 $pl->ob->message ("(enabling workaround for client buffer overflow)", cf::NDI_RED | cf::NDI_UNIQUE);
21 root 1.5 $pl->socket->buggy_mapscroll;
22 root 1.3 }
23 root 1.1
24 root 1.4 if ($is_jx) {
25     $pl->ob->message ("(enabling buggy map scroll workaround)", cf::NDI_RED | cf::NDI_UNIQUE);
26 root 1.5 $pl->socket->buggy_mapscroll;
27 root 1.4 }
28    
29     if ($is_jx) {
30     $pl->ob->message ("You are using a known to be buggy client (an alpha version, too). "
31     . "If you encounter map freezes or other bugs, consider using a more stable client "
32     . "such as CFPlus or gcfclient or gcfclient2");
33     }
34    
35 root 1.3 if ($is_cf && $is_cf lt v1.9.1) {
36     $pl->ob->message (<<EOF, cf::NDI_RED | cf::NDI_UNIQUE);
37 root 1.1
38     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
39     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
40     *** WARNING: Your client is BUGGY
41     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
42     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
43    
44 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.
45 root 1.1
46     EOF
47 root 1.3 }
48     },
49     ;
50 root 1.1