Server Crash problem.
#1

i have this problem , when a random player is connecting to server get crashed .. i have an character system , an account can have 3 characters , and when he choose on of them server get crash , some times..

pawn Код:
[14:17:51] [debug] Server crashed while executing rp.amx
[14:17:51] [debug] AMX backtrace:
[14:17:51] [debug] #0 native SetPlayerName () [080cb9b0] from samp03svr
[14:17:51] [debug] #1 0015a6f0 in PlayerUpdateListener (playerid=2) at C:\Users\Filip\Desktop\SERVER\backup 27122013\rp.pwn:30547
[14:17:51] [debug] #2 00080120 in public CrashListener () at C:\Users\Filip\Desktop\SERVER\backup 27122013\rp.pwn:7731
[14:17:51] [debug] System backtrace:
[14:17:51] [debug] #0 f6b4035b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[14:17:51] [debug] #1 f6b39389 in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[14:17:51] [debug] #2 f6b3b8ed in _ZN11crashdetect11OnExceptionEPv () from plugins/crashdetect.so
[14:17:51] [debug] #3 f6b3fe68 in ?? () from plugins/crashdetect.so
[14:17:51] [debug] #4 f7761410 in ?? ()
[14:17:51] [debug] #5 080c9c47 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[14:17:51] [debug] #6 080cba55 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[14:17:51] [debug] #7 08093d14 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[14:17:51] [debug] #8 f6b3bea7 in _ZN11crashdetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[14:17:51] [debug] #9 f6b3e41e in ?? () from plugins/crashdetect.so
[14:17:51] [debug] #10 f6b4206e in amx_Exec () from plugins/crashdetect.so
[14:17:51] [debug] #11 f6b3bdab in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
[14:17:51] [debug] #12 f6b3e457 in ?? () from plugins/crashdetect.so
[14:17:51] [debug] #13 080dc115 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[14:17:51] [debug] #14 080b5cfb in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[14:17:51] [debug] #15 080b14d3 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
[14:17:51] [debug] #16 f747ee46 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[14:17:51] [debug] #17 0804b521 in ?? () from /home/gsp_1327/93.119.26.226-7777/samp03svr
pawn Код:
else if(key == KEY_SPRINT)
        {

            active_character[playerid] = character_offset[playerid];
            choosing_character[playerid] = false;
//28007     SetPlayerName(playerid,CharacterInfo[playerid][active_character[playerid]][cName]);
            character_chosen[playerid] = true;
            ProcessSpawn(playerid);
            LoadNotes(playerid);
            LoadInventory(playerid);
            LoadRingtone(playerid);
            //format(accent[playerid],16,"%s",CharacterInfo[playerid][active_character[playerid]][cAccent]);
            SetPlayerHealth(playerid,CharacterInfo[playerid][active_character[playerid]][cHealth]);
            SetPlayerArmour(playerid,CharacterInfo[playerid][active_character[playerid]][cArmor]);
            character_offset[playerid] = 0;
        }
Reply
#2

UP!!
Reply
#3

CharacterInfo[playerid][active_character[playerid]][cName] is NULL/empty and it makes SetPlayerName to crash the server.
Reply
#4

and how to fix?
Reply
#5

pawn Код:
// Add it under the includes:
#if !defined isnull
    #define isnull(%1) \
                ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
pawn Код:
if(!isnull(PlayerInfo[playerid][pNormalName])) SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
from your old post ?
Reply
#6

To prevent the crash - yes, you need to check if it's not NULL so it can set it safely. But I think you posted another part that uses SetPlayerName. Is the code you posted to your first post from PlayerUpdateListener?
Reply
#7

Yes , it is.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)