Update doc/efun/ aus Driversourcen.
Manpages der efuns aktualisiert, neue Manpages hinzugefuegt.
Change-Id: I7cc91684269ff56d1aef47d5c5e7c87f7fd531dc
diff --git a/doc/efun/say b/doc/efun/say
index cbb7819..ed4b3ec 100644
--- a/doc/efun/say
+++ b/doc/efun/say
@@ -7,92 +7,78 @@
void say(mixed *|mapping|struct|object|lwobject msg, object exclude)
void say(mixed *|mapping|struct|object|lwobject msg, object *excludes)
-BESCHREIBUNG
- Es bestehen zwei Hauptanwendungen fuer say():
+DESCRIPTION
+ There are two major modes of calling:
- Wenn das erste Argument ein String <str> ist, wird er an alle
- lebendigen Objekte im aktuellen Raum gesendet, ausser zum Objekt,
- das die Funktion aufgerufen hat.
+ If the first argument is a string <str>, it will be send to
+ all livings in the current room except to the initiator.
- Wenn das erste Argument ein nicht-String <msg> ist, wird die Lfun
- catch_msg() in allen lebendigen Objekt im Raum aufgerufen, ausser im
- Objekt, das say() aufgerufen hat. Der Wert <msg> wird als erstes
- Argument an catch_msg() uebergeben, das aufrufende Objekt als zweites
- Argument.
+ If the first argument is an array/mapping/struct/object <msg>, the
+ lfun catch_msg() of all living objects except the initiator will be
+ called.
+ This <msg> will be given as first argument to the lfun, and
+ the initiating object as the second.
+ CAVEAT: If the lfun catch_msg() modifies the content of <msg>, all
+ subsequent objects will receive the modified <msg>.
- MERKE: Wenn die Lfun catch_msg() den Wert <msg> veraendert, erhalten
- alle nachfolgenden Objekte das veraenderte <msg>.
+ By specifying a second argument to the efun one can exclude
+ more objects than just the initiator. If the second argument
+ is a single object <exclude>, both the given object and the
+ initiator are excluded from the call. If the second argument
+ is an array <excludes>, all objects and just the objects in
+ this array are excluded from the call.
- Wird der Efun say() ein zweites Argument angegeben, kann man andere
- Objekte als nur das aufrufende Objekt ausschliessen. Wenn das zweite
- Argument ein einzelnes Objekt <exclude> ist, werden das aufrufende
- Objekt und <exclude> von der Meldung ausgeschlossen. Wenn das zweite
- Argument ein Array <excludes> ist, werden alle Objekte aus dieser
- Liste zusaetzlich zum aufrufenden Objekt als Empfaenger von say()
- ausgeschlossen.
+ The 'initiator' is determined according to these rules:
+ - if the say() is called from within a living object, this
+ becomes the initiator
+ - if the say() is called from within a dead object as result
+ of a user action (i.e. this_player() is valid), this_player()
+ becomes the initiator.
+ - Else the object calling the say() becomes the initiator.
- Das aufrufende Objekt wird nach folgenden Regeln bestimmt:
- - Wenn say() aus einem lebendigen Objekt aufgerufen wird, gilt
- dieses als das aufrufende Objekt.
- - Wenn say() aus einem nicht-lebendigen Objekt als Resultat einer
- Handlung eines Benutzers aufgerufen wird (das heisst,
- this_player() ist gueltig), gilt this_player() als aufrufendes
- Objekt.
- - In allen anderen Faellen gilt das Objekt, das say() aufgerufen
- hat, als aufrufendes Objekt.
-
-BEISPIELE
- Folgende Aufrufe sind gleich, wenn sie aus einem nicht lebendigen
- Objekt aufgerufen werden:
-
- say("Hi!\n");
- say("Hi!\n", this_player());
-
- Das folgende Beispiel zeigt, wie say() zusammen mit catch_tell()
- funktioniert. Das zweite Objekt darf nicht lebendig sein, sodass
- write() an den aktuellen Benutzer geht.
-
- Objekt 1 (living):
- void catch_tell(string str)
- {
- write("Empfangen: "+str+"\n");
- }
-
- Objekt 2 (nicht living):
- void func()
- {
- ...
- say("HiHo!\n");
- ...
- }
-
- Ein etwas komplexeres Beispiel zeigt das Zusammenspiel von say()
- und catch_msg(). Auch hier wird ein nicht-lebendiges Objekt
- verwendet, das die Nachricht ausgibt, sodass das 'wer' in
- catch_msg() auf den aktuellen Benutzer zeigt.
+EXAMPLES
+ say("Hi!\n");
+ say("Hi!\n", this_player());
+ Both calls are equal when called by a not living object.
Object 1 (living):
- void catch_msg(mixed *arr, object who) {
- int i;
- if (!arr) return;
- for (i=0;i<sizeof(arr);i++)
- tell_object(who, (stringp(arr[i]) ? arr[i] : "-/-")+"\n");
- }
+ void catch_tell(string str) {
+ write("Received: "+str+"\n");
+ }
+ Object 2 (not living):
+ void func() {
+ ...
+ say("HiHo!\n");
+ ...
+ }
- Object 2 (nicht living):
- void func() {
- ...
- say(({ "Hello", "there!" }));
- ...
- }
+ This examples shows how say() together with catch_tell()
+ works. The 2nd object must not be living so the write() will
+ go to the current user.
-ANMERKUNGEN
- Wenn die Lfun catch_msg() den Wert <msg> veraendert, erhalten alle
- nachfolgenden Objekte das veraenderte <msg>.
-GESCHICHTE
- LDMud 3.3.686 erlaubt die Verwendung eines mapping/struct/object als
- zweites Argument.
+ Object 1 (living):
+ void catch_msg(mixed *arr, object who) {
+ int i;
+ if(!arr) return;
+ for(i=0; i<sizeof(arr); i++)
+ tell_object(who, (stringp(arr[i]) ? arr[i] : "-/-")+"\n");
+ }
+ Object 2 (not living):
+ void func() {
+ ...
+ say( ({ "Hello", "there!" }) );
+ ...
+ }
-SIEHE AUCH
+ This is a bit complex example to demonstrate how say() and
+ catch_msg() works. Here we also use a non living object to
+ send the message so the who in catch_msg() will be the current
+ user.
+
+HISTORY
+ LDMud 3.3.686 added the use of a mapping/struct/object as second
+ argument.
+
+SEE ALSO
write(E), tell_object(E), tell_room(E)