ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/schmorp-clientchk.ext
Revision: 1.9
Committed: Thu Mar 15 16:25:45 2007 UTC (17 years, 2 months ago) by root
Branch: MAIN
Changes since 1.8: +6 -1 lines
Log Message:
implement another bug workaround for clients

File Contents

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