722 |
|
|
723 |
|
|
724 |
|
|
725 |
< |
ofstream BSLlog("BSL.log"); |
725 |
> |
|
726 |
|
|
727 |
|
vector<string> BSLfolders; |
728 |
|
vector<string> skippedfolders; |
729 |
|
|
730 |
|
|
731 |
< |
|
731 |
> |
ofstream BSLlog("BSL.log"); |
732 |
|
for ( directory_iterator dir_itr( "../GameDataFolder/IGMD/" ), end_itr; |
733 |
|
dir_itr != end_itr; |
734 |
|
++dir_itr ) { |
741 |
|
for (int i = installedMods.size() - 1; i >= 0; i--) { //Iterates through the installed mods (backwards :P) |
742 |
|
for (unsigned int j = 0; j < globalPackages.size(); ++j) { //looking in the global packages |
743 |
|
if (globalPackages[j].modStringName == installedMods[i]) { //for a mod that has BSL in it |
744 |
< |
BSLlog << "Testing " << globalPackages[j].modStringName << "\n" |
744 |
> |
/*BSLlog << "Testing " << globalPackages[j].modStringName << "\n" |
745 |
|
<< "HasBSL: " << globalPackages[j].hasBSL << "\n" |
746 |
< |
<< "HasAddon: " << globalPackages[j].hasAddon << "\n"; |
746 |
> |
<< "HasAddon: " << globalPackages[j].hasAddon << "\n";*/ |
747 |
|
if(!(globalPackages[j].hasAddon || globalPackages[j].hasBSL)) break; //skip non-BSL |
748 |
< |
if( exists( "packages/" + globalPackages[j].modStringName + "/BSL" ) ) |
748 |
> |
if( exists( "packages/" + globalPackages[j].modStringName + "/BSL/" ) ) { |
749 |
|
copyBSL("packages/" + globalPackages[j].modStringName + "/BSL", BSLfolders, globalPackages[j] ); |
750 |
+ |
BSLlog << "Copied " << globalPackages[j].modStringName << "!\n"; |
751 |
+ |
} |
752 |
+ |
|
753 |
|
} |
754 |
|
|
755 |
|
} |
756 |
|
} |
757 |
|
|
758 |
|
ModPackage emptyPackage; |
759 |
+ |
emptyPackage.modStringName = "VanillaBSL"; |
760 |
+ |
emptyPackage.hasBSL = 1; |
761 |
|
copyBSL("packages/VanillaBSL/IGMD", BSLfolders, emptyPackage); |
762 |
|
BSLlog.close(); |
763 |
|
|
768 |
|
|
769 |
|
string finallyDone = "Done! You can now play Oni."; |
770 |
|
|
771 |
< |
a |
771 |
> |
|
772 |
|
|
773 |
|
setStatusArea(finallyDone); |
774 |
|
|
802 |
|
busy = 0; |
803 |
|
} |
804 |
|
|
805 |
< |
void copyBSL(string copypath, vector<string> BSLfolders, ModPackage pkg) { |
805 |
> |
void copyBSL(string copypath, vector<string>& BSLfolders, ModPackage pkg) { |
806 |
> |
|
807 |
> |
ofstream BSLlog("BSL2.log", ios::app ); |
808 |
> |
|
809 |
|
try { |
810 |
|
for ( directory_iterator dir_itr( copypath ), end_itr; |
811 |
|
dir_itr != end_itr; |
812 |
|
++dir_itr ) { |
813 |
|
|
814 |
|
if ( is_directory( dir_itr->path() ) && dir_itr->path().string() != ".svn" ) { |
815 |
+ |
BSLlog << "Testing " << dir_itr->path().string() << " HasBSL: " << pkg.hasBSL << " HasAddon: " << pkg.hasAddon << "\n"; |
816 |
|
int skip_folder = 0; |
817 |
+ |
|
818 |
|
for(unsigned int k = 0; k < BSLfolders.size(); k++) {//iterate through already found BSL folders |
819 |
+ |
BSLlog << "testing " << dir_itr->path().filename() << " vs " << BSLfolders[k] << "\n"; |
820 |
|
if(dir_itr->path().filename() == BSLfolders[k]) { |
821 |
< |
skip_folder = 1; |
821 |
> |
skip_folder = 1; |
822 |
> |
BSLlog << "skipping " << BSLfolders[k] << " in " << pkg.modStringName << "\n"; |
823 |
|
break; |
824 |
|
} |
825 |
|
} |
827 |
|
remove_all( "../GameDataFolder/IGMD/" + dir_itr->path().filename() ); |
828 |
|
Sleep(100); |
829 |
|
create_directory( "../GameDataFolder/IGMD/" + dir_itr->path().filename()); |
830 |
< |
|
830 |
> |
BSLlog << "Copied " << dir_itr->path().string() << " in " << pkg.modStringName << "!\n"; |
831 |
|
for ( directory_iterator bsl_itr( dir_itr->path() ); |
832 |
|
bsl_itr != end_itr; |
833 |
|
bsl_itr++ ) { |
835 |
|
copy_file(bsl_itr->path(), "../GameDataFolder/IGMD/" + dir_itr->path().filename() + "/" + bsl_itr->path().filename()); |
836 |
|
} |
837 |
|
} |
838 |
< |
BSLfolders.push_back( dir_itr->path().filename() ); |
838 |
> |
BSLfolders.push_back( dir_itr->path().filename() ); //add back check for addon |
839 |
> |
BSLlog << "Pushing " << dir_itr->path().filename() << "\n" ; |
840 |
|
} |
841 |
|
} |
842 |
|
} |
846 |
|
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
847 |
|
while(1) Sleep(1000); |
848 |
|
} |
849 |
< |
|
849 |
> |
BSLlog.close(); |
850 |
> |
|
851 |
|
} |
852 |
< |
|
853 |
< |
|
852 |
> |
|
853 |
> |
|
854 |
|
void writeInstalledMods(vector<string> installedMods) |
855 |
|
{ |
856 |
|
|