ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/schmorp-clientchk.ext
Revision: 1.7
Committed: Mon Mar 12 23:45:10 2007 UTC (17 years, 2 months ago) by root
Branch: MAIN
Changes since 1.6: +12 -10 lines
Log Message:
- gcfclient compares against the server-provided image checksum but
  stores its own checksum in the database. needless to say, they differed.
  needless to say, we now have to provide a dummy superfluous gcfclient checksum
  for gcfclient only.
- add various bug workaround flags to enbale gcfclient to cache imges again.

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     my $is_cf = $client =~ /^(?:GTK|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     if ($is_cf) { # && $is_cf lt v1.9.2) {
20 root 1.7 $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, "(enabling workaround for client buffer overflow)");
21     $ns->buggy_mapscroll (1);
22     $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, "(enabling workaround for broken face caching)");
23     $ns->force_bad_checksum (1);
24 root 1.1 }
25    
26     if ($is_jx) {
27 root 1.7 $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, "(enabling buggy map scroll workaround)");
28     $ns->buggy_mapscroll (1);
29 root 1.1 }
30    
31     if ($is_jx) {
32 root 1.7 $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, "You are using a known to be buggy client (an alpha version, too). "
33 root 1.1 . "If you encounter map freezes or other bugs, consider using a more stable client "
34     . "such as CFPlus or gcfclient or gcfclient2");
35     }
36    
37     if ($is_cf && $is_cf lt v1.9.1) {
38 root 1.7 $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, <<EOF);
39 root 1.1
40     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
41     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
42     *** WARNING: Your client is BUGGY
43     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
44     *** *** *** *** *** *** *** *** *** *** *** *** *** ***
45    
46     Your client ($client) is known to be buggy. Upgrading is highly recommended, otherwise you may experience crashes, strange lockups or other problems.
47    
48     EOF
49     }
50     },
51 root 1.4 );
52 root 1.1