Implement a watchdog timer for scripts that take too long to execute (bug 5837, r=fyren).
--HG-- extra : rebase_source : ffacb38457eca581660ce8f15c444ad828b7fedd
This commit is contained in:
+11
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* vim: set ts=4 sw=4 :
|
||||
* vim: set ts=4 sw=4 tw=99 noet:
|
||||
* =============================================================================
|
||||
* SourceMod
|
||||
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
|
||||
@@ -311,6 +311,16 @@ void SourceModBase::StartSourceMod(bool late)
|
||||
{
|
||||
extsys->LoadAutoExtension("updater.ext." PLATFORM_LIB_EXT);
|
||||
}
|
||||
|
||||
const char *timeout = GetCoreConfigValue("SlowScriptTimeout");
|
||||
if (timeout == NULL)
|
||||
{
|
||||
timeout = "8";
|
||||
}
|
||||
if (atoi(timeout) != 0)
|
||||
{
|
||||
g_pSourcePawn2->InstallWatchdogTimer(atoi(timeout) * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
static bool g_LevelEndBarrier = false;
|
||||
|
||||
Reference in New Issue
Block a user