ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.359 by root, Sat Sep 8 18:15:55 2007 UTC vs.
Revision 1.361 by root, Sun Sep 9 12:52:48 2007 UTC

1276use Coro::AIO; 1276use Coro::AIO;
1277 1277
1278=head3 cf::player 1278=head3 cf::player
1279 1279
1280=over 4 1280=over 4
1281
1282=item cf::player::num_playing
1283
1284Returns the official number of playing players, as per the Crossfire metaserver rules.
1285
1286=cut
1287
1288sub num_playing {
1289 scalar grep
1290 $_->ob->map
1291 && !$_->hidden
1292 && !$_->ob->flag (cf::FLAG_WIZ),
1293 cf::player::list
1294}
1281 1295
1282=item cf::player::find $login 1296=item cf::player::find $login
1283 1297
1284Returns the given player object, loading it if necessary (might block). 1298Returns the given player object, loading it if necessary (might block).
1285 1299
1891 1905
1892 { 1906 {
1893 my $guard = cf::lock_acquire "map_data:$path"; 1907 my $guard = cf::lock_acquire "map_data:$path";
1894 1908
1895 return unless $self->valid; 1909 return unless $self->valid;
1896 return if $self->in_memory != cf::MAP_SWAPPED; 1910 return unless $self->in_memory == cf::MAP_SWAPPED;
1897 1911
1898 $self->in_memory (cf::MAP_LOADING); 1912 $self->in_memory (cf::MAP_LOADING);
1899 1913
1900 $self->alloc; 1914 $self->alloc;
1901 1915

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines