Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => FilterScripte, Include, Pluginovi za SA-MP => Pluginovi za SA-MP => Temu započeo: Harryâ„¢ poslato Mart 30, 2016, 19:41:18 POSLE PODNE

Naslov: [Plugin] CrashDetect (pronadjite gresku u skripti)
Poruka od: Harryâ„¢ poslato Mart 30, 2016, 19:41:18 POSLE PODNE
Ime plugina: CrashDetect
Ime autora: JernejL
Opis: Ovaj plugin nam pomaze odnosno omogucuje da pronadjemo gresku u gamemodeu zbog cega nam ne moze pokrenuti srw, zasto se gasi i tako nesto slicno
Funkcije:

Znaci pokrecete mod!
[pawn]
#include <a_samp>

main() {
    function1();
}

function1() {
    function2();
}

function2() {
    new buf[10];
    fread(File:123, buf);
}
[/pawn]


U defaultu kada doÄ'e do funkcije "function2",vaÅ¡ server će se odmah ugasiti,a ukoliko koristite windows server samo će napisati neki text u crashinfo.txt.

Ali sa CrashDetectom,vi će te vidjeti sljedeče:



[05:26:38] [debug] Server crashed while executing crash.amx
[05:26:38] [debug] Backtrace (most recent call first):
[05:26:38] [debug] #0  native fread () from samp-server.exe
[05:26:38] [debug] #1  00000090 in ?? () from crash.amx
[05:26:38] [debug] #2  00000038 in ?? () from crash.amx
[05:26:38] [debug] #3  0000001c in main () from crash.amx
which is more informative. You can also get more information like line numbers, function names, parameter values, etc if compile that script in debug mode to make compiler put extra information about all that stuff into the output .amx (see here for how):



[05:27:11] [debug] Server crashed while executing crash.amx
[05:27:11] [debug] Backtrace (most recent call first):
[05:27:11] [debug] #0  native fread () from samp-server.exe
[05:27:11] [debug] #1  000000b8 in function2 () at crash.pwn:13
[05:27:11] [debug] #2  00000048 in function1 () at crash.pwn:8
[05:27:11] [debug] #3  00000024 in main () at crash.pwn:4
Runtime error


Run time erori su najčešće napisani u ovom obliku "Run time error <error_code>:"Error details here" poruka". Nažalost ova poruka je rijetko prikazana jer ju server ne traži uvijek.

[pawn]public OnGameModeInit() {
    new bla[5];

    new fffuuuu = 0;

    fffuuuu = 100;
    bla[fffuuuu] = 100;

    return bla[fffuuuu];
}[/pawn]


Ukoliko kompilate ovaj kod u debug modu i pokrenete server:

[05:32:16] [debug] Run time error 4: "Array index out of bounds"
[05:32:16] [debug]   Accessing element at index 100 past array upper bound 4
[05:32:16] [debug] Backtrace (most recent call first):
[05:32:16] [debug] #0  00000084 in public OnGameModeInit () at bounds.pwn:11


Ukoliko želite napraviti da se vaš server ugasi na prvom "runtime" eroru, namjestite "die_on_error" u vašem server.cfg na 1.

npr: die_on_error 1



Download:


Source code: https://github.com/Zeex/samp-plugin-crashdetect
Pre-built binaries for Linux and Windows: https://github.com/Zeex/samp-plugin-crashdetect/tree/downloads
Naslov: Odg: [Plugin] CrashDetect (pronadjite gresku u skripti)
Poruka od: Muma poslato Mart 30, 2016, 20:01:42 POSLE PODNE
Jako korisno mogu da kazem.. ovaj napisem.. xD :D
Naslov: Odg: [Plugin] CrashDetect (pronadjite gresku u skripti)
Poruka od: Harryâ„¢ poslato Mart 30, 2016, 21:04:34 POSLE PODNE
mislim da ce posluziti nekom, haha :)
Naslov: Odg: [Plugin] CrashDetect (pronadjite gresku u skripti)
Poruka od: VuKaN poslato Mart 30, 2016, 21:09:35 POSLE PODNE
Jako korisno :)
Naslov: Odg: [Plugin] CrashDetect (pronadjite gresku u skripti)
Poruka od: Harryâ„¢ poslato April 01, 2016, 19:14:37 POSLE PODNE
hvala
Naslov: Odg: [Plugin] CrashDetect (pronadjite gresku u skripti)
Poruka od: .focus poslato Avgust 18, 2016, 08:46:02 PRE PODNE
Odlicno
Naslov: Odg: [Plugin] CrashDetect (pronadjite gresku u skripti)
Poruka od: berroni.pwn poslato Oktobar 02, 2016, 16:37:50 POSLE PODNE
Posluzice sigurno
Naslov: Odg: [Plugin] CrashDetect (pronadjite gresku u skripti)
Poruka od: berroni.pwn poslato Novembar 14, 2016, 17:58:19 POSLE PODNE
KATANAC