AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sudden server shut down. (https://forums.alliedmods.net/showthread.php?t=171864)

Diegorkable 11-11-2011 20:21

Sudden server shut down.
 
Hey guys,

I've built a DR plugin and I played it for a while, today evening some problem occured and it is really wierd, it is coming from my plugin because i disabled all plugins and left only it, and it still happened, and when I removed it, it didnt happen.

The problem is that I play and sometimes it suddenly shuts down (Sending everyone the message "Server shutting down") and comes back after 5 seconds.

What may cause it? How can I check where's the problem coming from? What is most common to cause it? Is there any good method to check those type of mysterious annoying problems?

Just so you know, I debugged it and no error logs or bad logs indication on it doing something to the server.

What to do?? D:

fysiks 11-12-2011 01:31

Re: Sudden server shut down.
 
Did you disable auto-restart and then look at the server console when it "crashed"? You should try this as part of your debugging.

Backstabnoob 11-12-2011 06:39

Re: Sudden server shut down.
 
If it says server shutting down (not an unknown crash), then it means the game knows about it. Check cstrike/logs, there should be written the reason why it is crashing the server.

Diegorkable 11-12-2011 08:04

Re: Sudden server shut down.
 
Yeah, I tried to check that, and before each shut down I saw in the console: "sv_restart" changed to "1"

I checked the cstrike/logs and it said before each shutdown World Round_Start event triggered, and then the sv_restart, and then server shutting down.

I tried removing the "round_start" function from my code, and the server did not shutdown anymore!

then I put it back and it kept on shutting down again.

Thats how the logs look like, even though it doesnt remind Round_Start before Server crashing, I know its round_start cuz I disabled it and server does not shut down anymore.

Code:

L 11/12/2011 - 14:39:50: Server cvar "sv_restart" = "1"
L 11/12/2011 - 14:39:51: World triggered "Restart_Round_(1_second)"
L 11/12/2011 - 14:39:51: Team "CT" scored "0" with "1" players
L 11/12/2011 - 14:39:51: Team "TERRORIST" scored "0" with "0" players
L 11/12/2011 - 14:39:51: Server cvar "sv_restart" = "0"
L 11/12/2011 - 14:39:52: World triggered "Round_Start"
L 11/12/2011 - 14:39:54: World triggered "Game_Commencing"
L 11/12/2011 - 14:39:54: World triggered "Game_Commencing" (CT "0") (T "0")
L 11/12/2011 - 14:39:54: World triggered "Round_End"
L 11/12/2011 - 14:39:57: World triggered "Round_Start"
L 11/12/2011 - 14:40:37: "p1Mp<2><STEAM_0:0:10179170><CT>" committed suicide with "train" (world)
L 11/12/2011 - 14:40:37: Team "TERRORIST" triggered "Terrorists_Win" (CT "0") (T "1")
L 11/12/2011 - 14:40:37: World triggered "Round_End"
L 11/12/2011 - 14:40:42: World triggered "Round_Start"
L 11/12/2011 - 14:41:24: "XpaR<1><STEAM_0:0:35828728><CT>" triggered "weaponstats" (weapon "knife") (shots "1") (hits "0") (kills "0") (headshots "0") (tks "0") (damage "0") (deaths "0")
L 11/12/2011 - 14:41:24: "XpaR<1><STEAM_0:0:35828728><CT>" triggered "weaponstats2" (weapon "knife") (head "0") (chest "0") (stomach "0") (leftarm "0") (rightarm "0") (leftleg "0") (rightleg "0")
L 11/12/2011 - 14:41:24: "XpaR<1><STEAM_0:0:35828728><CT>" triggered "time" (time "1:35")
L 11/12/2011 - 14:41:24: "XpaR<1><STEAM_0:0:35828728><CT>" triggered "latency" (ping "20")
L 11/12/2011 - 14:41:24: Server cvar "sv_restart" = "1"
L 11/12/2011 - 14:41:24: "p1Mp<2><STEAM_0:0:10179170><TERRORIST>" triggered "time" (time "1:33")
L 11/12/2011 - 14:41:24: "p1Mp<2><STEAM_0:0:10179170><TERRORIST>" triggered "latency" (ping "16")
L 11/12/2011 - 14:41:24: [META] ini: Begin re-reading plugins list: /home/p1mp-1932/cs/cstrike/addons/metamod/plugins.ini
L 11/12/2011 - 14:41:24: [META] ini: Read plugin config for: AMX Mod X
L 11/12/2011 - 14:41:24: [META] ini: Finished reading plugins list: /home/p1mp-1932/cs/cstrike/addons/metamod/plugins.ini; Found 1 plugins
L 11/12/2011 - 14:41:24: [META] dll: Updating plugins...
L 11/12/2011 - 14:41:24: [META] dll: Finished updating 9 plugins; kept 1, loaded 0, unloaded 0, reloaded 0, delayed 0
L 11/12/2011 - 14:41:24: "XpaR<-1><><CT>" disconnected
L 11/12/2011 - 14:41:24: "p1Mp<-1><><TERRORIST>" disconnected
L 11/12/2011 - 14:41:24: World triggered "Round_Draw" (CT "0") (T "1")
L 11/12/2011 - 14:41:24: World triggered "Round_End"
L 11/12/2011 - 14:41:24: Server shutdown
L 11/12/2011 - 14:41:24: Log file closed

The function "Round_Start" in my code looks like this:

PHP Code:

public round_start()
{
    
g_FreeRound false
    g_RoundTime 
0
    
    
if ( g_VoteCanBegin )
    {
        
StartVote()
        
g_VoteCanBegin false
    
}
    
    
reset_all_variables()
}

public 
reset_all_variables()
{
    for (new 
ii<sizeof(g_Speed); i++)
    {
        
g_DidReviveme[i] = false
        g_AttackGamble
[i] = false
        g_LessSpeed
[i] = false
        g_Speed
[i] = false
        g_DidTry
[i] = false
        g_DidGamble
[i] = false
        g_DidRTD
[i] = false
        g_DidRTDa
[i] = false
        g_Equipped
[i] = false
        
        
if ( is_user_connected(i) && is_user_alive(i) )
        {
            
strip_user_weapons(i)
            
give_item(i"weapon_knife")
        }
    }


dont ask about StartVote() because it never gets called and because its enabled by a command that only me can activate, so really no reason to worry about that. Still I wonder what the heck can make a server crash, I tried disabling reset_all_variables() function (so it wont call it), and think its irrelevant to disable 2 lines that make boolean values false or make a variable 0.

I hope I provided enough information, I wonder now if you can guys still help me.

Thanks for the time,
Diegork.

EDIT: I just discovered something new, I discovered that when I DO NOT remove the round_Start public (put it in a note /* */) but DO put everything inside in NOTE (meaning I do like this:)

PHP Code:

public round_start()
{
         
/* content() */


then the server crash,

but when I put the whole round_start public in a note like this:

PHP Code:

/*public round_start()
{
         content()
}*/ 

the server doesnt crash cuz public isnt found.

Is there something wrong with my logevent register then??:

PHP Code:

register_logevent("round_start"2"1=Round_Start"

After looking at all logs it seems that all logs that had the Server Shut Down record inside, crashed with the same sequence:

• Metamod begins re-reading his plugins and then updating them.
• All the clients on the server disconnect
• Round_End is triggered
• Server Shutdown.

And it all happens on the same second (at the time of the log lines), it all happens in the same second..

That's the wierdest thing ever happened to me. What the heck also round_start has to do with this? (cuz when I remove it, the problem is fixed).

Diegorkable 11-12-2011 10:57

Re: Sudden server shut down.
 
I discovered another thing. If I turn off either Round_Start event or Round_End event the server would work fine. If BOTH are working, it'll do server shutting down. I dont get ANY clues from the logs about the cause of server crash.

Why the heck it happens, it didnt happen to me before, I mean, why would it make it crash when both running (register_event of round_end and register_logevent of round_start), I even tried to change the logevent of round_start to a register_event of the HLTV method.

does anyone have any ideas..?

Backstabnoob 11-12-2011 11:21

Re: Sudden server shut down.
 
How is g_Speed defined?

Diegorkable 11-12-2011 12:20

Re: Sudden server shut down.
 
Nevermind, I fixed it....
It didnt have anything to do with round_start or round_end, but when I disabled one of them it didnt happen, but check this out:

I set a task with ID 35, to a function() that gets no parameters, like this:

set_task(1.0, "Function", 35)
I didnt care about the TASK ID so I just put 35
I noticed server is shutting down so instead of sending 35 I did set_task(1.0, "Function", _), and it fixed it. Why the hell is it making a server shut down?


All times are GMT -4. The time now is 14:15.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.