News #61

Parent #45Owner #36Flags readSource RPG Core/rpgcore-patched.db

Aliases: News

20 verbs · 27 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
descriptionthis none thisrxd#616
is_writable_bythis none thisrxd#611
rm_message_seqthis none thisrxd#618
undo_rmmthis none thisrxd#617
expunge_rmmthis none thisrxd#615
set_current_newsthis none thisrxd#6117
add_current_newsthis none thisrxd#615
rm_current_newsthis none thisrxd#615
news_display_seq_fullthis none thisrxd#6115
to_textthis none thisrxd#619
checkthis none thisrxd#6110
touchthis none nonerxd#6112
_parsethis none thisrxd#6113
init_for_corethis none thisrxd#6118
add_newsthis none thisrxd#6115
rm_newsthis none thisrxd#6115
@clearnewsthis none nonerd#617
@addnewsany at/to thisrxd#6117
@rmnewsany at/to thisrxd#6117
@setnewsthis at/to anyrd#6119

Properties

PropertyDefinerFlagsOwnerValue
current_news#61rc#36{1, 2}
last_news_time#61rc#360
current_news_going#61rc#36{}
archive_news#61rc#36{}
moderator_notify#45rc#36<clear>
last_msg_date#45r#36-1090650498
messages_going#45rc#36{}
moderated#45rc#361
moderator_forward#45rc#36"%n (%#) can't send to moderated list %t (%[#t]) directly."
writers#45rc#36{}
readers#45rc#361
mail_notify#45r#36{}
mail_forward#45r#36{}
expire_period#45r#360
last_used_time#45r#36-1090650497
messages#45rc#36
list of 1{{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]"}}}
rmm_own_msgs#45rc#36<clear>
guests_can_send_here#45rc#36<clear>
messages_kept#45r#36{}
registered_email#45rc#36<clear>
email_validated#45rc#36<clear>
validation_password#45rc#36<clear>
key#1c#360
aliases#1r#36{"News"}
description#1rc#36"It's the current issue of the News, dated %d."
object_size#1r#36{24745, -1090650497}
html#1rc#36<clear>

Ancestry

Ancestors (nearest first): #45 Generic Mail Recipient#1 Root Class

Children: none

Call graph

calls n61_1 #61:is_writable_by n52_22 #52:descendants n61_1->n52_22 n45_2 #45:is_writable_by n61_1->n45_2 n61_2 #61:rm_message_seq n45_14 #45:ok_write n61_2->n45_14 n33_20 #33:intersection n61_2->n33_20 n33_18 #33:contract n61_2->n33_18 n61_3 #61:undo_rmm n61_3->n45_14 n33_3 #33:union n61_3->n33_3 n33_17 #33:expand n61_3->n33_17 n61_4 #61:expunge_rmm n61_4->n45_14 n61_5 #61:set_current_news n61_5->n45_14 n33_11 #33:last n61_5->n33_11 n45_15 #45:parse_message_seq n61_5->n45_15 n61_11 #61:touch n61_5->n61_11 n61_11->n45_14 n6_10 #6:notify n61_11->n6_10 n61_6 #61:add_current_news n61_6->n45_14 n61_6->n33_3 n61_6->n61_5 n61_7 #61:rm_current_news n61_7->n45_14 n61_7->n33_20 n61_7->n61_5 n33_2 #33:complement n61_7->n33_2 n61_8 #61:news_display_seq_full n61_8->n45_15 n61_0 #61:description n61_8->n61_0 n61_8->n6_10 n6_11 #6:notify_lines n61_8->n6_11 n61_9 #61:to_text n61_8->n61_9 n20_14 #20:uppercase n61_9->n20_14 n43_11 #43:time_sub n61_9->n43_11 n61_10 #61:check n6_18 #6:tell n61_10->n6_18 n61_12 #61:_parse n61_12->n45_15 n20_5 #20:from_list n61_12->n20_5 n61_13 #61:init_for_core n61_13->n61_2 n61_13->n61_4 n61_13->n45_15 n45_27 #45:init_for_core n61_13->n45_27 n33_16 #33:range n61_13->n33_16 n46_2 #46:send_message n61_13->n46_2 n61_14 #61:add_news n61_13->n61_14 n61_14->n45_14 n61_14->n33_3 n61_14->n61_5 n61_14->n61_12 n69_0 #69:raise n61_14->n69_0 n61_15 #61:rm_news n61_15->n45_14 n61_15->n33_20 n61_15->n61_5 n61_15->n33_2 n61_15->n61_12 n61_16 #61:@clearnews n61_16->n61_1 n61_16->n61_5 n61_16->n6_10 n61_17 #61:@addnews n61_17->n61_1 n61_17->n45_15 n61_17->n6_10 n61_17->n61_14 n61_18 #61:@rmnews n61_18->n61_1 n61_18->n45_15 n61_18->n6_10 n61_18->n61_15 n61_19 #61:@setnews n61_19->n61_1 n61_19->n61_5 n61_19->n45_15 n61_19->n6_10 n61_19->n61_12

Source

description

Spec this none thisFlags rxdOwner #36Definer #61

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #61

Referenced by

Source

1return pass(@args) || (args[1] in $list_utils:map_prop($object_utils:descendants($wiz), "mail_identity"));

rm_message_seq

Spec this none thisFlags rxdOwner #36Definer #61

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #61

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

Spec this none thisFlags rxdOwner #36Definer #61

Referenced by

Source

1if (!this:ok_write(caller, caller_perms()))
2return E_PERM;
3endif
4this.current_news_going = {};
5return $mail_agent:(verb)(@args);

set_current_news

Spec this none thisFlags rxdOwner #36Definer #61

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #61

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

Spec this none thisFlags rxdOwner #36Definer #61

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

Spec this none thisFlags rxdOwner #2Definer #61

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #61

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #61

Referenced by

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

Spec this none noneFlags rxdOwner #2Definer #61

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #61

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #61

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

Spec this none thisFlags rxdOwner #2Definer #61

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #61

Referenced by

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

Spec this none noneFlags rdOwner #36Definer #61

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

Spec any at/to thisFlags rxdOwner #2Definer #61

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

Spec any at/to thisFlags rxdOwner #2Definer #61

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

Spec this at/to anyFlags rdOwner #2Definer #61

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