Lib-Loader v1.3.1.5
Refactored Core_LibLoader for improved file search, loading, and compatibility checks.
-
Removed WriteLog Function:
- Eliminated the
WriteLogfunction asCore_Logunit is imported for theLogclass. - Ensured all logging operations use the
Logclass directly.
- Eliminated the
-
Improved Recursive File Loading:
- Added
LoadFileFromFoldernested procedure withinLibLoader.Executeto handle file loading from a specified folder. - Ensured proper logging for each step in the recursive file search.
- Tracked successfully loaded files using a new
FilesLoadedlist.
- Added
-
Enhanced Error Handling:
- Logged errors for files not found in both mod directories and application/client directory.
- Prevented duplicate entries in the
FailedFileslist by checking if the file already exists in the list before adding. - Removed files from
FailedFilesif they were successfully loaded from the application/client directory.
-
Unified Loaded Files Tracking:
- Introduced a
FilesLoadedTStringList to maintain a list of all successfully loaded files across both the recursive search and application/client directory search. - Ensured
FilesLoadedis updated immediately when a file is successfully loaded from any directory. - Added checks to prevent duplicates in the
FilesLoadedlist.
- Introduced a
-
Managed TStringList Lifecycle:
- Created and properly freed all TStringLists (
ModFolders,FailedFiles,FilesToProcess,FilesToRemove,FilesLoaded) to avoid memory leaks and ensure stability. - Cleared
FilesToRemovebefore each new directory search to prevent carrying over entries.
- Created and properly freed all TStringLists (
-
General Code Cleanup:
- Improved readability and maintainability by organizing the code into nested procedures and clearly commenting on each significant operation.
- Removed redundant log messages and ensured consistency in logging format.
-
Bug Fixes:
- Fixed issue where files could be skipped or incorrectly removed during the search process.
- Ensured the application does not crash when accessing
Files2Load.CommaTextby checkingFiles2Load.Countbefore accessing it. - Ensured accurate reporting of loaded and failed files at the end of the operation.
- Fixed issue where
FilesLoadedlist had duplicate entries by checking for duplicates before adding.
-
Improved
LibLoader.WhereIsFunction:- Refactored
LibLoader.WhereIsto recursively search for a file in specified directories. - Added appropriate comments for better understanding and maintenance.
- Ensured proper returning of the result after the recursive search is complete.
- Refactored
-
Commented Code for Better Understanding:
- Added comments to all major code sections and procedures to explain their functionality and flow.
- Provided detailed comments in
LibLoader.ExecuteandLibLoader.WhereIsfunctions.
-
New Usage of Core_Log Unit:
- Utilized the
Core_Logunit for logging operations throughout the unit. - Ensured consistent logging format and levels using the
Logclass fromCore_Log.
- Utilized the
-
Compatibility Checks:
- Added checks to ensure DLL compatibility with the host architecture (x86/x64).
- Ensured only compatible DLLs are loaded to prevent runtime errors.