#! perl # MANDATORY # check client version and string for old clients and possibly issue warnings for them cf::client->attach ( on_addme => sub { my ($ns) = @_; my $client = $ns->version; my $is_cf = $client =~ /^(?:GTK2?|X11) (?:Unix|Win32) Client ([.0-9]+)/ ? join "", map chr, split /\./, $1 : undef; my $is_jx = $client =~ /^JCrossclient 1.0 alpha-(\d+)/ ? join "", map chr, split /\./, $1 : undef; $ns->enable_bg_scrub (1); if ($is_cf) { # && $is_cf lt v1.9.2) { $ns->send_drawinfo ("(disabling bg image scrub because of client bug)", cf::NDI_RED); $ns->enable_bg_scrub (0); $ns->send_drawinfo ("(enabling workaround for client buffer overflow)", cf::NDI_RED); $ns->buggy_mapscroll (1); $ns->send_drawinfo ("(enabling workaround for broken face caching)", cf::NDI_RED); $ns->force_bad_checksum (1); } if ($is_jx) { $ns->send_drawinfo ("(enabling workaround for map redraw bug)", cf::NDI_RED); $ns->force_image_newmap (1); $ns->send_drawinfo ("(enabling buggy map scroll workaround)", cf::NDI_RED); $ns->buggy_mapscroll (1); $ns->send_drawinfo ("You are using a known to be buggy client (an alpha version, too). " . "If you encounter map freezes or other bugs, consider using a more stable client " . "such as CFPlus or gcfclient or gcfclient2", cf::NDI_RED); } if ($is_cf && $is_cf lt v1.9.1) { $ns->send_drawinfo (<