Generic Broadcast Object #118
Aliases: Generic Broadcast Object
30 verbs · 49 properties · 4 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
announce announce_players announce_admins | this none this | rxd | #118 | 3 |
identifier | this none this | rxd | #118 | 1 |
subscribers | this none this | rxd | #118 | 1 |
feature_add | this none this | rxd | #118 | 4 |
feature_remove | this none this | rxd | #118 | 2 |
_who | this none this | rxd | #118 | 1 |
_history | this none this | rxd | #118 | 1 |
_render | this none this | rxd | #118 | 50 |
color | this none this | rxd | #118 | 1 |
_who_verb | this none this | rxd | #118 | 1 |
speech_color | this none this | rxd | #118 | 7 |
should_scramble | this none this | rxd | #118 | 1 |
name_color | this none this | rxd | #118 | 14 |
_old_render | this none this | rxd | #118 | 42 |
recycle | this none this | rxd | #118 | 7 |
_render_BACKUP_OLD | this none this | rxd | #118 | 39 |
post_identifier | this none this | rxd | #118 | 1 |
tree_tag | this none this | rxd | #118 | 6 |
_clawscramble | this none this | rxd | #118 | 13 |
dino_sub | this none this | rxd | #118 | 12 |
_announce _announce_admins _announce_players | this none this | rxd | #118 | 42 |
sys_announce | this none this | rxd | #118 | 1 |
_announce_rendered | this none this | rxd | #118 | 15 |
command_on | this none this | rxd | #118 | 20 |
command_off | this none this | rxd | #118 | 15 |
command_history | this none this | rxd | #118 | 33 |
command_who | this none this | rxd | #118 | 23 |
command_name | this none this | rxd | #118 | 1 |
_announce_leave | this none this | rxd | #118 | 9 |
_announce_join | this none this | rxd | #118 | 9 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
subscribers | #118 | rc | #361 | {} |
identifier | #118 | rc | #361 | "[generic broadcast object]" |
color | #118 | rc | #361 | "~1b[35m" |
use_real_name | #118 | rc | #361 | 1 |
verbatim_color | #118 | rc | #361 | "~1b[36m" |
history | #118 | c | #361 | {} |
speech_color | #118 | rc | #361 | "" |
scrambling | #118 | rc | #361 | {} |
prog_color | #118 | rc | #361 | "" |
wiz_color | #118 | rc | #361 | "" |
builder_color | #118 | rc | #361 | "" |
announce_joins | #118 | rc | #361 | 1 |
history_size | #118 | rc | #361 | 50 |
commands | #118 | rc | #361 | {"on", "off", "who", "history"} |
no_admin_talk | #118 | rc | #361 | 0 |
warehouse | #68 | r | #29 | <clear> |
help_msg | #68 | rc | #361 | <clear> |
feature_verbs | #68 | r | #29 | <clear> |
feature_ok | #68 | r | #29 | <clear> |
handed | #5 | rc | #361 | <clear> |
wield_msg | #5 | rc | #361 | <clear> |
unwield_msg | #5 | rc | #361 | <clear> |
size | #5 | rc | #361 | <clear> |
look_place_msg | #5 | rc | #361 | <clear> |
value | #5 | rc | #361 | <clear> |
get_msg | #5 | rc | #361 | <clear> |
drop_msg | #5 | rc | #361 | <clear> |
get_fail_msg | #5 | rc | #361 | <clear> |
junk_ok | #5 | rc | #361 | <clear> |
floats | #5 | rc | #361 | <clear> |
long_name_msg | #5 | rc | #361 | <clear> |
article | #5 | rc | #361 | <clear> |
setup_list | #5 | rc | #361 | <clear> |
health | #5 | rc | #361 | <clear> |
health_max | #5 | rc | #361 | <clear> |
min_skill | #5 | rc | #361 | <clear> |
skill | #5 | rc | #361 | <clear> |
recipe_for | #5 | rc | #361 | <clear> |
carried_msg | #5 | rc | #361 | <clear> |
aliases | #1 | rc | #361 | {"Generic Broadcast Object"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {20791, 1298433815} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #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
Source
announce announce_players announce_admins
Referenced by
- #0:checkpoint_started line 2:
$sysnet:announce - #6:disfunc line 13:
$sysnet:announce - #96:@initialize line 20:
$wiznet:announce - #99:wiz line 1:
this:announce - #237:chat line 2:
this:announce - #330:announce line 1:
pass( - #356:announce_change line 12:
this:announce - #357:announce_change line 12:
this:announce - #357:announce_remove line 12:
this:announce - #357:announce_add line 12:
this:announce - #360:prog line 2:
this:announce
Source
1{who, msg, ?verbatim = 0, ?subfilter = 0} = args; 2announce_verb = tostr("_", verb); 3this:(announce_verb)(@args);
identifier
Referenced by
- #118:_render line 11:
this:identifier - #118:_old_render line 8:
this:identifier - #118:_render_BACKUP_OLD line 7:
this:identifier - #118:tree_tag line 2:
this:identifier - #118:_announce line 18:
this:identifier
Source
1return this.identifier;
subscribers
Referenced by
- #118:_announce_rendered line 6:
this:subscribers - #118:command_who line 12:
this:subscribers
Source
1return this.subscribers;
feature_add
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
Referenced by
none
Source
1who = args[1]; 2this.subscribers = setremove(this.subscribers, who);
_who
Referenced by
none
Source
1raise(E_NACC, "something called $net:_who()");
_history
Referenced by
none
Source
1raise(E_NACC, "something called $net:_history()");
_render
Referenced by
- #118:_announce line 19:
this:_render
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
Referenced by
- #118:_render line 11:
this:color - #118:_old_render line 8:
this:color - #118:_render_BACKUP_OLD line 7:
this:color
Source
1return this.color;
_who_verb
Referenced by
none
Source
1args[1]:who(args[2]);
speech_color
Referenced by
- #118:_render line 25:
this:speech_color - #118:_render line 46:
this:speech_color - #118:_old_render line 12:
this:speech_color - #118:_render_BACKUP_OLD line 11:
this:speech_color
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
Referenced by
none
Source
1return 0;
name_color
Referenced by
- #118:_render line 19:
this:name_color - #118:_render line 22:
this:name_color - #118:_render_BACKUP_OLD line 13:
this:name_color
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
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
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
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
Referenced by
- #118:_render line 12:
this:post_identifier
Source
1return "";
tree_tag
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
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
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
Referenced by
- #118:sys_announce line 1:
this:_announce - #118:_announce_leave line 5:
this:_announce_admins - #118:_announce_leave line 7:
this:_announce - #118:_announce_join line 5:
this:_announce_admins - #118:_announce_join line 7:
this:_announce
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
Referenced by
none
Source
1return this:_announce(caller, tostr(@args), 1);
_announce_rendered
Referenced by
- #118:_announce line 35:
this:_announce_rendered - #118:_announce line 37:
this:_announce_rendered - #118:_announce line 39:
this:_announce_rendered - #118:_announce line 41:
this:_announce_rendered
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
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
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
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
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
Referenced by
- #118:command_on line 3:
this:command_name - #118:command_on line 6:
this:command_name - #118:command_on line 9:
this:command_name - #118:command_on line 11:
this:command_name - #118:command_on line 16:
this:command_name - #118:command_off line 3:
this:command_name - #118:command_off line 6:
this:command_name - #118:command_off line 10:
this:command_name - #118:command_history line 3:
this:command_name - #118:command_history line 6:
this:command_name - #118:command_history line 8:
this:command_name - #118:command_history line 9:
this:command_name - #118:command_who line 3:
this:command_name - #118:command_who line 6:
this:command_name - #118:command_who line 8:
this:command_name - #118:command_who line 9:
this:command_name - #118:_announce_leave line 5:
this:command_name - #118:_announce_leave line 7:
this:command_name - #118:_announce_join line 5:
this:command_name - #118:_announce_join line 7:
this:command_name
Source
1return this.name;
_announce_leave
Referenced by
- #118:command_off line 12:
this:_announce_leave
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
Referenced by
- #118:command_on line 18:
this:_announce_join
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