ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/schmorp-clientchk.ext
(Generate patch)

Comparing deliantra/server/ext/schmorp-clientchk.ext (file contents):
Revision 1.2 by root, Fri Dec 15 19:59:19 2006 UTC vs.
Revision 1.6 by root, Sat Jan 13 23:06:13 2007 UTC

1#! perl 1#! perl # MANDATORY
2 2
3# check client version and string for old clients and possibly issue warnings for them 3# check client version and string for old clients and possibly issue warnings for them
4 4
5cf::attach_to_players 5cf::player->attach (
6 on_login => sub { 6 on_login => sub {
7 my ($pl) = @_; 7 my ($pl) = @_;
8 8
9 my $client = $pl->socket->version; 9 my $client = $pl->ns->version;
10 10
11 my $is_cf = $client =~ /^(?:GTK|X11) (?:Unix|Win32) Client ([.0-9]+)/ 11 my $is_cf = $client =~ /^(?:GTK|X11) (?:Unix|Win32) Client ([.0-9]+)/
12 ? join "", map chr, split /\./, $1 12 ? join "", map chr, split /\./, $1
13 : undef; 13 : undef;
14 14
16 ? join "", map chr, split /\./, $1 16 ? join "", map chr, split /\./, $1
17 : undef; 17 : undef;
18 18
19 if ($is_cf) { # && $is_cf lt v1.9.2) { 19 if ($is_cf) { # && $is_cf lt v1.9.2) {
20 $pl->ob->message ("(enabling workaround for client buffer overflow)", cf::NDI_RED | cf::NDI_UNIQUE); 20 $pl->ob->message ("(enabling workaround for client buffer overflow)", cf::NDI_RED | cf::NDI_UNIQUE);
21 $pl->socket->buggy_mapscroll; 21 $pl->ns->buggy_mapscroll (1);
22 } 22 }
23 23
24 if ($is_jx) { 24 if ($is_jx) {
25 $pl->ob->message ("(enabling buggy map scroll workaround)", cf::NDI_RED | cf::NDI_UNIQUE); 25 $pl->ob->message ("(enabling buggy map scroll workaround)", cf::NDI_RED | cf::NDI_UNIQUE);
26 $pl->socket->buggy_mapscroll; 26 $pl->ns->buggy_mapscroll (1);
27 } 27 }
28 28
29 if ($is_jx) { 29 if ($is_jx) {
30 $pl->ob->message ("You are using a known to be buggy client (an alpha version, too). " 30 $pl->ob->message ("You are using a known to be buggy client (an alpha version, too). "
31 . "If you encounter map freezes or other bugs, consider using a more stable client " 31 . "If you encounter map freezes or other bugs, consider using a more stable client "
44Your client ($client) is known to be buggy. Upgrading is highly recommended, otherwise you may experience crashes, strange lockups or other problems. 44Your client ($client) is known to be buggy. Upgrading is highly recommended, otherwise you may experience crashes, strange lockups or other problems.
45 45
46EOF 46EOF
47 } 47 }
48 }, 48 },
49; 49);
50 50

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines