ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/version.ext
Revision: 1.9
Committed: Sun Nov 11 21:34:21 2012 UTC (11 years, 6 months ago) by root
Branch: MAIN
CVS Tags: rel-3_1, HEAD
Changes since 1.8: +1 -1 lines
Log Message:
glyph size is 2

File Contents

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