ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/commands.ext
(Generate patch)

Comparing deliantra/maps/perl/commands.ext (file contents):
Revision 1.2 by root, Thu Sep 14 19:36:17 2006 UTC vs.
Revision 1.3 by root, Thu Sep 14 19:39:09 2006 UTC

2 2
3# miscellaneous commands 3# miscellaneous commands
4 4
5sub rename_to($$$) { 5sub rename_to($$$) {
6 my ($ob, $from, $to) = @_; 6 my ($ob, $from, $to) = @_;
7
8 warn "<$ob|$from|$to>\n";#d#
9 7
10 $to =~ /^[a-zA-Z0-9.,=#\/%$!^]*$/ 8 $to =~ /^[a-zA-Z0-9.,=#\/%$!^]*$/
11 or return $ob->message ("rename: name must consist only of letters, digits, spaces and a few other things."); 9 or return $ob->message ("rename: name must consist only of letters, digits, spaces and a few other things.");
12 10
13 127 >= length $to 11 127 >= length $to
39} 37}
40 38
41cf::register_command rename => 0, sub { 39cf::register_command rename => 0, sub {
42 my ($ob, $arg) = @_; 40 my ($ob, $arg) = @_;
43 41
44 warn "<<<$arg>>>\n";#d#
45
46 if ($arg =~ /^\s* (?: <([^>]+)> \s+)? to \s+ <([^>]+)> \s*$/x) { 42 if ($arg =~ /^\s* (?: <([^>]+)> \s+)? to \s+ <([^>]+)> \s*$/x) {
47 # compatibility syntax 43 # compatibility syntax
48 rename_to $ob, $1, $2; 44 rename_to $ob, $1, $2;
49 } elsif ($arg =~ / 45 } elsif ($arg =~ /
50 ^\s* 46 ^\s*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines