Ok, after some tests, the 99% of problems im getting with server stuck while restarting is for the system filterscript.
So i made a test, i removed the system filterscript (the one which handles everything, register, login, ac etc..) and replaced with a default samp filterscript which comes in the samp server package. (a51_base)
No server stuck at restart, randomly change was working well.
Then i re-added the system filterscript and server gets stuck, so 99% is the sys fs the problem. This is the server log when using sys fs:
Quote:
[07:32:14] Filterscripts
[07:32:14] ---------------
[07:32:14] Loading filterscript 'sys.amx'...
[07:32:14]
[07:32:14]
[07:32:14]
[07:32:14] =======================================
[07:32:14] | |
[07:32:14] | YSI version 3.09.0684 |
[07:32:14] | By Alex "******" Cole |
[07:32:14] | |
[07:32:14] =======================================
[07:32:14]
[07:32:14] Attempting to connect to MySQL...
[07:32:14] Successfully connected on DB ****
[07:32:14] Connected to database (host: ****, db: ****) as ****
[07:32:14] -> Loaded Successfully!
[07:32:14] Date: 29/9/2015 - Time: 7:32:14
[07:32:14] __________________________________________________ _
[07:32:14] Loaded 1 filterscripts.
[07:32:14]
----------------------------------
[07:32:14] Hot Room Loaded (TDM).
[07:32:14] ----------------------------------
[07:32:14] Number of vehicle models: 0
[07:32:39] [connection] **** requests connection cookie.
[07:32:40] [connection] incoming connection: *** id: 0
[07:32:40] [join] Face9000 has joined the server (0:***)
|
As you can see, nothing is printed in the server console after gamemode restart.
MySql log is okay, i dont get any problem.
This is OnFilterScriptInit of the sys fs:
Код:
public OnFilterScriptInit()
{
print("Attempting to connect to MySQL...");
mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
mConnectionHandle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
if(mysql_errno(mConnectionHandle) != 0)
{
print("Could not connect to database!");
}
else
{
printf("Successfully connected on DB %s",SQL_DB);
}
if(mysql_errno(mConnectionHandle) != 0) print("Could not connect to database!");
else printf("Connected to database (host: %s, db: %s) as %s", SQL_HOST, SQL_DB, SQL_USER);
SetTimer("SaveAllStats", 300000, 1);
SetTimer("AntiCheat", 1000, 1);
SetTimer("RandomMessages", 60000*RANDMSGMINUTES, 1);
new year,month,day;
getdate(year, month, day);
new hour,minute,second;
gettime(hour,minute,second);
print(" -> Loaded Successfully!\n");
printf(" Date: %d/%d/%d - Time: %d:%d:%d",day,month,year,hour, minute, second);
print(" ___________________________________________________\n");
botIDs[0] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_1_MAIN_NICKNAME, BOT_1_REALNAME, BOT_1_USERNAME);
IRC_SetIntData(botIDs[0], E_IRC_CONNECT_DELAY, 10);
botIDs[1] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_2_MAIN_NICKNAME, BOT_2_REALNAME, BOT_2_USERNAME);
IRC_SetIntData(botIDs[1], E_IRC_CONNECT_DELAY, 15);
botIDs[1] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_3_MAIN_NICKNAME, BOT_3_REALNAME, BOT_3_USERNAME);
IRC_SetIntData(botIDs[2], E_IRC_CONNECT_DELAY, 15);
groupID = IRC_CreateGroup();
EnableVehicleFriendlyFire();//Anti team vehicle damaging
foreach (new i : Player)
{
JailTxd[i] = TextDrawCreate(482.000000, 366.000000, "Jail Time:");
TextDrawBackgroundColor(JailTxd[i], 255);
TextDrawFont(JailTxd[i], 2);
TextDrawLetterSize(JailTxd[i], 0.280000, 1.500000);
TextDrawColor(JailTxd[i], -1);
TextDrawSetOutline(JailTxd[i], 1);
TextDrawSetProportional(JailTxd[i], 1);
TextDrawUseBox(JailTxd[i], 1);
TextDrawBoxColor(JailTxd[i], -219);
TextDrawTextSize(JailTxd[i], 635.000000, 0.000000);
}
for(new i=0; i<gMax; i++)
{
InfoBox[i] = TextDrawCreate(37.000000,127.000000," ");
TextDrawUseBox(InfoBox[i],1);
TextDrawBoxColor(InfoBox[i],0x00000033);
TextDrawTextSize(InfoBox[i],217.000000,59.000000);
TextDrawAlignment(InfoBox[i],0);
TextDrawBackgroundColor(InfoBox[i],0x000000ff);
TextDrawFont(InfoBox[i],2);
TextDrawLetterSize(InfoBox[i],0.199999,1.200005);
TextDrawColor(InfoBox[i],0xffffffff);
TextDrawSetOutline(InfoBox[i],1);
TextDrawSetProportional(InfoBox[i],1);
TextDrawSetShadow(InfoBox[i],1);
}
//Textdraws
LogoTxd0 = TextDrawCreate(517.000000, 419.000000, "Epic Missions v0.1");
TextDrawBackgroundColor(LogoTxd0, 255);
TextDrawFont(LogoTxd0, 3);
TextDrawLetterSize(LogoTxd0, 0.370000, 1.000000);
TextDrawColor(LogoTxd0, -1);
TextDrawSetOutline(LogoTxd0, 1);
TextDrawSetProportional(LogoTxd0, 1);
LogoTxd1 = TextDrawCreate(531.000000, 434.000000, "Created by Face9000");
TextDrawBackgroundColor(LogoTxd1, 255);
TextDrawFont(LogoTxd1, 3);
TextDrawLetterSize(LogoTxd1, 0.250000, 1.000000);
TextDrawColor(LogoTxd1, -16776961);
TextDrawSetOutline(LogoTxd1, 1);
TextDrawSetProportional(LogoTxd1, 1);
MissionTxd = TextDrawCreate(3.000000, 428.000000, "Mission:");
TextDrawBackgroundColor(MissionTxd, 255);
TextDrawFont(MissionTxd, 3);
TextDrawLetterSize(MissionTxd, 0.370000, 1.000000);
TextDrawColor(MissionTxd, -1);
TextDrawSetOutline(MissionTxd, 1);
TextDrawSetProportional(MissionTxd, 1);
TextDrawUseBox(MissionTxd, 1);
TextDrawBoxColor(MissionTxd, 69);
TextDrawTextSize(MissionTxd, 637.000000, 20.000000);
GameTypeTxd = TextDrawCreate(263.000000, 428.000000, "Game Type:");
TextDrawBackgroundColor(GameTypeTxd, 255);
TextDrawFont(GameTypeTxd, 3);
TextDrawLetterSize(GameTypeTxd, 0.370000, 1.000000);
TextDrawColor(GameTypeTxd, -1);
TextDrawSetOutline(GameTypeTxd, 1);
TextDrawSetProportional(GameTypeTxd, 1);
RandMsgTxd = TextDrawCreate(121.000000, 416.000000, "_");
TextDrawBackgroundColor(RandMsgTxd, 255);
TextDrawFont(RandMsgTxd, 2);
TextDrawLetterSize(RandMsgTxd, 0.170000, 1.000000);
TextDrawColor(RandMsgTxd, -1);
TextDrawSetOutline(RandMsgTxd, 1);
TextDrawSetProportional(RandMsgTxd, 1);
TextDrawUseBox(RandMsgTxd, 1);
TextDrawBoxColor(RandMsgTxd, 69);
TextDrawTextSize(RandMsgTxd, 483.000000, 20.000000);
//
return 1;
}
And OnPlayerConnect:
Код:
public OnPlayerConnect(playerid)
{
ResetPlayerCash(playerid);
pDrunkLevelLast[playerid] = 0;
cowit[playerid] = 0;
pFPS[playerid] = 0;
killstreak[playerid] = 0;
//================================================================//
// MySQL part //
//================================================================//
JustLogged[playerid] = 0;
IsPlayerBanned(playerid);
new query[300], pname[24];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT 'IP' FROM `players` WHERE Username = '%s' LIMIT 1", pname);
mysql_tquery(mConnectionHandle, query, "OnAccountLoad", "i", playerid);
printf("%s", query);*/
/*___________________________________________________________________________________________________________________________*/
SetPVarInt(playerid, "spawned", 0);
for( new i = 0; i <= 50; i ++ ) SCM(playerid,-1, "" );
SCM(playerid, COLOR_JOINHELPERCHAT, "** Welcome to Epic Missions - Please read /rules and /cmds for server info.");
SCM(playerid,0xFF8080FF, "** Do /gametypes to know the available game types and their reward in this server.");
SCM(playerid,0xFF8080FF, "** NOTICE: If you see anyone hacking please report it using /report [id] [reason]");
SendDeathMessage(INVALID_PLAYER_ID,playerid, 200);
new str[ 100 ];
gpci( playerid , str , sizeof( str ) );
if( !strcmp( str , DISALLOWED_ADDRESS ,true ) )
{
ShowPlayerDialog(playerid, 64, DIALOG_STYLE_MSGBOX, "Map Stealer", "570P US1NG M4P 5T34L3R M07H3RFUCK3R, FUCK 0FF.", "1M 7H3 R34L FUCK3R5", "");
BanEx( playerid, "Map Stealer / RakSampClient" );
}
new stats[128];
format(stats, sizeof(stats), "UPDATE ServerStats SET TotalJoins = TotalJoins + 1");
mysql_function_query(mysql, stats, false, "", "");
new joinm[128];
new ipp[16];
GetPlayerIp(playerid, ipp, sizeof(ipp));
format(joinm,sizeof(joinm),"* %s (%d) has joined the server. (IP: %s)", Name[playerid],playerid,ipp);
SendStaffMessage(0xFF0000FF,joinm);
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
new ModeName[45], GameTypeName[45], mess[128];
GetSVarString("GM_Name", ModeName, sizeof(ModeName));
GetSVarString("GameType", GameTypeName, sizeof(GameTypeName));
format(mess,sizeof(mess),"> You are currently playing: {F2C80C}%s (%s)", ModeName, GameTypeName);
SCM(playerid, -1, mess);
new ipschan[150];
new name[24];
GetPlayerName(playerid, Name[playerid], 24);
new ipo[16];
GetPlayerIp(playerid, ipo, sizeof(ipo));
format(ipschan, sizeof(ipschan), "** %s (%d) IP: %s - %s", name,playerid,ipo,InsertTimeStamp());
JoinsLog(ipschan);
IRC_GroupSay(groupID, IRC_IPCHANNEL, ipschan);
FpsPingLabel[playerid] = Create3DTextLabel("_", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(FpsPingLabel[playerid], playerid, 0.0, 0.0, 0.75);
/*TextDrawShowForPlayer(playerid, LogoTxd0);
TextDrawShowForPlayer(playerid, LogoTxd1);*/
return 1;
}
I tried commenting mysql login/register part but still same result.
I wanna advise that thing server stuck happens even with normal rcon changemode GMNAME.
Any help is really appreciated, thanks.