Generic Broadcast Object #118

Parent #68Owner #361Flags read, fertileSource hellcore/hellcore.db

Aliases: Generic Broadcast Object

30 verbs · 49 properties · 4 children

Verbs

VerbSpecFlagsDefinerLines
announce announce_players announce_adminsthis none thisrxd#1183
identifierthis none thisrxd#1181
subscribersthis none thisrxd#1181
feature_addthis none thisrxd#1184
feature_removethis none thisrxd#1182
_whothis none thisrxd#1181
_historythis none thisrxd#1181
_renderthis none thisrxd#11850
colorthis none thisrxd#1181
_who_verbthis none thisrxd#1181
speech_colorthis none thisrxd#1187
should_scramblethis none thisrxd#1181
name_colorthis none thisrxd#11814
_old_renderthis none thisrxd#11842
recyclethis none thisrxd#1187
_render_BACKUP_OLDthis none thisrxd#11839
post_identifierthis none thisrxd#1181
tree_tagthis none thisrxd#1186
_clawscramblethis none thisrxd#11813
dino_subthis none thisrxd#11812
_announce _announce_admins _announce_playersthis none thisrxd#11842
sys_announcethis none thisrxd#1181
_announce_renderedthis none thisrxd#11815
command_onthis none thisrxd#11820
command_offthis none thisrxd#11815
command_historythis none thisrxd#11833
command_whothis none thisrxd#11823
command_namethis none thisrxd#1181
_announce_leavethis none thisrxd#1189
_announce_jointhis none thisrxd#1189

Properties

PropertyDefinerFlagsOwnerValue
subscribers#118rc#361{}
identifier#118rc#361"[generic broadcast object]"
color#118rc#361"~1b[35m"
use_real_name#118rc#3611
verbatim_color#118rc#361"~1b[36m"
history#118c#361{}
speech_color#118rc#361""
scrambling#118rc#361{}
prog_color#118rc#361""
wiz_color#118rc#361""
builder_color#118rc#361""
announce_joins#118rc#3611
history_size#118rc#36150
commands#118rc#361{"on", "off", "who", "history"}
no_admin_talk#118rc#3610
warehouse#68r#29<clear>
help_msg#68rc#361<clear>
feature_verbs#68r#29<clear>
feature_ok#68r#29<clear>
handed#5rc#361<clear>
wield_msg#5rc#361<clear>
unwield_msg#5rc#361<clear>
size#5rc#361<clear>
look_place_msg#5rc#361<clear>
value#5rc#361<clear>
get_msg#5rc#361<clear>
drop_msg#5rc#361<clear>
get_fail_msg#5rc#361<clear>
junk_ok#5rc#361<clear>
floats#5rc#361<clear>
long_name_msg#5rc#361<clear>
article#5rc#361<clear>
setup_list#5rc#361<clear>
health#5rc#361<clear>
health_max#5rc#361<clear>
min_skill#5rc#361<clear>
skill#5rc#361<clear>
recipe_for#5rc#361<clear>
carried_msg#5rc#361<clear>
aliases#1rc#361{"Generic Broadcast Object"}
description#1rc#361<clear>
object_size#1r#29{20791, 1298433815}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #68 Generic Feature Object#5 generic thing#1 root

Children: #330 heartnet, #332 generic admin broadcast network, #352 generic player broadcast network, #358 tellnet

Call graph

