--- deliantra/server/ext/schmorp-clientchk.ext 2006/12/15 19:59:19 1.2 +++ deliantra/server/ext/schmorp-clientchk.ext 2007/03/12 23:45:10 1.7 @@ -1,12 +1,12 @@ -#! perl +#! perl # MANDATORY # check client version and string for old clients and possibly issue warnings for them -cf::attach_to_players - on_login => sub { - my ($pl) = @_; +cf::client->attach ( + on_addme => sub { + my ($ns) = @_; - my $client = $pl->socket->version; + my $client = $ns->version; my $is_cf = $client =~ /^(?:GTK|X11) (?:Unix|Win32) Client ([.0-9]+)/ ? join "", map chr, split /\./, $1 @@ -17,23 +17,25 @@ : 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; + $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) { - $pl->ob->message ("(enabling buggy map scroll workaround)", cf::NDI_RED | cf::NDI_UNIQUE); - $pl->socket->buggy_mapscroll; + $ns->send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, "(enabling buggy map scroll workaround)"); + $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_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) { - $pl->ob->message (<send_packet (sprintf "drawinfo %d %s", cf::NDI_RED, <