#include <properties.h>#include <wizlevels.h>#include <defines.h>#include <moving.h>
gehe zum Quellcode dieser Datei
Makrodefinitionen | |
| #define | SAVEFILE "/players/"+geteuid()+"/.logtool" |
| #define | allowed() (!process_call() && PL==RPL && geteuid()==getuid(RPL)) |
Funktionen | |
| static void | check_logs () |
| void | create () |
| void | reset () |
| varargs int | move (mixed dest, int method) |
| varargs string | long () |
| static int | aktualisieren (string str) |
| static int | read_log (string str) |
| static int | add_log () |
| static int | del_log (string str) |
Variablen | |
| inherit std | secure_thing |
| mapping | logs |
| #define allowed | ( | ) | (!process_call() && PL==RPL && geteuid()==getuid(RPL)) |
Definiert in Zeile 13 der Datei logtool.c.
Wird benutzt von AddEPObject(), AddFP(), AddMiniQuest(), AddQuest(), addTip(), ChangeEPObject(), ChangeMiniQuest(), check_all_player(), ClearFP(), ClearPlayerMiniQuest(), ClearPub(), ClearScoreBit(), ClearUsersMQCache(), Dump(), DumpMiniQuests(), DumpPubs(), ektipAllowed(), GetGroup(), GetNotes(), make(), QueryEPObject(), QueryExplorationPoints(), QueryMiniQuestByName(), QueryMiniQuestByNumber(), QueryMiniQuestPoints(), QueryMiniQuests(), QueryTipObjects(), QueryUsersMQCache(), ReadNewQuest(), RecalculateQP(), RegisterEvent(), RemoveEPObject(), RemoveFP(), RemoveMiniQuest(), RemoveNote(), RemoveQuest(), removeTip(), ResetDamagers(), Set(), SetActive(), SetFP(), SetMaxHeal(), SetMaxRate(), SetMiniActive(), SetPlayerMiniQuest(), SetProperties(), SetPubFactor(), SetScoreBit(), ShowEPObjects(), ShowPlayerEPs(), UnmarkEKForLiquidation(), Unregister() und WriteNote().
| #define SAVEFILE "/players/"+geteuid()+"/.logtool" |
Definiert in Zeile 10 der Datei logtool.c.
Wird benutzt von create(), DeleteUser(), MBanishDelete(), MBanishInsert(), modify_threshold(), remove(), reset(), save_data(), save_me() und SetUser().
| static int add_log | ( | ) | [static] |
Definiert in Zeile 120 der Datei logtool.c.
00121 { 00122 string key, path, str; 00123 str=PL->_unparsed_args(); 00124 if (!allowed() || !str || sscanf(str, "%s %s", key, path)!=2) { 00125 notify_fail("Syntax: AddLog <key> <path>\n"); 00126 return 0; 00127 } 00128 key=lower_case(key); 00129 if (logs[key]) { 00130 notify_fail("Es gibt schon ein Logfile mit diesem Key in der Liste.\n"); 00131 return 0; 00132 } 00133 logs+=([ key: path; 0; 0 ]); 00134 AddCmd(key, "read_log"); 00135 save_object(SAVEFILE); 00136 write("Logfile <"+key+"> in die Liste aufgenommen.\n"); 00137 return 1; 00138 }
| static int aktualisieren | ( | string | str | ) | [static] |
Definiert in Zeile 77 der Datei logtool.c.
00078 { 00079 if (!allowed()) return 0; 00080 if (str && str!="") { 00081 if (!logs[str]) { 00082 notify_fail("Ein solches Logfile ist nicht in der Liste enthalten.\n"); 00083 return 0; 00084 } 00085 logs[str, 1]=file_size(logs[str, 0]); 00086 logs[str, 2]=file_time(logs[str, 0]); 00087 } 00088 else filter(m_indices(logs), lambda( ({ 'x }),({#', , 00089 ({#'=, ({#'[, logs, 'x, 1}), ({#'file_size, ({#'[, logs, 'x, 0}) }) }), 00090 ({#'=, ({#'[, logs, 'x, 2}), ({#'file_time, ({#'[, logs, 'x, 0}) })})}))); 00091 write("Done!\n"); 00092 save_object(SAVEFILE); 00093 return 1; 00094 }
| void create | ( | ) |
Definiert in Zeile 25 der Datei logtool.c.
00026 { 00027 if (!clonep(ME)) return; 00028 ::create(); 00029 if (!restore_object(SAVEFILE)) { 00030 logs=([ "repfile": sprintf("/log/report/%s.rep", geteuid()); 0; 0 ]); 00031 if (IS_ARCH(geteuid())) 00032 logs+=(["snooplog": "/log/SNOOP"; 0; 0, "killer": "/log/KILLER"; 0; 0]); 00033 } 00034 SetProp(P_SHORT, geteuid()+"s Logtool"); 00035 SetProp(P_NAME, QueryProp(P_SHORT)); 00036 SetProp(P_NODROP, 0); 00037 SetProp(P_NEVERDROP, 0); 00038 SetProp(P_AUTOLOADOBJ, 1); 00039 AddId("logtool"); 00040 AddCmd("mark", "aktualisieren"); 00041 AddCmd(m_indices(logs), "read_log"); 00042 AddCmd("AddLog", "add_log"); 00043 AddCmd("DelLog", "del_log"); 00044 }
| static int del_log | ( | string | str | ) | [static] |
Definiert in Zeile 140 der Datei logtool.c.
00141 { 00142 if (!allowed() || !str) { 00143 notify_fail("WELCHES Logfile soll aus der Liste entfernt werden?\n"); 00144 return 0; 00145 } 00146 if (!logs[str]) { 00147 notify_fail("Logfile nicht in Liste enthalten.\n"); 00148 return 0; 00149 } 00150 logs=m_delete(logs,str); 00151 RemoveCmd(str); 00152 save_object(SAVEFILE); 00153 write("Logfile <"+str+"> aus Liste entfernt.\n"); 00154 return 1; 00155 }
| varargs string long | ( | ) |
Definiert in Zeile 65 der Datei logtool.c.
00066 { 00067 return "Folgende Logfiles werden derzeit von Deinem Logtool verwaltet:\n\n" 00068 +implode(map(sort_array(m_indices(logs), #'>), 00069 lambda( ({ 'x }), ({#'sprintf, " %1s %-14s - %s", ({#'?, ({#'!=, 00070 ({#'[,logs,'x, 2}), ({#'file_time,({#'[,logs,'x, 0})})}),"*",""}), 00071 ({#'sprintf, "<%s>", 'x}), ({#'[, logs, 'x, 0})}) ) ), "\n") 00072 +"\n\nMit <mark> koennen alle Eintraege als gelesen markiert und " 00073 +"mit Add- und\nDelLog Logfiles in die Liste aufgenommen bzw. aus " 00074 +"der Liste entfernt werden.\n"; 00075 }
| varargs int move | ( | mixed | dest, | |
| int | method | |||
| ) |
| static int read_log | ( | string | str | ) | [static] |
Definiert in Zeile 96 der Datei logtool.c.
00097 { 00098 int si; 00099 if (!allowed()) return 0; 00100 si=file_size(logs[query_verb(),0]); 00101 if (str) 00102 PL->more(logs[query_verb(),0]); 00103 else { 00104 if (si<0 || file_time(logs[query_verb(), 0])==logs[query_verb(), 2]) 00105 write("Keine neuen Eintraege in <"+query_verb()+">.\n"); 00106 else { 00107 write("Folgendes ist neu in <"+query_verb()+">.\n"); 00108 if (si<logs[query_verb(),1]) 00109 PL->more(logs[query_verb(),0]); 00110 else PL->More(read_bytes(logs[query_verb(),0], 00111 logs[query_verb(),1],si-logs[query_verb(),1])); 00112 } 00113 } 00114 logs[query_verb(), 1]=si; 00115 logs[query_verb(), 2]=file_time(logs[query_verb(), 0]); 00116 save_object(SAVEFILE); 00117 return 1; 00118 }
| void reset | ( | void | ) |
| mapping logs |
Definiert in Zeile 15 der Datei logtool.c.
Wird benutzt von check_logs() und long().
| inherit std secure_thing |
1.6.3