Server Crashing [CrashDetector Logs]
#1

So we have been attempting to launch our roleplay server for the past few weeks but for some reason our server kept crashing, Today we decided to install the CrashDetector plugin so we can check the errors which isn't visible in the normal server console (without the Crash Detector)

And so far I got this from the logs;

NEW ACCURATE LOGS

Click here for the logs

What does that mean?

I will give down the needed codes once I have clarified which codes are causing these problems.
Reply
#2

Код:
[debug] #2 00194b24 in public cmd_admin (0, 26192864) from rgrp.amx
Show command 'admin' in the script rgrp.pwn.
Reply
#3

PHP код:
CMD:admin(playeridparams[])  {
    if(
PlayerInfo[playerid][pAdmin] >= 1) {
        if(!
isnull(params)) {

            new
                
szMessage[150];

            
format(szMessagesizeof(szMessage), "* %s %s: %s"GetAdminRank(PlayerInfo[playerid][pAdmin]), GetPlayerNameEx(playerid), params);
            
SendAdminMessage(COLOR_YELLOWszMessage);
            
Log("rgrp/logs/adminchat.log"szMessage);
        }
        else 
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: (/a)dmin [admin chat]");
    }
    return 
1;
}

GetAdminRank(rank)
{
    new 
str[64];
    
    switch(
rank)
    {
        case 
1str "Trial Admin";
        case 
2str "General Admin";
        case 
3str "Lead Admin";
        case 
4str "Assistant Director";
        case 
5str "Server Director";
        case 
6str "Server Owner";
        default: 
str "None";
    }
    return 
str;

Reply
#4

Show the function 'Log'.
Reply
#5

PHP код:
Log(sz_fileName[], sz_input[]) {

    new
        
sz_logEntry[156],
        
i_dateTime[2][3],
        
FilefileHandle fopen(sz_fileNameio_append);

    
gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
    
getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);

    
format(sz_logEntrysizeof(sz_logEntry), "[%i/%i/%i - %i:%i:%i] %s\r\n"i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], sz_input);
    
fwrite(fileHandlesz_logEntry);
    return 
fclose(fileHandle);

Reply
#6

PHP код:
Log(sz_fileName[], sz_input[]) {
    new
        
sz_logEntry[156],
        
i_dateTime[2][3],
        
FilefileHandle fopen(sz_fileNameio_append);
    if(
fileHandle)
    {
        
gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
        
getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
        
format(sz_logEntrysizeof(sz_logEntry), "[%i/%i/%i - %02i:%02i:%02i] %s\r\n"i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], sz_input);
        
fwrite(fileHandlesz_logEntry);
        
fclose(fileHandle);
    }
    else 
printf("File cannot be found - %s"sz_fileName);

Tested, and it works.
Reply
#7

did rgrp/logs/adminchat.log file exist ??

if no create it and test
Reply
#8

As far as I know, io_append creates the file if it doesn't exist so I don't see any reason how it could crash the server therefore I don't think the function Log is the reason why the server is crashing.

Btw, BUMP.
Reply
#9

Try this:
PHP код:
Log(sz_fileName[], sz_input[]) {

    new
        
sz_logEntry[156],
        
i_dateTime[2][3],
        
FilefileHandle fopen(sz_fileNameio_append);

    if(!
fileHandle)
        return 
printf("[Error] Cannot write logs - filename : '%s' - inpute '%s'"sz_fileNamesz_input);

    
gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
    
getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);

    
format(sz_logEntrysizeof(sz_logEntry), "[%i/%i/%i - %i:%i:%i] %s\r\n"i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], sz_input);
    
fwrite(fileHandlesz_logEntry);
    return 
fclose(fileHandle);

Reply
#10

I have actually find another logs from the CrashDetector this morning, I will leave out the pastebin link in the first post.

P.S.: It is not the Log that gives out these crashes it was something else.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)