MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / Step4

Method Step4

editor/ScriptMassCompile.cpp:529–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527bool CheckInGamefile(char *tempbuffer, bool giveok);
528bool AddNewGameFile(char *fullpath, char *directory);
529bool CScriptMassCompile::Step4(char *filename) {
530 if (!Network_up) {
531 SetStepText(4, "Skipping, Network 'Down'");
532 writeline("Step 4: Skipping, Due to the NO on data update");
533 return false;
534 }
535
536 if (!m_AutoCheckIn) {
537 SetStepText(4, "Skipping, Auto Checkin box not set");
538 writeline("Step 4: Skipping, Auto Checkin box not set");
539 return false;
540 }
541
542 char source_filename[_MAX_PATH], compiled_filename[_MAX_PATH];
543
544 // make the locker
545 if (!mng_MakeLocker()) {
546 SetStepText(4, "Unable to create locker, can't check in");
547 writeline("Step 4: Can't make locker file, skipping check in");
548 return false;
549 }
550
551 // make real filenames
552 strcpy(source_filename, filename);
553 strcpy(compiled_filename, filename);
554 strcat(source_filename, ".cpp");
555 strcat(compiled_filename, ".dll");
556
557 bool ntci_source = false, ntci_compiled = false;
558 int i;
559
560 for (i = 0; i < MAX_GAMEFILES; i++) {
561 if (Gamefiles[i].used) {
562 if (!ntci_source && !stricmp(Gamefiles[i].name, source_filename) &&
563 (mng_FindTrackLock(source_filename, PAGETYPE_GAMEFILE) != -1)) {
564 ntci_source = true;
565 }
566 if (!ntci_compiled && !stricmp(Gamefiles[i].name, compiled_filename) &&
567 (mng_FindTrackLock(source_filename, PAGETYPE_GAMEFILE) != -1)) {
568 ntci_compiled = true;
569 }
570 }
571 if (ntci_source && ntci_compiled)
572 break;
573 }
574
575 if (!ntci_source && !ntci_compiled) {
576 SetStepText(4, "Skipping, files not checked out");
577 writeline("Step 4: Skipping because both source and compiled are not checked out or not in the manage system");
578 mng_EraseLocker();
579 return false;
580 }
581
582 // check to make sure the compiled version exists
583 if (!cfexist(compiled_filename)) {
584 writeline("Step 4: %s does not exist...possibly due to compilation errors", compiled_filename);
585 writeline("Step 4: Aborting check in");
586 SetStepText(4, "Aborted");

Callers

nothing calls this directly

Calls 8

writelineFunction · 0.85
mng_MakeLockerFunction · 0.85
mng_FindTrackLockFunction · 0.85
mng_EraseLockerFunction · 0.85
cfexistFunction · 0.85
AddNewGameFileFunction · 0.85
CheckInGamefileFunction · 0.85
ddio_MakePathFunction · 0.50

Tested by

no test coverage detected