Good feature!
But today I got this error message. Probably caused by slow hardware I/O because the error occurred after rebooting the physical machine:
Code:
L 11/04/2015 - 11:00:12: [SM] Plugin encountered error 30: Script execution timed out
L 11/04/2015 - 11:00:12: [SM] Displaying call stack trace for plugin "Plugin.smx":
L 11/04/2015 - 11:00:12: [SM] [0] Line 329, addons/sourcemod/scripting/include/string.inc::StrEqual()
L 11/04/2015 - 11:00:12: [SM] [1] Line 2551, inc/common.inc.compile::RemoveOldFiles()
L 11/04/2015 - 11:00:12: [SM] [2] Line 2543, inc/common.inc.compile::TidyUp()
L 11/04/2015 - 11:00:12: [SM] [3] Line 105, base.inc.compile::OnPluginStart()
I am wondering why it stops at
StrEqual() and not at
ReadDirEntry() or
OpenDirectory()?
Code:
stock RemoveOldFiles(const String:directory[], const MaxAge) {
new FileTime;
decl String:filename[32];
decl String:FilePath[64];
new Handle:dir = OpenDirectory(directory);
while (ReadDirEntry(dir, filename, sizeof(filename))) {
if (!StrEqual(filename, ".") && !StrEqual(filename, "..")) {
...
}
}
CloseHandle(dir);
}
Maybe it is a bug of StrEqual(). Line 329 in string.inc is:
Code:
native bool:IsCharAlpha(chr);
I'm using Sourcemod 1.7, Build 5272.