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

Comparing deliantra/server/ext/ipo.ext (file contents):
Revision 1.1 by root, Fri Dec 15 19:29:18 2006 UTC vs.
Revision 1.3 by root, Tue Dec 26 09:56:52 2006 UTC

72 my $r = $cb->($o, @a); 72 my $r = $cb->($o, @a);
73 $map->insert_object ($o, $x, $y); 73 $map->insert_object ($o, $x, $y);
74 $r 74 $r
75} 75}
76 76
77# this handler handles to notice the player that he has got mail 77# this handler notifies the player of new mail
78cf::attach_to_players 78cf::player->attach (
79 on_login => sub { 79 on_login => sub {
80 my ($pl) = @_; 80 my ($pl) = @_;
81 81
82 my $mails = CFMail::get_mail ($pl->ob->name); 82 my $mails = CFMail::get_mail ($pl->ob->name);
83 83
89 $pl->ob->message ("You got $cnt mails."); 89 $pl->ob->message ("You got $cnt mails.");
90 } else { 90 } else {
91 $pl->ob->message ("You haven't got any mail."); 91 $pl->ob->message ("You haven't got any mail.");
92 } 92 }
93 }, 93 },
94; 94);
95 95
96# this event handler handles receiving of mails 96# this event handler handles receiving of mails
97cf::register_attachment ipo_mailbox => 97cf::object::attachment ipo_mailbox =>
98 on_apply => sub { 98 on_apply => sub {
99 my ($box, $pl) = @_; 99 my ($box, $pl) = @_;
100 100
101 my $cnt; 101 my $cnt;
102 my $mails = CFMail::get_mail ($pl->name) || []; 102 my $mails = CFMail::get_mail ($pl->name) || [];
258package CFMail; 258package CFMail;
259 259
260use POSIX qw/strftime/; 260use POSIX qw/strftime/;
261use CFDB; 261use CFDB;
262 262
263my $MAILDB = CFDB->new (db_file => cf::localdir . "/crossfiremail.perl"); 263my $MAILDB = CFDB->new (db_file => cf::localdir . "/crossfiremail");
264 264
265sub get_mail { 265sub get_mail {
266 my ($toname) = @_; 266 my ($toname) = @_;
267 $MAILDB->get ($toname); 267 $MAILDB->get ($toname);
268} 268}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines