launcher fixes
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-08-16 10:25:05 -04:00
parent 3782145fb3
commit 418ff60f6a
3 changed files with 20 additions and 4 deletions

View File

@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file #maven.buildNumber.plugin properties file
#Fri Aug 16 09:31:36 EDT 2024 #Fri Aug 16 10:14:05 EDT 2024
buildNumber=241 buildNumber=249

View File

@ -588,6 +588,7 @@ Fix viewmodel animation framerate
Fix server not starting Fix server not starting
Fix client disconnection causing wrong socket to be closed from server Fix client disconnection causing wrong socket to be closed from server
Fix build tooling, scripts, etc Fix build tooling, scripts, etc
Launcher fixes
# TODO # TODO

View File

@ -29,13 +29,20 @@ int main(){
strcat(javaPath,"\\jdk\\bin\\java.exe\0"); strcat(javaPath,"\\jdk\\bin\\java.exe\0");
//get jar location //get jar location
char jarPath[MAX_PATH_SIZE + 50]; char jarPath[MAX_PATH_SIZE + 50];
strcpy(jarPath,currentWorkingDirectory);
strcpy(jarPath,"\"");
strcat(jarPath,currentWorkingDirectory);
strcat(jarPath,"\\engine.jar"); strcat(jarPath,"\\engine.jar");
strcat(jarPath,"\"");
logVar("javaPath: ",javaPath); logVar("javaPath: ",javaPath);
logVar("jarPath: ",jarPath); logVar("jarPath: ",jarPath);
printf("%s\n",jarPath); printf("%s\n",jarPath);
fflush(stdout); fflush(stdout);
execlp(javaPath,"java","-jar",jarPath, (char *)NULL); int execVal = execlp(javaPath,"java","-jar",jarPath, (char *)NULL);
printf("Exec code: %d\n",execVal);
perror("execlp");
fflush(stdout);
fflush(stderr);
return 0; return 0;
} }
@ -48,6 +55,14 @@ void redirectStdout(){
} }
dup2(outfd, 1); // replace stdout dup2(outfd, 1); // replace stdout
close(outfd); close(outfd);
int outerrfd = open("stderr.txt", O_CREAT|O_WRONLY|O_TRUNC, 0644);
if (!outerrfd)
{
printf("Error opening stdout redirect");
fflush(stderr);
}
dup2(outerrfd, fileno(stderr)); // replace stderr
close(outerrfd);
} }