#include <config.h>#include <properties.h>#include <transport.h>#include <wizlevels.h>#include <daemon.h>
gehe zum Quellcode dieser Datei
Makrodefinitionen | |
| #define | NEED_PROTOTYPES |
Funktionen | |
| void | create () |
| public void | AddHarbour (string ship, string harbour) |
| void | reset () |
| int | remove () |
| public void | RemoveShip (object ship) |
| public varargs mixed | HasShip (object harbour, string ship) |
| public mixed | RouteExists (object ship, string dest) |
| public mapping | QueryShips () |
| public mapping | QueryAllHarbours () |
Variablen | |
| mapping | ships |
| mapping | harbours |
| public void AddHarbour | ( | string | ship, | |
| string | harbour | |||
| ) |
Definiert in Zeile 35 der Datei traveld.c.
Benutzt harbours, IS_ARCH, member_array(), P_NO_TRAVELING, QueryProp(), save_object(), ships und TRAVELD_SAVEFILE.
00036 { 00037 if (!stringp(ship)) return; 00038 if (!stringp(harbour)) return; 00039 00040 if ((ship[0..2] == "/p/" || ship[0..8] == "/players/") && 00041 !IS_ARCH(getuid(previous_object()))) 00042 { 00043 return; 00044 } 00045 00046 call_other(harbour,"???"); 00047 00048 if (find_object(ship) && find_object(ship)->QueryProp(P_NO_TRAVELING) == 0) 00049 { 00050 if (!sizeof(ships)) 00051 { 00052 ships = ([ ship : ({ harbour }) ]); 00053 } 00054 else if (member(ships,ship) <= 0) 00055 { 00056 ships += ([ ship : ({ harbour }) ]); 00057 } 00058 else if (member_array(harbour,ships[ship]) == -1) 00059 { 00060 ships[ship] += ({ harbour }); 00061 } 00062 } 00063 00064 if (find_object(harbour) && 00065 find_object(harbour)->QueryProp(P_NO_TRAVELING) == 0) 00066 { 00067 if (find_object(ship) && find_object(ship)->QueryProp(P_NO_TRAVELING) > 0) 00068 { 00069 return; 00070 } 00071 else if (!sizeof(harbours)) 00072 { 00073 harbours = ([ harbour : ({ ship }) ]); 00074 } 00075 else if (member(harbours,harbour) <= 0) 00076 { 00077 harbours += ([ harbour : ({ ship }) ]); 00078 } 00079 else if (member_array(ship,harbours[harbour]) == -1) 00080 { 00081 harbours[harbour] += ({ ship }); 00082 } 00083 } 00084 save_object((TRAVELD_SAVEFILE)); 00085 }

| void create | ( | ) |
Definiert in Zeile 23 der Datei traveld.c.
Benutzt harbours, restore_object(), ships und TRAVELD_SAVEFILE.
00024 { 00025 seteuid(getuid(this_object())); 00026 00027 if (!restore_object((TRAVELD_SAVEFILE))) 00028 { 00029 ships = ([]); 00030 harbours = ([]); 00031 return; 00032 } 00033 }

| public varargs mixed HasShip | ( | object | harbour, | |
| string | ship | |||
| ) |
Definiert in Zeile 113 der Datei traveld.c.
00114 { 00115 mixed obs; 00116 00117 if (!objectp(harbour)) return 0; 00118 if (!obs=harbours[object_name(harbour)]) return 0; 00119 00120 obs = map(obs,#'find_object) - ({0}); 00121 00122 if (stringp(ship)) 00123 { 00124 obs = filter_objects(obs,"id",ship); 00125 } 00126 return sizeof(obs)?obs:0; 00127 }
| public mapping QueryAllHarbours | ( | ) |
| public mapping QueryShips | ( | ) |
| int remove | ( | ) |
Definiert in Zeile 94 der Datei traveld.c.
Benutzt destruct(), save_object() und TRAVELD_SAVEFILE.
00095 { 00096 save_object((TRAVELD_SAVEFILE)); 00097 destruct(this_object()); 00098 return 1; 00099 }

| public void RemoveShip | ( | object | ship | ) |
Definiert in Zeile 101 der Datei traveld.c.
Benutzt IS_ARCH, save_object(), ships und TRAVELD_SAVEFILE.
00102 { 00103 if (extern_call() && !IS_ARCH(getuid(previous_object()))) return; 00104 00105 if(member(ships,object_name(ship)) >= 1) 00106 { 00107 ships -= ([ object_name(ship) ]); 00108 } 00109 00110 save_object((TRAVELD_SAVEFILE)); 00111 }

| void reset | ( | void | ) |
Definiert in Zeile 87 der Datei traveld.c.
Benutzt save_object() und TRAVELD_SAVEFILE.
00088 { 00089 if (extern_call() && previous_object()) return; 00090 00091 save_object((TRAVELD_SAVEFILE)); 00092 }

| public mixed RouteExists | ( | object | ship, | |
| string | dest | |||
| ) |
| mapping harbours |
| mapping ships |
Definiert in Zeile 20 der Datei traveld.c.
Wird benutzt von AddHarbour(), create() und RemoveShip().
1.6.3