#! 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 =~ /^(?:GTK|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; if ($is_cf) { # && $is_cf lt v1.9.2) { $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, "(enabling workaround for client buffer overflow)"); $ns->buggy_mapscroll (1); $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, "(enabling workaround for broken face caching)"); $ns->force_bad_checksum (1); } if ($is_jx) { $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, "(enabling buggy map scroll workaround)"); $ns->buggy_mapscroll (1); } if ($is_jx) { $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, "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"); } if ($is_cf && $is_cf lt v1.9.1) { $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, <