ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/clientchk.ext
Revision: 1.2
Committed: Mon Apr 16 15:50:49 2007 UTC (17 years, 1 month ago) by root
Branch: MAIN
Changes since 1.1: +7 -3 lines
Log Message:
try to force face caching via setup - seems to work with gcfclient at least

File Contents

# Content
1 #! perl # MANDATORY
2
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 $ns->send_drawinfo ("(disabling bg image scrub because of buggy client)", cf::NDI_RED);
23 $ns->enable_bg_scrub (0);
24
25 $ns->send_drawinfo ("(enabling workaround for client buffer overflow on scroll)", cf::NDI_RED);
26 $ns->buggy_mapscroll (1);
27
28 $ns->send_drawinfo ("(enabling workaround for broken face caching in client)", cf::NDI_RED);
29 $ns->force_bad_checksum (1);
30 }
31
32 if ($is_jx) {
33 $ns->send_drawinfo ("(enabling workaround for map redraw bug)", cf::NDI_RED);
34 $ns->force_image_newmap (1);
35
36 $ns->send_drawinfo ("(enabling buggy map scroll workaround)", cf::NDI_RED);
37 $ns->buggy_mapscroll (1);
38
39 $ns->send_drawinfo ("You are using a known to be buggy client (an alpha version, too). "
40 . "If you encounter map freezes or other bugs, consider using a more stable client "
41 . "such as CFPlus or gcfclient or gcfclient2", cf::NDI_RED);
42 }
43
44 if ($is_cf && $is_cf lt v1.9.1) {
45 $ns->send_drawinfo (<<EOF, cf::NDI_RED);
46
47 *** *** *** *** *** *** *** *** *** *** *** *** *** ***
48 *** *** *** *** *** *** *** *** *** *** *** *** *** ***
49 *** WARNING: Your client is BUGGY
50 *** *** *** *** *** *** *** *** *** *** *** *** *** ***
51 *** *** *** *** *** *** *** *** *** *** *** *** *** ***
52
53 Your client ($client) is known to be buggy. Upgrading is highly recommended, otherwise you may experience crashes, strange lockups or other problems.
54
55 EOF
56 }
57 },
58 );
59