25.07.2020, 20:30
Hello, the server crashed when i banned someone, I don't know what happens.
In mysql log:
Line 2344:
in
and line 4761:
in
Thanks!
PHP Code:
[16:14:10] [debug] Server crashed due to an unknown error
[16:14:10] [debug] Native backtrace:
[16:14:10] [debug] #0 f676f8b6 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () in plugins/crashdetect.so
[16:14:10] [debug] #1 f6767120 in _ZN18CrashDetectHandler20PrintNativeBacktraceERSoRKN2os7ContextE () in plugins/crashdetect.so
[16:14:10] [debug] #2 f6767886 in _ZN18CrashDetectHandler20PrintNativeBacktraceERKN2os7ContextE () in plugins/crashdetect.so
[16:14:10] [debug] #3 f6767f96 in _ZN18CrashDetectHandler7OnCrashERKN2os7ContextE () in plugins/crashdetect.so
[16:14:10] [debug] #4 f676ef82 in ?? () in plugins/crashdetect.so
[16:14:10] [debug] #5 f778fd40 in __kernel_rt_sigreturn () in linux-gate.so.1
[16:14:10] [debug] #6 f74dd5e8 in ?? () in /lib32/libc.so.6
[16:14:10] [debug] #7 0809571b in ?? () in ./server
[16:14:10] [debug] #8 f73fa7cf in ?? () in plugins/mysql.so
[16:14:10] [debug] #9 f7425843 in ?? () in plugins/mysql.so
[16:14:10] [debug] #10 f740d3a4 in ?? () in plugins/mysql.so
[16:14:10] [debug] #11 00000000 in nil ()
[16:14:10] [debug] Registers:
[16:14:10] [debug] EAX: ffc2c8d0 EBX: f22d5008 ECX: 0875500e EDX: ffc2c8d0
[16:14:10] [debug] ESI: ffffd8c0 EDI: 00000008 EBP: ffc2c7d8 ESP: ffc2c7ac
[16:14:10] [debug] EIP: f74dd5e8 EFLAGS: 00010203
[16:14:10] [debug] Stack:
[16:14:10] [debug] ESP+00000000: 0809571b ffc2c8d0 0875500e ffc2caf8
[16:14:10] [debug] ESP+00000020: f744e000 088375e8 00000001 ffc2caf8
[16:14:10] [debug] ESP+00000040: f744e000 088375e8 f7711ed6 f744e000
[16:14:10] [debug] ESP+00000060: 00000000 00000000 00000003 00000028
[16:14:10] [debug] ESP+00000080: 00000030 087bbd48 0000000a 0000000b
[16:14:10] [debug] ESP+000000a0: 00000038 f7710e87 f774c000 087ae94c
[16:14:10] [debug] ESP+000000c0: f75fa000 08d597c4 f754a342 ffc2c938
[16:14:10] [debug] ESP+000000e0: f74c3ea5 0878cd5c 0878cbb4 f774c000
[16:14:10] [debug] ESP+00000100: f73ef000 0000032d 00000000 ffc2c8d0
[16:14:10] [debug] ESP+00000120: f73da722 08a89d58 f774c000 f7439b14
[16:14:10] [debug] ESP+00000140: f774c000 00000001 ffc2c980 ffc2c9c8
[16:14:10] [debug] ESP+00000160: f74c3ea5 00000000 f76aae56 00000008
[16:14:10] [debug] ESP+00000180: 00000020 00000000 087a74f8 f75fa420
[16:14:10] [debug] ESP+000001a0: 00000038 00000000 0000005b 00000000
[16:14:10] [debug] ESP+000001c0: f774c000 087a74f8 08d55918 ffc2caf8
[16:14:10] [debug] ESP+000001e0: f76aae68 00000000 f76aae56 f744e000
[16:14:10] [debug] ESP+00000200: f76aae68 00000000 087a74fc f7402319
[16:14:10] [debug] ESP+00000220: f73fb90b 08d562e0 f744d440 f7439b14
[16:14:10] [debug] ESP+00000240: 00000005 087bbd30 087bbd48 ffc2ca90
[16:14:10] [debug] ESP+00000260: 08d59d38 ffffd8c0 0878f350 ff800084
[16:14:10] [debug] ESP+00000280: ffc2ca31 0003cb01 e401d835 50fdf83e
[16:14:10] [debug] ESP+000002a0: 8b372c41 08d59a34 fdfdb30b 00000015
[16:14:10] [debug] ESP+000002c0: 00000063 ffc2ca90 081596ef ffc2ca88
[16:14:10] [debug] ESP+000002e0: 0806f87b 08d55440 08d562e0 f66fbcb8
[16:14:10] [debug] ESP+00000300: f74c6bd1 f743cef0 087a0f63 f0617898
[16:14:10] [debug] ESP+00000320: f76ad074 00000015 02e107d0 00000001
[16:14:10] [debug] ESP+00000340: f744e000 f05006ac ffc2cb50 ffc2cb78
[16:14:10] [debug] ESP+00000360: f743cd26 f743cd25 00000426 f05006ac
[16:14:10] [debug] ESP+00000380: f76aae68 00000000 00000000 f7712e49
[16:14:10] [debug] ESP+000003a0: f7711ee8 087bbd40 087bbd30 00000009
[16:14:10] [debug] ESP+000003c0: f744e000 081a1990 f05006ac ffc2cbf0
[16:14:10] [debug] ESP+000003e0: 087891c8 00000100 00000100 00000100
[16:14:10] [debug] Loaded modules:
[16:14:10] [debug] 00000000 - 00187dc3 server
[16:14:10] [debug] f778f000 - f778fe82 linux-gate.so.1
[16:14:10] [debug] f7770000 - f777281b /lib32/libdl.so.2
[16:14:10] [debug] f7754000 - f776ed2b /lib32/libpthread.so.0
[16:14:10] [debug] f7662000 - f775bd1a /usr/lib32/libstdc++.so.6
[16:14:10] [debug] f761c000 - f7660b97 /lib32/libm.so.6
[16:14:10] [debug] f75ff000 - f761b3c4 /usr/lib32/libgcc_s.so.1
[16:14:10] [debug] f7451000 - f7606237 /lib32/libc.so.6
[16:14:10] [debug] f7792000 - f77b34a0 /lib/ld-linux.so.2
[16:14:10] [debug] f7783000 - f778b7c4 plugins/Whirlpool.so
[16:14:10] [debug] f73f0000 - f744eaec plugins/mysql.so
[16:14:10] [debug] f73cd000 - f73ee108 /home/samp03/plugins/../log-core.so
[16:14:10] [debug] f777a000 - f778109f /lib32/librt.so.1
[16:14:10] [debug] f6fa3000 - f73b6e9f /home/samp03/plugins/../libmysqlclient.so.18
[16:14:10] [debug] f6795000 - f67a03ef /lib32/libnss_files.so.2
[16:14:10] [debug] f73bc000 - f73cb9b4 plugins/sscanf.so
[16:14:10] [debug] f6750000 - f67943ac plugins/crashdetect.so
[16:14:10] [debug] f6714000 - f674e7c8 plugins/jit.so
[16:14:10] [debug] f664e000 - f6713740 plugins/streamer.so
[16:14:10] [debug] f6569000 - f6650b50 plugins/pawncmd.so
[16:14:10] [debug] f63c9000 - f6570168 plugins/SKY.so
PHP Code:
[07/25/20 12:19:33] [plugins/mysql] cache_get_value_name_int: invalid row index '0' (number of rows: '0') (C:\Users\ert\Desktop\SERVER\gamemodes\game.pwn:2344)
[07/25/20 12:20:41] [plugins/mysql] cache_get_value_name_int: invalid row index '0' (number of rows: '0') (C:\Users\ert\Desktop\SERVER\gamemodes\game.pwn:2344)
[07/25/20 12:58:00] [plugins/mysql] cache_get_value_name_int: invalid row index '0' (number of rows: '0') (C:\Users\ert\Desktop\SERVER\gamemodes\game.pwn:2344)
[07/25/20 15:41:03] [plugins/mysql] cache_get_value_name_int: invalid row index '0' (number of rows: '0') (C:\Users\ert\Desktop\SERVER\gamemodes\game.pwn:2344)
[07/25/20 16:14:10] [plugins/mysql] error #1062 while executing query "INSERT INTO bans (`name`, `accid`, `by`, `reason`, `date`) VALUES ('Stefanrty', '43', 'Waser', 'cheat', NOW())": Duplicate entry '0' for key 'PRIMARY' (C:\Users\ert\Desktop\SERVER\gamemodes\game.pwn:4761)
[07/25/20 16:14:10] [log-core] signal 11 (SIGSEGV) catched; shutting log-core down (errno: 0, signal code: -6, exit status: 0)
PHP Code:
cache_get_value_int(0, "banned", banned);
PHP Code:
forward OnAccountCheckBan(playerid);
public OnAccountCheckBan(playerid)
{
new banned;
cache_get_value_int(0, "banned", banned);
if(banned == 1)
{
SendClientMessage(playerid, -1, "account banned :(");
SetTimerEx("SendToKick", 500, false, "i", playerid);
}
else
{
new playername[MAX_PLAYER_NAME], query[128];
GetPlayerName(playerid, playername, sizeof(playername));
mysql_format(db, query, sizeof(query), "SELECT `password`, `id` FROM `accounts` WHERE `name` = '%e' LIMIT 1", playername);
mysql_tquery(db, query, "OnAccountCheck", "d", playerid);
}
return true;
}
PHP Code:
mysql_tquery(db, query);
PHP Code:
CMD:ban(playerid, params[])
{
new id, reason[124], query[230], update[120], str[245], stringa[200];
if(PlayerInfo[playerid][Admin] < 4) return SendClientMessage(playerid, -1, "Nope");
if(sscanf(params, "us[124]", id, reason)) return SendClientMessage(playerid, -1, "/ban (id/name) (reason)");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Player disconnected");
if(PlayerInfo[playerid][Admin] < PlayerInfo[id][Admin]) return SendClientMessage(playerid, -1, "U cant");
if(id == playerid) return SendClientMessage(playerid, -1, "nope");
mysql_format(db, query, sizeof(query), "INSERT INTO bans (`name`, `accid`, `by`, `reason`, `date`) VALUES ('%e', '%d', '%e', '%e', NOW())", GetName(id), PlayerInfo[id][ID], GetName(playerid), reason);
mysql_format(db, update, sizeof(update), "UPDATE `accounts` SET `banned` = 1 WHERE name = '%e'", GetName(id));
mysql_tquery(db, query);
mysql_tquery(db, update);
format(str, sizeof(str), "%s has been banned by %s. (Reason: %s)", GetName(id), GetName(playerid), reason);
SendClientMessageToAll(0xff6b6bFF, str);
SetTimerEx("SendToKick", 500, false, "i", id);
format(stringa, sizeof(stringa), "Admin %s(%d) used the cmd /ban to %s.", GetName(playerid), playerid, GetName(id));
SendMessageToAdmins(0xe8e8e8FF, stringa);
new
File:lFile = fopen("db/logs/logs_ban.txt", io_append),
logData[178],
fyear, fmonth, fday,
fhour, fminute, fsecond;
getdate(fyear, fmonth, fday);
gettime(fhour, fminute, fsecond);
format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] (ADMIN NIVEL %d) %s banned %s. (Reason: %s)\r\n", fday, fmonth, fyear, fhour, fminute, fsecond, PlayerInfo[playerid][Admin], GetName(playerid), GetName(id), reason);
fwrite(lFile, logData);
fclose(lFile);
return 1;
}