ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/clientchk.ext
Revision: 1.4
Committed: Mon Jun 11 21:38:13 2007 UTC (16 years, 11 months ago) by root
Branch: MAIN
CVS Tags: rel-2_32, rel-2_6, rel-2_7, rel-2_4, rel-2_5, rel-2_2, rel-2_3, rel-2_72, rel-2_73, rel-2_71, rel-2_61, rel-2_41, rel-2_54, rel-2_55, rel-2_56, rel-2_43, rel-2_42, rel-2_52, rel-2_53
Changes since 1.3: +1 -1 lines
Log Message:
port micropather to c++...

File Contents

# User Rev Content
1 root 1.4 #! perl # mandatory
2 root 1.1
3     # check client version and string for old clients and possibly issue warnings for them
4    
5     cf::client->attach (
6     on_addme => sub {
7     my ($ns) = @_;
8    
9     my $client = $ns->version;
10    
11     my $is_cf = $client =~ /^(?:GTK2?|X11) (?:Unix|Win32) Client ([.0-9]+)/
12     ? join "", map chr, split /\./, $1
13     : undef;
14    
15     my $is_jx = $client =~ /^JCrossclient 1.0 alpha-(\d+)/
16     ? join "", map chr, split /\./, $1
17     : undef;
18    
19     $ns->enable_bg_scrub (1);
20    
21     if ($is_cf) { # && $is_cf lt v1.9.2) {
22 root 1.2 $ns->send_drawinfo ("(disabling bg image scrub because of buggy client)", cf::NDI_RED);
23 root 1.1 $ns->enable_bg_scrub (0);
24 root 1.2
25     $ns->send_drawinfo ("(enabling workaround for client buffer overflow on scroll)", cf::NDI_RED);
26 root 1.1 $ns->buggy_mapscroll (1);
27 root 1.2
28 root 1.3 $ns->send_drawinfo ("(enabling workaround for map redraw bug)", cf::NDI_RED);
29     $ns->force_image_newmap (1);
30    
31 root 1.2 $ns->send_drawinfo ("(enabling workaround for broken face caching in client)", cf::NDI_RED);
32 root 1.1 $ns->force_bad_checksum (1);
33     }
34    
35     if ($is_jx) {
36     $ns->send_drawinfo ("(enabling workaround for map redraw bug)", cf::NDI_RED);
37     $ns->force_image_newmap (1);
38 root 1.2
39 root 1.1 $ns->send_drawinfo ("(enabling buggy map scroll workaround)", cf::NDI_RED);
40     $ns->buggy_mapscroll (1);
41 root 1.2
42 root 1.1 $ns->send_drawinfo ("You are using a known to be buggy client (an alpha version, too). "
43     . "If you encounter map freezes or other bugs, consider using a more stable client "
44     . "such as CFPlus or gcfclient or gcfclient2", cf::NDI_RED);
45     }
46    
47     if ($is_cf && $is_cf lt v1.9.1) {
48     $ns->send_drawinfo (<<EOF, cf::NDI_RED);
49    
50     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
51     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
52     *** WARNING: Your client is BUGGY
53     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
54     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
55    
56     Your client ($client) is known to be buggy. Upgrading is highly recommended, otherwise you may experience crashes, strange lockups or other problems.
57    
58     EOF
59     }
60     },
61     );
62