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

Comparing deliantra/server/ext/board.ext (file contents):
Revision 1.5 by root, Wed Apr 18 14:24:09 2007 UTC vs.
Revision 1.7 by root, Mon Sep 22 06:30:31 2008 UTC

1#! perl 1#! perl
2 2
3sub do_help { 3sub do_help {
4 my ($board, $who, $npc) = @_; 4 my ($board, $who, $npc) = @_;
5 $who->reply ($npc, 5 $who->reply ($npc,
6 "Help for $board\n" 6 "Help for $board\n\n"
7 ."List of commands:\n\n" 7 . "List of commands:\n\n"
8 ."- list\n" 8 . " - list\n"
9 ."- write <message>\n" 9 . " - write <message>\n"
10 ."- remove <id>\n" 10 . " - remove <id>\n"
11 ); 11 );
12} 12}
13 13
14sub do_write { 14sub do_write {
15 my ($board, $msg, $who, $npc) = @_; 15 my ($board, $msg, $who, $npc) = @_;
23} 23}
24 24
25sub do_list { 25sub do_list {
26 my ($board, $who, $npc) = @_; 26 my ($board, $who, $npc) = @_;
27 my $cont = CFBoard::get ($board); 27 my $cont = CFBoard::get ($board);
28 if (@{$cont || []}) {
29 $who->reply ($npc, "$board content:");
30 my $idx = 0;
31 for (@$cont) { 28 if (@$cont) {
32 $who->reply ($npc, "<$idx> $_->[0]: $_->[1]"); 29 my $msg = "$board content:\n\n";
33 $idx++; 30 $msg .= "<$_> $cont->[$_][0]: $cont->[$_][1]\r"
34 } 31 for 0 .. $#$cont;
32 $who->reply ($npc, $msg);
35 } else { 33 } else {
36 $who->reply ($npc, "$board is empty."); 34 $who->reply ($npc, "$board is empty.");
37 } 35 }
38 1 36 1
39} 37}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines