--- deliantra/server/ext/chat.ext 2007/07/28 12:02:58 1.29 +++ deliantra/server/ext/chat.ext 2007/08/10 05:38:16 1.30 @@ -64,8 +64,8 @@ my ($pl) = @_; clean_timeouts $pl->ob; - $pl->ns->send_msg ($SAY_CHANNEL); - $pl->ns->send_msg ($CHAT_CHANNEL); + $pl->send_msg ($SAY_CHANNEL); + $pl->send_msg ($CHAT_CHANNEL); }, ); @@ -96,10 +96,10 @@ my $coin = int rand 2 ? "Heads" : "Tails"; - $_->ns->send_msg ($SAY_CHANNEL => "$name flips a coin.... $coin!", cf::NDI_GREY) + $_->send_msg ($SAY_CHANNEL => "$name flips a coin.... $coin!", cf::NDI_GREY) for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl} cf::player::list; - $pl->ns->send_msg ($SAY_CHANNEL => "You flip a coin.... $coin!", cf::NDI_GREY | cf::NDI_REPLY); + $pl->send_msg ($SAY_CHANNEL => "You flip a coin.... $coin!", cf::NDI_GREY | cf::NDI_REPLY); }; cf::register_command orcknuckle => sub { @@ -112,10 +112,10 @@ my ($i, $j, $k, $l) = (rand 5, rand 5, rand 5, rand 6); my $result = "$orcknuckle[$i], $orcknuckle[$j], $orcknuckle[$k], $orcknuckle[$l]"; - $_->ns->send_msg ($SAY_CHANNEL => "$name throws his orc-knuckles and rolls $result!", cf::NDI_GREY) + $_->send_msg ($SAY_CHANNEL => "$name throws his orc-knuckles and rolls $result!", cf::NDI_GREY) for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl} cf::player::list; - $pl->ns->send_msg ($SAY_CHANNEL => "You roll $result!", cf::NDI_GREY | cf::NDI_REPLY); + $pl->send_msg ($SAY_CHANNEL => "You roll $result!", cf::NDI_GREY | cf::NDI_REPLY); }; my $emotes = { @@ -717,13 +717,13 @@ $emote{other} =~ s//$name/; - $_->ns->send_msg ($CHAT_CHANNEL, $emote{other}, cf::NDI_GREY) + $_->send_msg ($CHAT_CHANNEL, $emote{other}, cf::NDI_GREY) for grep { $ob->on_same_map_as ($_->ob) && $_ != $ob} cf::player::list; - $pl->ns->send_msg ($emote{self}, cf::NDI_GREY | cf::NDI_REPLY); + $pl->send_msg ($emote{self}, cf::NDI_GREY | cf::NDI_REPLY); } elsif ($tname) { my $target = cf::player::find $tname - or return $pl->ns->send_msg (tell_channel $tname, "$tname is not around.", cf::NDI_DK_ORANGE | cf::NDI_REPLY); + or return $pl->send_msg (tell_channel $tname, "$tname is not around.", cf::NDI_DK_ORANGE | cf::NDI_REPLY); my %emote = %{ $emotes->{$emotion}->{params} || {} }; @@ -736,11 +736,11 @@ $emote{other} =~ s//$tname/; $emote{other} =~ s//$name/; - $_->ns->send_msg ($CHAT_CHANNEL, $emote{other}, cf::NDI_GREY) + $_->send_msg ($CHAT_CHANNEL, $emote{other}, cf::NDI_GREY) for grep { $_ != $pl && $_ != $target && $ob->on_same_map_as ($_->ob) } cf::player::list; - $target->ns->send_msg (tell_channel $name, $emote{target}, cf::NDI_GREY); - $pl->ns->send_msg (tell_channel $tname, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY); + $target->send_msg (tell_channel $name, $emote{target}, cf::NDI_GREY); + $pl->send_msg (tell_channel $tname, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY); } else { my %emote = %{ $emotes->{$emotion}->{noparams} || {} }; @@ -749,10 +749,10 @@ $emote{other} =~ s//$name/; - $_->ns->send_msg ($CHAT_CHANNEL, $emote{other}, cf::NDI_GREY) + $_->send_msg ($CHAT_CHANNEL, $emote{other}, cf::NDI_GREY) for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl } cf::player::list; - $pl->ns->send_msg ($CHAT_CHANNEL, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY); + $pl->send_msg ($CHAT_CHANNEL, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY); } }; }; @@ -763,7 +763,7 @@ my $name = $pl->name; - $_->ns->send_msg ($SAY_CHANNEL => "* $name $msg", cf::NDI_GREY | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0)) + $_->send_msg ($SAY_CHANNEL => "* $name $msg", cf::NDI_GREY | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0)) for grep $pl->on_same_map_as ($_->ob), cf::player::list; }; @@ -778,7 +778,7 @@ my $name = $ob->name; my @plonmap = grep $ob->on_same_map_as ($_->ob), cf::player::list; - $_->ns->send_msg ($SAY_CHANNEL => "$name says: $msg", cf::NDI_GREY | ($_ == $ob ? cf::NDI_REPLY : 0)) + $_->send_msg ($SAY_CHANNEL => "$name says: $msg", cf::NDI_GREY | ($_ == $ob ? cf::NDI_REPLY : 0)) for @plonmap; # npcs, magic_ears etc. @@ -803,26 +803,26 @@ if (defined $reply) { if ($npc->type == cf::MAGIC_EAR) { if (length $reply) { - $_->ns->send_msg ($SAY_CHANNEL => $reply, cf::NDI_BROWN) + $_->send_msg ($SAY_CHANNEL => $reply, cf::NDI_BROWN) for @plonmap; } $npc->use_trigger; } else { if (length $reply) { - $_->ns->send_msg ($SAY_CHANNEL => $npc->name . " says: $reply", cf::NDI_BROWN) + $_->send_msg ($SAY_CHANNEL => $npc->name . " says: $reply", cf::NDI_BROWN) for @plonmap; } } } if (@kw) { - $_->ns->send_msg ($SAY_CHANNEL => "[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN) + $_->send_msg ($SAY_CHANNEL => "[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN) for @plonmap; } } } else { - $ob->contr->ns->send_msg ($SAY_CHANNEL => "What do you want to say?", cf::NDI_GREY | cf::NDI_REPLY); + $ob->send_msg ($SAY_CHANNEL => "What do you want to say?", cf::NDI_GREY | cf::NDI_REPLY); } }; @@ -842,11 +842,11 @@ cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; send_irc ("[%s] %s", $name, $msg); - $_->ns->send_msg ($CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0)) + $_->send_msg ($CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0)) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; } else { - $pl->ns->send_msg ($CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); + $pl->send_msg ($CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); } }; @@ -866,11 +866,11 @@ cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; send_irc ("\007\0034{%s} %s\n", $name, $msg); - $_->ns->send_msg ($CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0)) + $_->send_msg ($CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0)) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; } else { - $pl->ns->send_msg ($CHAT_CHANNEL => "Shout what?", cf::NDI_RED | cf::NDI_DEF | cf::NDI_REPLY); + $pl->send_msg ($CHAT_CHANNEL => "Shout what?", cf::NDI_RED | cf::NDI_DEF | cf::NDI_REPLY); } }; @@ -907,7 +907,7 @@ cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; $ns->send_msg ($pl_channel => "You tell $target: $msg", cf::NDI_DK_ORANGE | cf::NDI_DEF | cf::NDI_REPLY); - $other->ns->send_msg ($other_channel => "$name tells you: $msg", cf::NDI_DK_ORANGE | cf::NDI_DEF); + $other->send_msg ($other_channel => "$name tells you: $msg", cf::NDI_DK_ORANGE | cf::NDI_DEF); } } else { $ns->send_msg ($pl_channel => "What do you want to tell $target?", cf::NDI_DK_ORANGE | cf::NDI_DEF | cf::NDI_REPLY);