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

Comparing deliantra/server/ext/schmorplog.ext (file contents):
Revision 1.10 by root, Mon Jun 11 22:18:03 2007 UTC vs.
Revision 1.11 by root, Wed Nov 14 08:09:46 2007 UTC

1#! perl # depends=irc 1#! perl # depends=irc
2 2
3our $UPDATE_LOGINS = Event->idle (repeat => 0, min => 1, data => cf::WF_AUTOCANCEL, cb => Coro::unblock_sub { 3our $UPDATE_LOGINS = EV::idle Coro::unblock_sub {
4 $_[0]->stop;
5
4 my ($status, @pl) = ext::commands::who_listing; 6 my ($status, @pl) = ext::commands::who_listing;
5 7
6 #TODO: write files asynchronously 8 #TODO: write files asynchronously
7 open my $fh, ">", "$LOCALDIR/usercount"; 9 open my $fh, ">", "$LOCALDIR/usercount";
8 print $fh scalar @pl; 10 print $fh scalar @pl;
10 open my $fh, ">", "$LOCALDIR/userlisting.html"; 12 open my $fh, ">", "$LOCALDIR/userlisting.html";
11 for ($status, @pl) { 13 for ($status, @pl) {
12 s/[<&]//g; 14 s/[<&]//g;
13 print $fh "$_<br />\n"; 15 print $fh "$_<br />\n";
14 } 16 }
15}); 17};
16 18
17cf::player->attach ( 19cf::player->attach (
18 on_login => sub { 20 on_login => sub {
19 my ($pl) = @_; 21 my ($pl) = @_;
20 $pl->ob->set_ob_key_value (schmorplog_last_login => time); 22 $pl->ob->set_ob_key_value (schmorplog_last_login => time);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines