function servercmdTDMgetPackages(%client)
{
%open = new FileObject();
%name = findFirstFile("Add-Ons/Client/TeamDMv4/Packages/*.tdm");
while(%name !$= "")
{
%open.openForRead(%name);
//File read stuff
%open.close();
%name = findNextFile("Add-Ons/Client/TeamDMv4/Packages/*.tdm");
}
%open.delete();
}
Because of the way Torque does the file search routine, file searches cannot happen in the Add-On loading procedure, it erases the search and makes the file executing keep looping. I scheduled this function to happen after about three seconds, partly into the loading datablocks. The only downside is that if it echos ("**Loaded: Capture the Flag" or whatever) then it appears in the wrong place.