--- deliantra/server/ext/schmorp-clientchk.ext 2006/12/21 23:37:05 1.5 +++ deliantra/server/ext/schmorp-clientchk.ext 2007/03/15 16:25:45 1.9 @@ -1,14 +1,14 @@ -#! perl +#! perl # MANDATORY # check client version and string for old clients and possibly issue warnings for them -cf::player->attach ( - on_login => sub { - my ($pl) = @_; +cf::client->attach ( + on_addme => sub { + my ($ns) = @_; - my $client = $pl->ns->version; + my $client = $ns->version; - my $is_cf = $client =~ /^(?:GTK|X11) (?:Unix|Win32) Client ([.0-9]+)/ + my $is_cf = $client =~ /^(?:GTK2?|X11) (?:Unix|Win32) Client ([.0-9]+)/ ? join "", map chr, split /\./, $1 : undef; @@ -16,24 +16,31 @@ ? join "", map chr, split /\./, $1 : undef; + if ($client =~ /^(JCrossclient) /) { + $ns->send_drawinfo ("(enabling workaround for map redraw bug)", cf::NDI_RED); + $ns->force_image_newmap (1); + } + 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->ns->buggy_mapscroll (1); + $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) { - $pl->ob->message ("(enabling buggy map scroll workaround)", cf::NDI_RED | cf::NDI_UNIQUE); - $pl->ns->buggy_mapscroll (1); + $ns->send_drawinfo ("(enabling buggy map scroll workaround)", cf::NDI_RED); + $ns->buggy_mapscroll (1); } if ($is_jx) { - $pl->ob->message ("You are using a known to be buggy client (an alpha version, too). " + $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"); + . "such as CFPlus or gcfclient or gcfclient2", cf::NDI_RED); } if ($is_cf && $is_cf lt v1.9.1) { - $pl->ob->message (<send_drawinfo (<