dordnung / System2

System2 Extension for Sourcemod
58 stars 16 forks source link

Problem executing System2_Execute, System2_Compress and System2_ExecuteThreaded #14

Open VitorCaleffi opened 3 years ago

VitorCaleffi commented 3 years ago

I'm almost sure this might be an issue with my server but here is the scenario:

SMLogTag(SML_INFO, "Compressing demo... (from: %s to: %s)", demoPath, destPath);

//This will compress and upload demo file
if(!System2_Compress(CompressCallback, demoPath, destPath)) {
    SMLogTag(SML_WARN, "7-zip not found");
}

void CompressCallback(bool success, const char[] command, System2ExecuteOutput output, any data) {
 ...
}

This will result in CompressCallback being called with success false, command as expected (if i run the command returned by the callback it executes normally) and output as "0" or invalid handle.

This happens for anything related to execute code on the vm itself, i´ve tried this:

Format(s3Command, sizeof(s3Command), "aws s3 cp %s %s", demoPath, s3Path);

SMLogTag(SML_INFO, "Uploading demo... (%s)", s3Command);

if(!System2_Execute(s3Output, sizeof(s3Output), s3Command)) {
    SMLogTag(SML_WARN, "Failed to upload demo");
}

Exactly same behavior.

If I try to use System2_Execute it returns false with no output. Im using the latest SM 11, but also tried with the latest SM10 stable

dordnung commented 3 years ago

I also think this is a problem with your server (maybe it's blocking command executions). I've released a new version with better error log in System2_Execute output, can you try your example above with the new version and show the output of s3Output