#! perl # check client version and string for old clients and possibly issue warnings for them cf::attach_to_players on_login => sub { my ($pl) = @_; my $client = $pl->socket->client; 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) { $pl->ob->message ("(enabling workaround for client buffer overflow)", cf::NDI_RED | cf::NDI_UNIQUE); $pl->socket->buggy_mapscroll; } if ($is_jx) { $pl->ob->message ("(enabling buggy map scroll workaround)", cf::NDI_RED | cf::NDI_UNIQUE); $pl->socket->buggy_mapscroll; } if ($is_jx) { $pl->ob->message ("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) { $pl->ob->message (<