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

Comparing deliantra/server/ext/commands.ext (file contents):
Revision 1.76 by root, Mon Apr 12 05:22:37 2010 UTC vs.
Revision 1.79 by root, Fri May 7 19:46:18 2010 UTC

60 if ($login eq $pl->name) { 60 if ($login eq $pl->name) {
61 $pl->message ("Very funny, $login. Ha. Ha.", cf::NDI_REPLY); 61 $pl->message ("Very funny, $login. Ha. Ha.", cf::NDI_REPLY);
62 } elsif (cf::player::find_active $login) { 62 } elsif (cf::player::find_active $login) {
63 $pl->message ("$login is right here on this server!", cf::NDI_REPLY); 63 $pl->message ("$login is right here on this server!", cf::NDI_REPLY);
64 } elsif (cf::player::exists $login 64 } elsif (cf::player::exists $login
65 and stat cf::player::path $login) { 65 and !Coro::AIO::aio_stat cf::player::path $login) {
66 my $time = (stat _)[9]; 66 my $time = (stat _)[9];
67 67
68 $pl->message ("$login was last seen here " 68 $pl->message ("$login was last seen here "
69 . (POSIX::strftime "%Y-%m-%d %H:%M:%S +0000", gmtime $time) 69 . (POSIX::strftime "%Y-%m-%d %H:%M:%S +0000", gmtime $time)
70 . " which was " . (int +(time - $time) / 3600) . " hours ago.", cf::NDI_REPLY); 70 . " which was " . (int +(time - $time) / 3600) . " hours ago.", cf::NDI_REPLY);
129# unless $ob; 129# unless $ob;
130# 130#
131# $pl->contr->mark ($ob); 131# $pl->contr->mark ($ob);
132# $pl->reply (undef, (sprintf "Marked item %s", $ob->name, $ob->title)); 132# $pl->reply (undef, (sprintf "Marked item %s", $ob->name, $ob->title));
133# } else { 133# } else {
134# my $ob = $pl->find_marked_object; 134# my $ob = $pl->mark;
135# 135#
136# $pl->reply (undef, $ob 136# $pl->reply (undef, $ob
137# ? (sprintf "%s %s * is marked.", $ob->name, $ob->title) 137# ? (sprintf "%s %s * is marked.", $ob->name, $ob->title)
138# : "You have no marked object."); 138# : "You have no marked object.");
139# } 139# }
145 my $observe = $ob->contr->observe; 145 my $observe = $ob->contr->observe;
146 146
147 my $map = $observe->map 147 my $map = $observe->map
148 or return; 148 or return;
149 149
150 my $msg = '';
151
152 if ($map->name ne '') {
153 $msg .= sprintf "%s [%s] ", $map->name, $map->visible_name
154 } else {
155 $msg .= sprintf "%s ", $map->visible_name
156 }
157
158 if ($map->visible_name ne $map->path) {
159 $msg .= sprintf "(%s) ", $map->path;
160 }
161
150 my $msg = sprintf "%s (%s)\r%s", $map->name, $map->path, $observe->region->longname; 162 $msg .= sprintf "\r%s", $observe->region->longname;
151 $msg .= sprintf "\rplayers: %d difficulty: %d size: %d start: %dx%d timeout: %d", 163
152 (scalar $map->players), $map->difficulty, $map->width, $map->height, $map->enter_x, $map->enter_y, $map->timeout 164 $msg .= sprintf "\rplayers: %d difficulty: %d"
165 . "\rsize: %dx%d start: %dx%d position: (%d|%d) timeout: %d",
166 (scalar $map->players),
167 $map->difficulty,
168 $map->width, $map->height,
169 $map->enter_x, $map->enter_y,
170 $ob->x, $ob->y,
171 $map->timeout
153 if $ob->flag (cf::FLAG_WIZ); 172 if $ob->flag (cf::FLAG_WIZ);
154 173
155 $ob->send_msg ("c/mapinfo" => $msg, cf::NDI_REPLY | cf::NDI_CLEAR); 174 $ob->send_msg ("c/mapinfo" => $msg, cf::NDI_REPLY | cf::NDI_CLEAR);
156}; 175};
157 176
319 338
320 if (length $from) { 339 if (length $from) {
321 $item = $ob->find_best_object_match ($from) 340 $item = $ob->find_best_object_match ($from)
322 or return $ob->message ("rename: could not find a matching item to rename."); 341 or return $ob->message ("rename: could not find a matching item to rename.");
323 } else { 342 } else {
324 $item = $ob->find_marked_object 343 $item = $ob->mark
325 or return $ob->message ("rename: no from name and no marked item found to rename."); 344 or return $ob->message ("rename: no from name and no marked item found to rename.");
326 } 345 }
327 346
328 $item->custom_name (length $to ? $to : undef); 347 $item->custom_name (length $to ? $to : undef);
329 348

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines