--- deliantra/server/ext/chat.ext 2007/04/13 05:32:12 1.13 +++ deliantra/server/ext/chat.ext 2007/05/19 11:04:16 1.17 @@ -38,6 +38,8 @@ my $player = cf::player::find_active $pl->name; if ($msg ne "") { + $msg = 10 if $msg > 10; + my $prev_listen = $player->listening; $player->listening ($msg); if ($prev_listen == $player->listening) { @@ -764,14 +766,12 @@ if ($msg) { my $name = $pl->name; - utf8::encode $msg; # ->message not yet utf8-ified $_->ob->message ("$name says: $msg", cf::NDI_GREY | cf::NDI_UNIQUE) for grep $pl->on_same_map_as ($_->ob), cf::player::list; - utf8::decode $msg; # npcs, magic_ears etc. - # first find all objects and theirt-level inventories - # within a 5x5 square # that have something resembling + # first find all objects and their first-level inventories + # within a 5x5 square that have something resembling # dialogue or support on_say. my ($map, $x, $y) = ($pl->map, $pl->x - 2, $pl->y - 2); @@ -825,9 +825,8 @@ my $name = $pl->name; my $NOW = time; - utf8::encode $msg; # ->message not yet utf8-ified cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; - ext::schmorp_irc::do_notice (sprintf "[%s] %s", $name, $msg); + ext::irc::do_notice (sprintf "[%s] %s", $name, $msg); $_->ob->message ("$name chats: $msg", cf::NDI_BLUE) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; @@ -849,9 +848,8 @@ my $name = $pl->name; cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; - ext::schmorp_irc::do_notice (sprintf "\007\0034{%s} %s\n", $name, $msg); + ext::irc::do_notice (sprintf "\007\0034{%s} %s\n", $name, $msg); - utf8::encode $msg; # ->message not yet utf8-ified $_->ob->message ("$name shouts: $msg", cf::NDI_RED) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; @@ -873,7 +871,7 @@ if ($target =~ /irc\//) { my (undef, $nick) = split /\//, $target, 2; $pl->message ("You tell $target: $args"); - ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $msg); + ext::irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $msg); } elsif (my $other = cf::player::find_active $target) { if ($msg) { @@ -883,7 +881,6 @@ $pl->message ("$target ignores what you say. Give up on it.", cf::NDI_UNIQUE); } else { return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl->contr, $msg); - utf8::encode $msg; # ->message not yet utf8-ified cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; $pl->message ("You tell $target: $msg"); @@ -910,7 +907,7 @@ if ($pl->{ext_last_tell} =~ /irc\//) { my (undef, $nick) = split /\//, $pl->{ext_last_tell}, 2; $pl->message ("You tell " . $pl->{ext_last_tell} . ": $args"); - ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $args); + ext::irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $args); } elsif (my $other = cf::player::find_active $pl->{ext_last_tell}) { if ($args) { @@ -918,7 +915,6 @@ or delete $other->ob->{ext_ignore_tell}{$name}; if ($other->ob->{ext_ignore_tell}{$name} < time) { - utf8::encode $args; # ->message not yet utf8-ified cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $other->ob->name, $args; $pl->message ("You tell " . $other->ob->name . ": $args");