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

Comparing deliantra/server/ext/chat.ext (file contents):
Revision 1.11 by pippijn, Thu Mar 1 14:17:49 2007 UTC vs.
Revision 1.13 by root, Fri Apr 13 05:32:12 2007 UTC

880 if ($target eq $name) { 880 if ($target eq $name) {
881 $pl->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); 881 $pl->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE);
882 } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { 882 } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) {
883 $pl->message ("$target ignores what you say. Give up on it.", cf::NDI_UNIQUE); 883 $pl->message ("$target ignores what you say. Give up on it.", cf::NDI_UNIQUE);
884 } else { 884 } else {
885 return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl->contr, $msg);
885 utf8::encode $msg; # ->message not yet utf8-ified 886 utf8::encode $msg; # ->message not yet utf8-ified
886 cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; 887 cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg;
887 888
888 $pl->message ("You tell $target: $msg"); 889 $pl->message ("You tell $target: $msg");
889 $other->ob->message ("$name tells you: $msg"); 890 $other->ob->message ("$name tells you: $msg");
1016 $pl->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); 1017 $pl->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE);
1017 } 1018 }
1018 } 1019 }
1019}; 1020};
1020 1021
1021cf::register_command seen => sub {
1022 my ($pl, $args) = @_;
1023
1024 if (my ($login) = $args =~ /(\S+)/) {
1025 if ($login eq $pl->name) {
1026 $pl->message ("Very funny, $login. Ha. Ha.", cf::NDI_UNIQUE);
1027 } elsif (cf::player::find_active $login) {
1028 $pl->message ("$login is right here on this server!", cf::NDI_UNIQUE);
1029 } elsif (cf::player::exists $login
1030 and stat sprintf "%s/%s/%s/%s.pl", cf::localdir, cf::playerdir, ($login) x 2) {
1031 my $time = (stat _)[9];
1032
1033 $pl->message ("$login was last seen here "
1034 . (POSIX::strftime "%Y-%m-%d %H:%M:%S +0000", gmtime $time)
1035 . " which was " . (int +(time - $time) / 3600) . " hours ago.", cf::NDI_UNIQUE);
1036 } else {
1037 $pl->message ("No player named $login is known to me.", cf::NDI_UNIQUE);
1038 }
1039 } else {
1040 $pl->message ("Usage: seen <player>", cf::NDI_UNIQUE);
1041 }
1042};
1043

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines