blob: cacefb4ee2b3d1be27697b602bbf8272ae19fec1 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001CONCEPT:
2 news
3
4
5DESCRIPTION:
6 This document describes the news system used in Nightfall.
7 News is intended to provide a general system for bulletin
8 boards and similar objects. It is similar to the Usenet
9 news system. Articles are stored in a central area, /news.
10 Articles (Messages) are stored as files within this
11 directory. Only the news demon object is allowed to write
12 and read in the /news directory. Interfaceing to the
13 news demon is done via interface functions in the news
14 demon.
15
16 Typically news are read and written by a bulletin
17 board object or by a newsreader. Player buletin boards
18 should of course be limited to specific news groups.
19 A newsreader might be intelligent in that it autmatically
20 shows new messages. Groups may be moderated, then only the
21 moderator can write there. There are also flags whether a
22 board is a wiz_only board and who may remove messages.
23
24 Security is in several levels. It may be 0, then every
25 effective userid might read and write and delete articles,
26 although the news demon will still look for the match of
27 the sender field with certain group requirements. This level
28 of security is to make it possible to create groups
29 accessible by bulletin boards which have no euid.
30
31 Security level 1 means that euid check is done, for reading
32 and writing. This still allows for bulltin boards, but those
33 must have root euid and thus the ability to seteuid to the
34 euid of the object using the bulletin board (normally the
35 player). This feature requires native gamedriver mode.
36
37 Saved news file format (formal notation):
38
39 int security; /* wheter euid check is done, 0 or 1 */
40 mixed *accesslist = ({
41 mixed *readaccess; /* who can read messages */
42 mixed *writeaccess; /* who can write messages */
43 mixed *deleteaccess; /* who can delete messages */
44 mixed *controlaccess; /* who can control the accesslist */
45 })
46 mixed *messages = ({
47 mixed *msg1; mixed *msg2; ... mixed *msgN;
48 })
49
50 An access entry can be be one of the following:
51 - an effective userid (string)
52 - one of the keywords "wizard", "all", "author"
53 - a wizard level (integer) which is required minimal
54 - an array of one of the plain types above (Alternative).
55
56 A message looks as follows:
57
58 mixed *message = ({
59 string author; /* who wrote the message */
60 string subject; /* the subject */
61 string *groups; /* news groups where this was posted */
62 int date; /* date of message written */
63 string messageid; /* a unique string */
64 string *referenceid; /* list of references */
65 int expire; /* when message expires */
66 string body; /* the contents of the message */
67 })
68
69 The news demon (/secure/news, or /obj/news) provides the
70 following functions:
71
72 int success = PostMessage(mixed *message)
73 Tells the demon to insert the message in the news database.
74 Depending on security level, euid or message.author is
75 checked if this is allowed.
76
77 int success = DeleteMessage(string *groups, string messageid)
78 Remove a message from the database.
79
80 mixed *messagelist = ReadMessageHeaders(string group)
81 Get all message headers (complete info, but without
82 body) of newsgroup <group>.
83
84 mixed *message = ReadMessage(string *groups, string messageid)
85 Retrieve a message from the database.
86
87
88SEE ALSO: