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

Comparing deliantra/server/ext/highscore.ext (file contents):
Revision 1.9 by root, Fri Feb 3 03:01:44 2012 UTC vs.
Revision 1.10 by root, Fri Feb 3 03:59:17 2012 UTC

2 2
3use Fcntl (); 3use Fcntl ();
4use Coro::AIO; 4use Coro::AIO;
5 5
6CONF HIGHSCORE_ENTRIES = 1000 6CONF HIGHSCORE_ENTRIES = 1000
7CONF EXPORT_HIGHSCORE = "www.deliantra.net/highscore.json"
7 8
8our $HIGHSCORE; 9our $HIGHSCORE;
9 10
10# [name, title, exp, killer, where, hp, sp, gp, uuid] 11# [name, title, exp, killer, where, hp, sp, gp, uuid]
11 12
148 $ob->send_msg ($SCORE_CHANNEL => $msg, cf::NDI_CLEAR); 149 $ob->send_msg ($SCORE_CHANNEL => $msg, cf::NDI_CLEAR);
149 150
150 if ($save) { 151 if ($save) {
151 save_highscore 152 save_highscore
152 or die "unable to write highscore file: $!"; 153 or die "unable to write highscore file: $!";
154
155 if (defined $EXPORT_HIGHSCORE) {
156 cf::get_slot 0.05, 0, "highscore export";
157
158 my $rank;
159 my @highscore = map {
160 my ($name, $title, $exp, $killer, $map, $hp, $sp, $grace) = @$_;
161 [++$rank, $name, $title, (cf::exp_to_level $exp), $exp, $killer, $map, $hp, $sp, $grace]
162 } @$HIGHSCORE;
163
164 cf::replace_file $EXPORT_HIGHSCORE, cf::encode_json {
165 version => 1,
166 date => $cf::NOW,
167 data => \@highscore,
168 };
169 }
153 } 170 }
154} 171}
155 172

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines