News #61
Aliases: News
20 verbs · 26 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
description | this none this | rxd | #61 | 6 |
is_writable_by | this none this | rxd | #61 | 1 |
rm_message_seq | this none this | rxd | #61 | 8 |
undo_rmm | this none this | rxd | #61 | 7 |
expunge_rmm | this none this | rxd | #61 | 5 |
set_current_news | this none this | rxd | #61 | 17 |
add_current_news | this none this | rxd | #61 | 5 |
rm_current_news | this none this | rxd | #61 | 5 |
news_display_seq_full | this none this | rxd | #61 | 15 |
to_text | this none this | rxd | #61 | 9 |
check | this none this | rxd | #61 | 10 |
touch | this none none | rxd | #61 | 12 |
_parse | this none this | rxd | #61 | 13 |
init_for_core | this none this | rxd | #61 | 18 |
add_news | this none this | rxd | #61 | 15 |
rm_news | this none this | rxd | #61 | 15 |
@clearnews | this none none | rd | #61 | 7 |
@addnews | any at/to this | rxd | #61 | 17 |
@rmnews | any at/to this | rxd | #61 | 17 |
@setnews | this at/to any | rd | #61 | 19 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
current_news | #61 | rc | #36 | {} |
last_news_time | #61 | rc | #36 | 0 |
current_news_going | #61 | rc | #36 | {1, 2} |
archive_news | #61 | rc | #36 | {} |
moderator_notify | #45 | rc | #36 | <clear> |
last_msg_date | #45 | r | #36 | 0 |
messages_going | #45 | rc | #36 | list of 1{{0, {{1, {-1090650498, "Wizard (#2)", "*News (#61)", "Welcome to LambdaCore", "", "This RPG core was built upon the 1997 LambdaCore, with upgrades derived from the 2000 LambdaCore. Be sure to type \"help set-up\" after reading this. The following text is the original $wiz_utils.new_core_message from the 2000 LambdaCore:", "...", "Getting Started with your LambdaCore MOO", "========================================", "", "Thank you for choosing LambdaCore!", "", "Initial Setup Notes", "-------------------", "", "The \"welcome\" screen, seen when a player connects.", " -- this is stored in $login.welcome_message", "", "Do you want on-line character creation?", " -- this is stored in $login.create_enabled", " for more detailed information, edit $login:player_creation_enabled", "", "Do you want to limit the number of players on the MOO at once?", " -- look at $login.max_connections", " the `connection_limit' message on $login is the message printed", " when this limit is reached.", "", "Do you want a different default player class?", " -- set $player_class to a different value", " *do not* change $player", "", "You should also set the following:", " $network.postmaster", " -- your email address, or the email address of the person who will ", " handle your email", " $network.site", " -- the machine your MOO is running on (e.g. \"lambda.moo.mud.org\")", " $network.port", " -- the port your MOO is running on (e.g. 8888)", " $network.MOO_Name", " -- the name of your MOO (e.g. \"LambdaMOO\")", " $site_db.domain", " -- this is set to the `domain' of your address", " (eg `foo.com' for `moo.foo.com')", "", "If you compiled the server with open_network_connection() enabled (allowing the MOO to open up connections with other computers on the network), then you should set", " $network.active = 1", " This will enable @newpassword, @registerme, @password, @mailme, @netforward, and others to send mail from the MOO.", "", "-------------------------------------------------------------------", "", "Setting Yourself Up", "-------------------", "", "Set a password for yourself.", " -- @password <new-password>", "", "Set a description for yourself.", " -- @describe me as <anything>", "", "Set a gender for yourself.", " -- @gender <gender>", "", "There are, also, a large number of messages you can set on yourself. Setting them will enhance the virtual reality.", "", "-------------------------------------------------------------------", "", "About Guests", "------------", "", "To make a new Guest character:", " -- @make-guest <guestname>", " will make a new guest with the name you specify with `_Guest' appended", " and some other standard but useful aliases", "", "This is the easiest way to make Guest characters. The most important things to remember about Guests, if you want to make them yourself, are:", " -- make them owned by nonwizards, and not owned by themselves", " -- make sure they've got .password == 0, and that .password is nonclear", " -- at least one Guest must always be named `Guest'; this can be an alias", "", "To set the default description and gender for a guest:", " -- set .default_description to the description the guest should start with", " -- set .default_gender to the gender the guest should start with", " -- remember to set .description and .gender too, for the guest's first use", "", "-------------------------------------------------------------------", "", "Adding to the Newspaper", "-----------------------", "", "The newspaper is a special mailing list. To add a post to the newspaper, send mail to it (as *News or $news), and then note the number of your post (let's call it <x> and:", " -- @addnews <x> to *News", "... in general, `@addnews $ to *News' will work as well.", "", "-------------------------------------------------------------------", "", "Quota", "-----", "", "By default, LambdaCore runs with byte-based quota, an in-DB quota system, limiting users by total database space as opposed to total objects. You'll need to do two things:", " -- decide on the default quota:", " ;$byte_quota_utils.default_quota[1] = <a number of bytes>", " -- start the measurement task; see `help routine_tasks' for more information (Note: this help topic contains information about more than just the quota task; it should be read regardless of how quota is set).", "", "If you prefer the quota system documented in the LambdaMOO Programmer's Manual, directly supported by the server, you can enable object-based quota:", " -- set $quota_utils to $object_quota_utils", "", "It's best that you make this switch before users start, because converting existing users is an awkward (and inherently arbitrary and political) move.", "", "-------------------------------------------------------------------", "", "Making Programmers", "------------------", "", "The command to turn someone into a programmer is `@programmer' Its syntax is `@programmer <user>'. For example:", " -- @programmer Haakon", "The `@programmer' verb will prompt you if the user isn't set up with a description and a gender.", "", "No code to automatically grant programmer bits is included with LambdaCore.", "", "Making Wizards", "--------------", "", "THINK CAREFULLY.", "", "Be very careful before giving someone a wizard bit. That person can do gross damage to your database, and fixable but serious damage to the machine it runs on. That person can quite possibly open outbound network connections from your machine, and thus commit acts for which your host system will be blamed. That person can ruin your MOO's as-yet-untarnished reputation.", "", "Wizards have technical power, the ability to change anything within the database, to create anything within the database. Be careful with the idea of a `Social Wizard' -- a nontechnical person holding a wizard bit is fairly likely to, at some point, accidentally do something destructive. It's a good idea not to socialize as your wizard character, for the same reason, to make it less likely to be accidentally destructive.", "", "That said, in general you don't turn an existing character into a wizard, you make a -new- character to be the wizard. This is because the existing character probably owns code and objects which could be destructive if suddenly made wizardly; it's a good security measure to make a fresh player. So, to make a fresh player:", " -- @make-player (see `help @make-player' for more information)", " this will make you a new player. for this example, #123", "", "To make #123 a wizard:", " -- @programmer #123", " (a nonprogrammer wizard is a truly strange beast)", " -- ;#123.wizard = 1;", " -- @chparent #123 to $wiz", " -- ;#123.public_identity = <the player's nonwizard character's object number>", "", "-------------------------------------------------------------------", "", "Good luck with your new LambdaCore database!", "", "Visit us at LambdaMOO: lambda.moo.mud.org 8888", "", "Join the international mailing list for MOO coders: send an email message to moo-cows-request@the-b.org with the word `subscribe' as the body of your message.", "", "Do good things.", "", "The LambdaMOO Wizards", "[authored February 15, 1999]"}}}}} |
moderated | #45 | rc | #36 | 1 |
moderator_forward | #45 | rc | #36 | "%n (%#) can't send to moderated list %t (%[#t]) directly." |
writers | #45 | rc | #36 | {} |
readers | #45 | rc | #36 | 1 |
mail_notify | #45 | r | #36 | {} |
mail_forward | #45 | r | #36 | {} |
expire_period | #45 | r | #36 | 0 |
last_used_time | #45 | r | #36 | -1090650497 |
messages | #45 | rc | #36 | {} |
rmm_own_msgs | #45 | rc | #36 | <clear> |
guests_can_send_here | #45 | rc | #36 | <clear> |
messages_kept | #45 | r | #36 | {} |
registered_email | #45 | rc | #36 | <clear> |
email_validated | #45 | rc | #36 | <clear> |
validation_password | #45 | rc | #36 | <clear> |
key | #1 | c | #36 | 0 |
aliases | #1 | r | #36 | {"News"} |
description | #1 | rc | #36 | "It's the current issue of the News, dated %d." |
object_size | #1 | r | #36 | {24745, -1090650497} |
Ancestry
Ancestors (nearest first): #45 Generic Mail Recipient → #1 Root Class
Children: none
Call graph
Source
description
Referenced by
- #61:news_display_seq_full line 4:
this:description
Source
1raw = ctime(this.last_news_time); 2" 111111111122222"; 3"123456789012345678901234"; 4"Fri Nov 30 14:31:21 1990"; 5date = (raw[1..10] + ",") + raw[20..24]; 6return strsub(this.description, "%d", date);
is_writable_by
Referenced by
- #61:@clearnews line 2:
this:is_writable_by - #61:@addnews line 5:
this:is_writable_by - #61:@rmnews line 5:
this:is_writable_by - #61:@setnews line 2:
this:is_writable_by
Source
1return pass(@args) || (args[1] in $list_utils:map_prop($object_utils:descendants($wiz), "mail_identity"));
rm_message_seq
Referenced by
- #61:init_for_core line 3:
this:rm_message_seq
Source
1if (this:ok_write(caller, caller_perms())) 2seq = args[1]; 3this.current_news_going = $seq_utils:intersection(this.current_news, seq); 4this.current_news = $seq_utils:contract(this.current_news, seq); 5return $mail_agent:(verb)(@args); 6else 7return E_PERM; 8endif
undo_rmm
Referenced by
none
Source
1if (!this:ok_write(caller, caller_perms())) 2return E_PERM; 3endif 4seq = $mail_agent:(verb)(@args); 5this.current_news = $seq_utils:union(this.current_news_going, $seq_utils:expand(this.current_news, seq)); 6this.current_news_going = {}; 7return seq;
expunge_rmm
Referenced by
- #61:init_for_core line 4:
this:expunge_rmm
Source
1if (!this:ok_write(caller, caller_perms())) 2return E_PERM; 3endif 4this.current_news_going = {}; 5return $mail_agent:(verb)(@args);
set_current_news
Referenced by
- #61:add_current_news line 4:
this:set_current_news - #61:rm_current_news line 4:
this:set_current_news - #61:add_news line 14:
this:set_current_news - #61:rm_news line 14:
this:set_current_news - #61:@clearnews line 3:
this:set_current_news - #61:@setnews line 11:
this:set_current_news
Source
1if (!this:ok_write(caller, caller_perms())) 2return E_PERM; 3else 4this.current_news = new = args[1]; 5if (new) 6newlast = $seq_utils:last(new); 7newlasttime = this:messages_in_seq(newlast)[2][1]; 8if (newlasttime > this.last_news_time) 9"... only notify people if there exists a genuinely new item..."; 10this.last_news_time = newlasttime; 11this:touch(); 12endif 13else 14"...flush everything..."; 15this.last_news_time = 0; 16endif 17endif
add_current_news
Referenced by
none
Source
1if (!this:ok_write(caller, caller_perms())) 2return E_PERM; 3else 4return this:set_current_news($seq_utils:union(this.current_news, args[1])); 5endif
rm_current_news
Referenced by
none
Source
1if (!this:ok_write(caller, caller_perms())) 2return E_PERM; 3else 4return this:set_current_news($seq_utils:intersection(this.current_news, $seq_utils:complement(args[1]))); 5endif
news_display_seq_full
Referenced by
- #6:news line 45:
$news:news_display_seq_full
Source
1":news_display_seq_full(msg_seq) => {cur, last-read-date}"; 2"Display the given msg_seq as a collection of news items"; 3set_task_perms(caller_perms()); 4desc = this:description(); 5player:notify((typeof(desc) == LIST) ? desc[1] | desc); 6player:notify(""); 7msgs = this:messages_in_seq(args[1]); 8for i in [-(n = length(msgs))..-1] 9x = msgs[-i]; 10player:notify_lines(this:to_text(@x[2])); 11player:notify(""); 12(ticks_left() < 4000) && suspend(0); 13endfor 14player:notify("(end)"); 15return {msgs[n][1], msgs[n][2][1]};
to_text
Referenced by
- #61:news_display_seq_full line 10:
this:to_text
Source
1":to_text(@msg) => message in text form -- formatted like a $news entry circa October, 1993"; 2date = args[1]; 3by = args[2]; 4"by = by[1..index(by, \"(\") - 2]"; 5subject = (args[4] == " ") ? "-*-NEWS FLASH-*-" | $string_utils:uppercase(args[4]); 6text = args[("" in {@args, ""}) + 1..$]; 7ctime = $time_utils:time_sub("$D, $N $3, $Y", date); 8return {ctime, subject, @text}; 9return {subject, tostr(" by ", by, " on ", ctime), "", @text};
check
Referenced by
- #6:confunc line 5:
$news:check
Source
1set_task_perms(caller_perms()); 2if ((player:get_current_message(this) || {0, 0})[2] < this.last_news_time) 3if ((n = player:mail_option("news")) in {0, "all"}) 4player:tell("There is new news. Type `news' to read all news or `news new' to read just new news."); 5elseif (n == "contents") 6player:tell("There is new news. Type `news all' to read all news or `news new' to read just new news."); 7elseif (n == "new") 8player:tell("There is new news. Type `news' to read new news, or `news all' to read all news."); 9endif 10endif
touch
Referenced by
- #61:set_current_news line 11:
this:touch
Source
1if (!this:ok_write(caller, valid(who = caller_perms()) ? who | player)) 2player:notify("Permission denied."); 3return; 4endif 5fork (0) 6for p in (connected_players()) 7(ticks_left() < 4000) && suspend(0); 8if ((p:get_current_message(this) || {0, 0})[2] < this.last_news_time) 9p:notify("There's a new edition of the newspaper. Type 'news new' to see the new article(s)."); 10endif 11endfor 12endfork
_parse
Referenced by
- #6:news line 27:
$news:_parse - #61:add_news line 5:
this:_parse - #61:rm_news line 5:
this:_parse - #61:@setnews line 4:
this:_parse
Source
1if (!(strings = args[1])) 2return "You need to specify a message sequence"; 3elseif (typeof(pms = this:parse_message_seq(@args)) == STR) 4return $string_utils:substitute(pms, {{"%f", "The news"}, {"%<has>", "has"}, {"%%", "%"}}); 5elseif (typeof(pms) != LIST) 6return tostr(pms); 7elseif (length(pms) > 1) 8return tostr("I don't understand `", pms[2], "'."); 9elseif (!(seq = pms[1])) 10return tostr("The News (", this, ") has no `", $string_utils:from_list(pms[2][1..used], " "), "' messages."); 11else 12return seq; 13endif
init_for_core
Referenced by
none
Source
1if (caller_perms().wizard) 2pass(); 3this:rm_message_seq($seq_utils:range(1, this:length_all_msgs())); 4this:expunge_rmm(); 5this.description = "It's the current issue of the News, dated %d."; 6this.mail_forward = {}; 7for p in ({"moderator_forward", "writers", "last_used_time", "mail_notify"}) 8this.(p) = $mail_recipient.(p); 9endfor 10this.moderated = 1; 11this.last_news_time = 0; 12this.readers = 1; 13this.archive_news = {}; 14$mail_agent:send_message(#2, this, "Welcome to LambdaCore", $wiz_utils.new_core_message); 15this:add_news("1"); 16else 17return E_PERM; 18endif
add_news
Referenced by
- #61:init_for_core line 15:
this:add_news - #61:@addnews line 7:
this:add_news
Source
1if (!this:ok_write(caller, caller_perms())) 2$error:raise(E_PERM); 3endif 4{specs, ?cur = {0, 0}} = args; 5seq = this:_parse(specs, @cur); 6if (typeof(seq) == STR) 7return seq; 8endif 9old = this.current_news; 10new = $seq_utils:union(old, seq); 11if (old == new) 12return "Those messages are already in the news."; 13endif 14this:set_current_news(new); 15return 1;
rm_news
Referenced by
- #61:@rmnews line 7:
this:rm_news
Source
1if (!this:ok_write(caller, caller_perms())) 2raise(E_PERM); 3endif 4{specs, ?cur = {0, 0}} = args; 5seq = this:_parse(specs, @cur); 6if (typeof(seq) == STR) 7return seq; 8endif 9old = this.current_news; 10new = $seq_utils:intersection(old, $seq_utils:complement(seq)); 11if (old == new) 12return "Those messages were not in the news."; 13endif 14this:set_current_news(new); 15return 1;
@clearnews
Referenced by
none
Source
1set_task_perms(player); 2if (this:is_writable_by(player)) 3this:set_current_news({}); 4player:notify("Current newspaper is now empty."); 5else 6player:notify("You can't write the news."); 7endif
@addnews
Referenced by
none
Source
1if ((caller_perms() != #-1) && (caller_perms() != player)) 2raise(E_PERM); 3endif 4set_task_perms(player); 5if (!this:is_writable_by(player)) 6player:notify("You can't write the news."); 7elseif (typeof(result = this:add_news(args[1..(prepstr in args) - 1], player:get_current_message(this) || {0, 0})) == STR) 8player:notify(result); 9else 10new = this.current_news; 11if (new) 12player:notify("Current newspaper set."); 13this:display_seq_headers(new); 14else 15player:notify("Current newspaper is now empty."); 16endif 17endif
@rmnews
Referenced by
none
Source
1if ((caller_perms() != #-1) && (caller_perms() != player)) 2raise(E_PERM); 3endif 4set_task_perms(player); 5if (!this:is_writable_by(player)) 6player:notify("You can't write the news."); 7elseif (typeof(result = this:rm_news(args[1..(prepstr in args) - 1], player:get_current_message(this) || {0, 0})) == STR) 8player:notify(result); 9else 10new = this.current_news; 11if (new) 12player:notify("Current newspaper set."); 13this:display_seq_headers(new); 14else 15player:notify("Current newspaper is now empty."); 16endif 17endif
@setnews
Referenced by
none
Source
1set_task_perms(player); 2if (!this:is_writable_by(player)) 3player:notify("You can't write the news."); 4elseif (typeof(seq = this:_parse(strings = args[(prepstr in args) + 1..$], @player:get_current_message(this) || {0, 0})) == STR) 5player:notify(seq); 6else 7old = this.current_news; 8if (old == seq) 9player:notify("No change."); 10else 11this:set_current_news(seq); 12if (seq) 13player:notify("Current newspaper set."); 14this:display_seq_headers(seq); 15else 16player:notify("Current newspaper is now empty."); 17endif 18endif 19endif