store filename of modloader-dll in variable

This commit is contained in:
B͈̤̖̪̪̱ͅl̯̯̮̼͎̬͚̳̩̖̲u̜̼͉͈̠b͙̬̘̙̱̗̲͙b͍̞̬̬͓̼l̰̪͖̯̼̟̟͈̖͕̜̱̜ͅl̻̗͔̝̭̰͚͇̯̥ 2019-10-12 23:18:14 +02:00 committed by GitHub
parent f5797ac468
commit cb94d18dd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -12,6 +12,7 @@
#define MODLOADER_CRC 0x39D18E98 #define MODLOADER_CRC 0x39D18E98
char* CUBE_EXECUTABLE = "cubeworld.exe"; char* CUBE_EXECUTABLE = "cubeworld.exe";
char* MODLOADER_DLL = "CubeModLoader.dll";
using namespace std; using namespace std;
@ -65,19 +66,19 @@ int main(int argc, char** argv) {
} }
//Inject our dll //Inject our dll
if ( !FileExists("CubeModLoader.dll") ) { if ( !FileExists(MODLOADER_DLL) ) {
printf("CubeModLoader.dll not found.\n"); printf("%dll not found.\n", MODLOADER_DLL);
return Bail(1); return Bail(1);
} }
unsigned int loaderChecksum = crc32_file("CubeModLoader.dll"); unsigned int loaderChecksum = crc32_file(MODLOADER_DLL);
if (loaderChecksum != MODLOADER_CRC && !testMode) { if (loaderChecksum != MODLOADER_CRC && !testMode) {
printf("CubeModLoader.dll is the wrong version (%08X)\n", loaderChecksum); printf("%dll is the wrong version (%08X)\n", MODLOADER_DLL, loaderChecksum);
return Bail(1); return Bail(1);
} }
if (testMode) { if (testMode) {
printf("CubeModLoader.dll CRC: %08X\n", loaderChecksum); printf("%dll CRC: %08X\n", MODLOADER_DLL, loaderChecksum);
} }
Process process(CUBE_EXECUTABLE); Process process(CUBE_EXECUTABLE);
@ -91,7 +92,7 @@ int main(int argc, char** argv) {
printf("%s was successfully started.\n\n", CUBE_EXECUTABLE); printf("%s was successfully started.\n\n", CUBE_EXECUTABLE);
} }
process.InjectDLL( std::string("CubeModLoader.dll") ); process.InjectDLL( std::string(MODLOADER_DLL) );
// Need to give the loader some time to work // Need to give the loader some time to work
// This is a horrible thing and probably will result in a race condition please help me // This is a horrible thing and probably will result in a race condition please help me