#include <daemon.h>#include <logging.h>
gehe zum Quellcode dieser Datei
Funktionen | |
| protected void | create () |
| int | check (string ch, object pl, string cmd, string txt) |
| string | name () |
| string | Name () |
| void | ChannelMessage (mixed a) |
Variablen | |
| static int | d_start |
| static int | d_end |
| static int | e_start |
| static int | e_end |
| void ChannelMessage | ( | mixed | a | ) |
Definiert in Zeile 98 der Datei debug.c.
Benutzt d_end, d_start, e_end und e_start.
00099 { 00100 int fs; 00101 00102 fs = file_size(__DEBUG_LOG__); 00103 00104 switch( a[0] ){ 00105 case "Debug": 00106 if ( fs > d_end && fs > e_end ){ 00107 d_start = max((d_end > e_end ? d_end : e_end),0); 00108 d_end = fs; 00109 } 00110 else if (fs < d_start || fs <= d_end) { 00111 // Debuglog wurde wohl neu geoeffnet. 00112 d_start = d_end = e_start = e_end = fs; 00113 } 00114 break; 00115 00116 case "Entwicklung": 00117 if ( fs > d_end && fs > e_end ){ 00118 e_start = max((e_end > d_end ? e_end : d_end),0); 00119 e_end = fs; 00120 } 00121 else if (fs < e_start || fs <= e_end) { 00122 // Debuglog wurde wohl neu geoeffnet. 00123 d_start = d_end = e_start = e_end = fs; 00124 } 00125 break; 00126 } 00127 }
| int check | ( | string | ch, | |
| object | pl, | |||
| string | cmd, | |||
| string | txt | |||
| ) |
Definiert in Zeile 15 der Datei debug.c.
Benutzt C_FIND, C_JOIN, C_LEAVE, C_LIST, C_SEND, call_out(), d_end, d_start, e_end, e_start, P_CHANNELS und query_wiz_level().
00016 { 00017 mixed tmp; 00018 00019 if ( ch != "Debug" && ch != "Entwicklung" && ch != "Warnungen" ) 00020 return 0; 00021 00022 if( objectp(pl) && query_once_interactive(pl) && query_wiz_level(pl) > 15 ) 00023 switch(cmd){ 00024 case C_FIND: 00025 case C_LIST: 00026 case C_JOIN: 00027 case C_LEAVE: 00028 return 1; 00029 case C_SEND: 00030 // Wer (noch) nicht auf dem Kanal ist, bekommt auch keine 00031 // Ausgabe - sonst gibt es selbige doppelt, da der CHMASTER 00032 // einen automatisch den Kanal betreten laesst ... 00033 if ( !objectp(pl) || !pointerp(tmp=(mixed)pl->QueryProp(P_CHANNELS)) || 00034 member( tmp, lower_case(ch) ) == -1 ) 00035 return 1; 00036 00037 switch( lower_case(txt) ){ 00038 case "backtrace": 00039 { 00040 string bt, log; 00041 int start, end; 00042 00043 if ( ch == "Debug" ) { 00044 start = d_start; 00045 end = d_end; 00046 } 00047 else if (ch == "Entwicklung") { 00048 start = e_start; 00049 end = e_end; 00050 } 00051 else if (ch == "Warnungen") { 00052 pl->Message( "[" + ch + ":] Backtrace fuer Warnungen " 00053 "nicht verfuegbar!\n"); 00054 return 0; 00055 } 00056 else return(1); 00057 00058 if( start >= end ) 00059 bt = "[" + ch + ":] Kein Backtrace verfuegbar!\n"; 00060 else { 00061 log = regreplace( read_bytes( __DEBUG_LOG__, start, 00062 (end-start>10000)?10000: 00063 end - start ) || "\nFehler beim Einlesen des Debuglogs: Kein Backtrace verfuegbar!\n", 00064 "(Misplaced|current_object|" 00065 "Connection|Host)[^\n]*\n", 00066 "", 1 ); 00067 bt = "[" + ch + ":] -- BACKTRACE BEGIN --\n" 00068 + log 00069 + "[" + ch + ":] -- BACKTRACE END --\n"; 00070 } 00071 00072 call_out( symbol_function( "Message", pl ), 0, bt ); 00073 } 00074 break; 00075 00076 default: 00077 if ( ch != "Warnungen" ) { 00078 pl->Message( "[" + ch + ":] Hilfe...\n" 00079 "[" + ch + ":] Folgende Kommandos stehen zur " 00080 "Verfuegung:\n" 00081 "[" + ch + ":] 'backtrace' -- sendet den " 00082 "Backtrace zum Fehler\n" 00083 "[" + ch + ":] 'hilfe' -- sendet diese " 00084 "Hilfeseite\n"); 00085 } 00086 else { 00087 pl->Message( "[" + ch + ":] Keine Kommandos verfuegbar!\n"); 00088 } 00089 } 00090 } 00091 00092 return 0; 00093 }

| protected void create | ( | ) |
int d_end [static] |
Definiert in Zeile 8 der Datei debug.c.
Wird benutzt von ChannelMessage(), check() und create().
int d_start [static] |
Definiert in Zeile 8 der Datei debug.c.
Wird benutzt von ChannelMessage(), check() und create().
int e_end [static] |
Definiert in Zeile 8 der Datei debug.c.
Wird benutzt von ChannelMessage(), check() und create().
1.6.3