11.03.2014, 19:40
In server_log.txt errors are printet correctly, but OnRuntimeError always prints this for any error:
The code:
Код:
[11.03.2014, 09:06] Error: AMX backtrace: #0 native GetAmxBacktrace () [f6766850] from crashdetect.so #1 00248abc in public globalPlayerLoop@_yT (p=4, ... <1 argument>) at ../bugged/logs.inc:63 Native backtrace: #0 f676931b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so #1 f67637c2 in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so #2 f6766430 in ?? () from plugins/crashdetect.so #3 08093d84 in ?? () from samp03svr #4 f676103c in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so #5 f6767458 in ?? () from plugins/crashdetect.so #6 f676bc61 in amx_Exec () from plugins/crashdetect.so #7 f67635ad in _ZN11CrashDetect15HandleExecErrorEiPiRK8AMXError () from plugins/crashdetect.so #8 f67673b8 in ?? () from plugins/crashdetect.so #9 f6769fb6 in amx_RaiseExecError () from plugins/crashdetect.so #10 f676c50a in amx_Exec () from plugins/crashdetect.so #11 f6763708 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so #12 f67671c9 in ?? () from plugins/crashdetect.so #13 080e57b5 in ?? () from samp03svr #14 080acedb in ?? () from samp03svr #15 080a81ae in ?? () from samp03svr #16 f752abd6 in __libc_start_main () from /lib32/libc.so.6 #17 0804b4a1 in ?? () from samp03svr
pawn Код:
public OnRuntimeError(code, &bool: suppress)
{
SO(COLOR_OWNER, "[ERROR] Runtime error (crashdetect).");
new debug_text[2000];
new yy, mm, dd, hh, ii, ss;
getdate(yy, mm, dd);
gettime(hh, ii, ss);
new File:hFile, thefile[32];
format(thefile, sizeof(thefile), "/debug/%02d_crashdetect.txt", mm);
hFile = fopen(thefile, io_append);
format(debug_text, sizeof(debug_text), "\n[%02d.%02d.%04d, %02d:%02d] Error:\n", dd, mm, yy, hh, ii);
fwrite(hFile, debug_text);
GetAmxBacktrace(debug_text,sizeof(debug_text)); // <- this is line 63
fwrite(hFile, debug_text);
GetNativeBacktrace(debug_text, sizeof(debug_text));
fwrite(hFile, debug_text);
fclose(hFile);
return 1;
}