--- deliantra/server/lib/cf.pm 2007/09/09 06:25:46 1.360 +++ deliantra/server/lib/cf.pm 2007/09/09 12:52:48 1.361 @@ -1279,6 +1279,20 @@ =over 4 +=item cf::player::num_playing + +Returns the official number of playing players, as per the Crossfire metaserver rules. + +=cut + +sub num_playing { + scalar grep + $_->ob->map + && !$_->hidden + && !$_->ob->flag (cf::FLAG_WIZ), + cf::player::list +} + =item cf::player::find $login Returns the given player object, loading it if necessary (might block).