calls n118_3 #118:feature_add n51_36 #51:verb_or_property n118_3->n51_36 n118_7 #118:_render n118_8 #118:color n118_7->n118_8 n118_1 #118:identifier n118_7->n118_1 n118_16 #118:post_identifier n118_7->n118_16 n118_12 #118:name_color n118_7->n118_12 n118_10 #118:speech_color n118_7->n118_10 n98_0 #98:quote n118_7->n98_0 n118_13 #118:_old_render n118_13->n118_8 n118_13->n118_1 n118_13->n118_10 n118_13->n98_0 n20_39 #20:words n118_13->n20_39 n44_0 #44:match n118_13->n44_0 n118_14 #118:recycle n5_8 #5:recycle n118_14->n5_8 n118_15 #118:_render_BACKUP_OLD n118_15->n118_8 n118_15->n118_1 n118_15->n118_12 n118_15->n118_10 n118_15->n98_0 n118_15->n20_39 n118_15->n44_0 n118_17 #118:tree_tag n118_17->n118_1 n20_1 #20:left n118_17->n20_1 n118_19 #118:dino_sub n20_5 #20:from_list n118_19->n20_5 n118_20 #118:_announce n118_20->n118_7 n118_20->n118_1 n118_22 #118:_announce_rendered n118_20->n118_22 n118_2 #118:subscribers n118_22->n118_2 n118_21 #118:sys_announce n118_21->n118_20 n118_23 #118:command_on n118_23->n51_36 n118_27 #118:command_name n118_23->n118_27 n118_29 #118:_announce_join n118_23->n118_29 n118_29->n118_20 n118_29->n118_27 n45_0 #45:has_property n118_29->n45_0 n118_24 #118:command_off n118_24->n118_27 n118_28 #118:_announce_leave n118_24->n118_28 n118_28->n118_20 n118_28->n118_27 n118_28->n45_0 n118_25 #118:command_history n118_25->n51_36 n118_25->n118_27 n47_11 #47:reverse n118_25->n47_11 n35_11 #35:time_sub n118_25->n35_11 n118_26 #118:command_who n118_26->n51_36 n118_26->n118_2 n118_26->n118_27 n1_30 #1:name n118_26->n1_30 n318_3 #318:_who n118_26->n318_3

Source

announce announce_players announce_admins

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1{who, msg, ?verbatim = 0, ?subfilter = 0} = args;
2announce_verb = tostr("_", verb);
3this:(announce_verb)(@args);

identifier

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1return this.identifier;

subscribers

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1return this.subscribers;

feature_add

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1who = args[1];
2if ($code_utils:verb_or_property(this, "feature_ok", who))
3this.subscribers = setadd(this.subscribers, who);
4endif

feature_remove

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1who = args[1];
2this.subscribers = setremove(this.subscribers, who);

_who

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1raise(E_NACC, "something called $net:_who()");

_history

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1raise(E_NACC, "something called $net:_history()");

_render

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1verbatim = 0;
2if (length(args) > 2)
3verbatim = args[3];
4endif
5subfilter = 0;
6if (length(args) > 3)
7subfilter = args[4];
8endif
9msg = args[2];
10who = args[1];
11rendered = (this:color(who) + this:identifier(who, subfilter)) + $ansi.reset;
12rendered = (rendered + this:post_identifier(who)) + $ansi.reset;
13rendered = rendered + " ";
14if (verbatim)
15rendered = (rendered + this.verbatim_color) + msg;
16else
17if (has_callable_verb(this, "chat_name"))
18name = this:chat_name(who);
19name = (this:name_color(who) + name) + $ansi.reset;
20else
21name = this.use_real_name ? who:real_name() | who:name();
22name = (this:name_color(who) + name) + $ansi.reset;
23endif
24if (msg && (msg[1] == ":"))
25rendered = tostr(rendered, name, " ", this:speech_color(who), msg[2..$]);
26"disabled for masked nets (zotnet) for now, doesn't always mask correctly";
27"elseif (((msg && (msg[1] == \".\")) && (length(words = $su:words(msg[2..$])) > 0)) && (words[1] in #160.all_socials))";
28"  if ((length(words) < 1) || (length(words) > 2))";
29"    rendered = tostr(rendered, name, this:speech_color(who), \" flails about wildly.\");";
30"  else";
31"    target = #-1;";
32"    if (length(words) > 1)";
33"      target = $match_utils:match(words[2], this.subscribers);";
34"      if ((!is_a(target, $player)) || ((who.programmer == 0) && (target.programmer == 1)))";
35"        target = #-1;";
36"      endif";
37"    endif";
38"    social = #160:_get_social(who, target, words[1], name);";
39"    if (!social)";
40"      rendered = tostr(rendered, name, this:speech_color(who), \" flails about wildly.\");";
41"    else";
42"      rendered = tostr(rendered, this:speech_color(who), social);";
43"    endif";
44"  endif";
45else
46rendered = rendered + $english_utils:quote(who, msg, this.use_real_name, name + this:speech_color(who));
47endif
48endif
49rendered = rendered + $ansi.reset;
50return rendered;

color

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1return this.color;

_who_verb

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1args[1]:who(args[2]);

