ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/version.ext
Revision: 1.6
Committed: Tue Nov 6 15:11:16 2012 UTC (11 years, 6 months ago) by root
Branch: MAIN
Changes since 1.5: +2 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #! perl # mandatory
2    
3     # the version command
4    
5     cf::client->attach (
6 root 1.2 on_connect => sub {
7     my ($ns) = @_;
8    
9 root 1.6 $ns->send_packet ("1234\x01\x00\x80\xff");
10    
11 root 1.2 $ns->send_packet ("version " . $cf::json_coder->encode ({
12     server => "Deliantra Server",
13     serverver => cf::VERSION,
14     }));
15     },
16 root 1.1 on_version => sub {
17     my ($ns, $arg) = @_;
18    
19     if ($arg =~ /^\{/) {
20 root 1.4 # post 2.10
21 root 1.1 my $ver = $cf::json_coder->decode ($arg);
22     $ns->{version} = $ver;
23     $ns->{who_version} = "$ver->{clientver} $ver->{osver}";
24     } elsif ($arg =~ /^(\d+) (\d+) (.*)$/) {
25 root 1.2 # 2.10 and earlier
26 root 1.1 $ns->{who_version} = $3;
27     $ns->{version} = {
28     protover => 0,
29     cs_version => $1,
30     sc_version => $2,
31     client => $3,
32     };
33     }
34 root 1.4
35 root 1.5 $ns->ext_msg (capabilities =>
36     # id, name, flags (1 == 2d), edge length
37     tileset => [[1, "default 64x64 faceset", 1, 64], [0, "default 32x32 faceset", 1, 32], [2, "default text faceset", 2, 1]],
38     );
39    
40 root 1.4 # dclient prefers bump messages
41     $ns->bumpmsg ($ns->{client} eq "dclient");
42 root 1.1 },
43     );
44