speech_color

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1who = args[1];
2if ((is_a(who, $immortal) && (!is_a(who, $wiz))) && (this.prog_color != ""))
3return this.prog_color;
4elseif (is_a(who, $wiz) && (this.wiz_color != ""))
5return this.wiz_color;
6endif
7return this.speech_color;

should_scramble

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1return 0;

name_color

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1if (!args)
2return this.speech_color;
3endif
4who = args[1];
5if (!(who in $rpg.bots))
6if (is_a(who, $wiz) && (this.wiz_color != ""))
7return this.wiz_color;
8elseif (is_a(who, $prog) && (this.prog_color != ""))
9return this.prog_color;
10elseif (is_a(who, $builder) && (this.builder_color != ""))
11return this.builder_color;
12endif
13endif
14return this.speech_color;

_old_render

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1"Copied from Generic Broadcast Object (#118):_render by Marvin (#241405) Tue Nov 11 03:22:00 2008 CST";
2verbatim = 0;
3if (length(args) > 2)
4verbatim = args[3];
5endif
6msg = args[2];
7who = args[1];
8rendered = ((this:color(who) + this:identifier(who)) + $ansi.reset) + " ";
9if (verbatim)
10rendered = (rendered + this.verbatim_color) + msg;
11else
12rendered = rendered + this:speech_color(who);
13if (msg && (msg[1] == ":"))
14if (this.use_real_name == 1)
15rendered = (rendered + (who:real_name() + " ")) + msg[2..$];
16else
17rendered = (rendered + (who:name() + " ")) + msg[2..$];
18endif
19elseif (((msg && (msg[1] == ".")) && (length(words = $su:words(msg[2..$])) > 0)) && (words[1] in #160.all_socials))
20if ((length(words) < 1) || (length(words) > 2))
21rendered = tostr(rendered, this.use_real_name ? who:real_name() | who:name(), " flails about wildly.");
22else
23target = #-1;
24if (length(words) > 1)
25target = $match_utils:match(words[2], this.subscribers);
26if ((!is_a(target, $player)) || ((who.programmer == 0) && (target.programmer == 1)))
27target = #-1;
28endif
29endif
30social = #160:_get_social(who, target, words[1]);
31if (!social)
32rendered = tostr(rendered, this.use_real_name ? who:real_name() | who:name(), " flails about wildly.");
33else
34rendered = tostr(rendered, social);
35endif
36endif
37else
38rendered = rendered + $english_utils:quote(who, msg, this.use_real_name);
39endif
40endif
41rendered = rendered + $ansi.reset;
42return rendered;

recycle

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1r = pass(@args);
2for x in (this.subscribers)
3if (is_a(x, $player))
4x:remove_feature(this);
5endif
6endfor
7return r;

_render_BACKUP_OLD

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1verbatim = 0;
2if (length(args) > 2)
3verbatim = args[3];
4endif
5msg = args[2];
6who = args[1];
7rendered = ((this:color(who) + this:identifier(who)) + $ansi.reset) + " ";
8if (verbatim)
9rendered = (rendered + this.verbatim_color) + msg;
10else
11rendered = rendered + this:speech_color(who);
12name = this.use_real_name ? who:real_name() | who:name();
13name = (this:name_color(who) + name) + $ansi.reset;
14if (msg && (msg[1] == ":"))
15rendered = (rendered + (name + " ")) + msg[2..$];
16elseif (((msg && (msg[1] == ".")) && (length(words = $su:words(msg[2..$])) > 0)) && (words[1] in #160.all_socials))
17if ((length(words) < 1) || (length(words) > 2))
18rendered = tostr(rendered, name, " flails about wildly.");
19else
20target = #-1;
21if (length(words) > 1)
22target = $match_utils:match(words[2], this.subscribers);
23if ((!is_a(target, $player)) || ((who.programmer == 0) && (target.programmer == 1)))
24target = #-1;
25endif
26endif
27social = #160:_get_social(who, target, words[1], name);
28if (!social)
29rendered = tostr(rendered, name, " flails about wildly.");
30else
31rendered = tostr(rendered, social);
32endif
33endif
34else
35rendered = rendered + $english_utils:quote(who, msg, this.use_real_name, name);
36endif
37endif
38rendered = rendered + $ansi.reset;
39return rendered;

post_identifier

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1return "";

tree_tag

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1if (this.subscribers)
2msg = (($su:left(length(this.subscribers), 10) + this.color) + `this:identifier() ! ANY => ""') + $ansi.reset;
3return msg;
4else
5return "";
6endif

_clawscramble

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1"Copied from Setesh (#396060):_scramble by Gilmore (#98) Sat Jun 20 17:17:01 2009 CDT";
2"Copied from abomination (#286586):_scramble by Gilmore (#98) Sat Jun 20 17:16:08 2009 CDT";
3msg = args[1];
4garble = 25 + random(50);
5nm = "";
6for x in [1..length(msg)]
7if (index($su.alphabet, msg[x]) && (random(100) < garble))
8nm = nm + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[random(26)];
9else
10nm = nm + msg[x];
11endif
12endfor
13return nm;

dino_sub

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1msg = {};
2rarstr = "";
3words = random(4) + 1;
4ltrs = {"a", "aa", "aaa", "aaaa", "aaaaa"};
5arrs = {"r", "rr", "rrr"};
6letter = "";
7for x in [1..words]
8letter = (random(100) <= 20) ? {"o", "oo"}[random($)] | "";
9rarstr = ((arrs[random($)] + letter) + ltrs[random($)]) + arrs[random($)];
10msg = {@msg, rarstr};
11endfor
12return tostr($su:from_list(msg, " "), {"!", "!!"}[random($)]);

_announce _announce_admins _announce_players

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1{who, msg, ?verbatim = 0, ?subfilter = 0} = args;
2if (is_a(who, $player) && (!verbatim))
3if (who.last_broadcast[3] == 0)
4who.last_broadcast = {msg, 0, time(), this};
5endif
6if (((this == who.last_broadcast[4]) && (msg == who.last_broadcast[1])) && ((time() - who.last_broadcast[3]) < 3))
7who.last_broadcast[2] = who.last_broadcast[2] + 1;
8if (who.last_broadcast[2] >= 4)
9endif
10who.last_broadcast = {msg, who.last_broadcast[2], time(), this};
11else
12who.last_broadcast = {msg, 0, time(), this};
13endif
14if (length(msg) > 1000)
15msg = msg[1..1000];
16endif
17endif
18id = this:identifier(who, subfilter);
19rendered = this:_render(who, msg, verbatim, subfilter);
20if (this.history_size)
21if (!subfilter)
22this.history = {{rendered, time()}, @this.history};
23this.history = this.history[1..min($, this.history_size)];
24endif
25else
26this.history = {};
27endif
28"We need to set argstr blank here just in case it reveals sensitive information.";
29"This can be the case if, for instance, a message is sent to a comm net when a";
30"player connects.";
31argstr = "";
32if ((valid(who) && is_player(who)) && who.programmer)
33"this:_announce_rendered(rendered_masked, subfilter, -1);";
34"this:_announce_rendered(rendered, subfilter, 1);";
35this:_announce_rendered(rendered, subfilter);
36elseif (verb == "_announce_admins")
37this:_announce_rendered(rendered, subfilter, 1);
38elseif (verb == "_announce_players")
39this:_announce_rendered(rendered, subfilter, -1);
40else
41this:_announce_rendered(rendered, subfilter);
42endif

sys_announce

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1return this:_announce(caller, tostr(@args), 1);

_announce_rendered

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1rendered = args[1];
2admin_only = 0;
3if (length(args) > 2)
4admin_only = args[3];
5endif
6for x in (this:subscribers())
7yield;
8if (!is_a(x, $player))
9x:tell(rendered);
10elseif (is_connected(x) || `x.always_hear_net ! ANY')
11if (((admin_only == 0) || ((admin_only == -1) && (!x.programmer))) || ((admin_only == 1) && x.programmer))
12x:net_receive(rendered);
13endif
14endif
15endfor

command_on

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1{who, params} = args;
2if (params)
3who:tell(tostr("Usage: ", this:command_name(), " on"));
4return 0;
5elseif (who in this.subscribers)
6who:tell(tostr("You're already on ", this:command_name(), "."));
7return 0;
8elseif (!$code_utils:verb_or_property(this, "feature_ok", who))
9who:tell(tostr("You do not have access to join ", this:command_name(), "."));
10return 0;
11elseif ((!is_a(who, $immortal)) && (!who:cooldown_check(tostr("join ", this:command_name()), `this.cooldown ! E_PROPNF => 1800', 0, 1)))
12return 0;
13endif
14who:add_feature(this);
15if (this.no_admin_talk && is_a(who, $immortal))
16who:tell(tostr($ansi.bold_on, "You're now listening to ", this:command_name(), " (but cannot speak).", $ansi.reset));
17else
18this:_announce_join(who);
19endif
20return 1;

command_off

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1{who, params} = args;
2if (params)
3who:tell(tostr("Usage: ", this:command_name(), " off"));
4return 0;
5elseif (!(who in this.subscribers))
6who:tell(tostr("You're not on ", this:command_name(), "."));
7return 0;
8endif
9if (this.no_admin_talk && is_a(who, $immortal))
10who:tell(tostr($ansi.bold_on, "You're no longer listening to ", this:command_name(), ".", $ansi.reset));
11else
12this:_announce_leave(who);
13endif
14who:remove_feature(this);
15return 1;

command_history

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1{who, params} = args;
2if (params)
3who:tell(tostr("Usage: ", this:command_name(), " history"));
4return 0;
5elseif (!$code_utils:verb_or_property(this, "feature_ok", who))
6who:tell(tostr("You do not have access to see the history of ", this:command_name(), "."));
7return 0;
8elseif ((!is_a(who, $immortal)) && (!who:cooldown_check(tostr("join ", this:command_name()), `this.cooldown ! E_PROPNF => 1800', 0, 1)))
9who:tell(tostr("You do not have access to see the history of ", this:command_name(), "."));
10return 0;
11endif
12if (!this.history)
13who:tell("There is no history to be had.");
14else
15one_day = (60 * 60) * 24;
16previous_time = 0;
17previous_day = "";
18day = "";
19for entry in ($lu:reverse(this.history))
20{msg_text, msg_time} = entry;
21previous_day = day;
22yield;
23day = $time_utils:time_sub("$D, $N $t, $Y:", msg_time);
24if (day != previous_day)
25who:tell(tostr($ansi.bg_blue, $ansi.bold, day, $ansi.reset));
26endif
27time = $time_utils:time_sub("$O:$M $p", msg_time);
28"If the message is older than a day...";
29who:tell(tostr($ansi.cyan, time, $ansi.reset, " ", msg_text, $ansi.reset));
30previous_time = msg_time;
31endfor
32endif
33return 1;

command_who

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

none

Source

1{who, params} = args;
2if (params)
3who:tell(tostr("Usage: ", this:command_name(), " who"));
4return 0;
5elseif (!$code_utils:verb_or_property(this, "feature_ok", who))
6who:tell(tostr("You do not have access to see the user list for ", this:command_name(), "."));
7return 0;
8elseif ((!is_a(who, $immortal)) && (!who:cooldown_check(tostr("join ", this:command_name()), `this.cooldown ! E_PROPNF => 1800', 0, 1)))
9who:tell(tostr("You do not have access to see the user list for ", this:command_name(), "."));
10return 0;
11endif
12subscribers = this:subscribers();
13plist = {};
14for p in (connected_players())
15if (p in subscribers)
16if ((who.programmer || (!p.programmer)) || p.who_visible)
17plist = {@plist, p};
18endif
19endif
20endfor
21who:tell(tostr("  ", $ansi.bold_on, "- ", this:name(), " -", $ansi.bold_off));
22#318:_who(plist, {}, 0);
23return 1;

command_name

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1return this.name;

_announce_leave

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1{who} = args;
2if (this.announce_joins)
3name = this.use_real_name ? who:real_name() | who:name();
4if ($ou:has_property(this, "admins_masked") && this.admins_masked)
5this:_announce_admins(#-1, tostr(name, " has left ", this:command_name(), "."), 1);
6else
7this:_announce(#-1, tostr(name, " has left ", this:command_name(), "."), 1);
8endif
9endif

_announce_join

Spec this none thisFlags rxdOwner #361Definer #118

Referenced by

Source

1{who} = args;
2if (this.announce_joins)
3name = this.use_real_name ? who:real_name() | who:name();
4if ($ou:has_property(this, "admins_masked") && this.admins_masked)
5this:_announce_admins(#-1, tostr(name, " has joined ", this:command_name(), "."), 1);
6else
7this:_announce(#-1, tostr(name, " has joined ", this:command_name(), "."), 1);
8endif
9endif