DarkflameUniverse / DarkflameServer

The main repository for the Darkflame Universe Server Emulator project.
https://www.darkflameuniverse.org/
GNU Affero General Public License v3.0
639 stars 172 forks source link

chore: CppScripts Cleanup #1571

Closed TAHuntling closed 3 months ago

TAHuntling commented 3 months ago

Fixes #1511 Desc: Changed the CppScripts file to use a lambda map to load scripts rather than the if else chain. This should make it easier to make future changes as well as reduce code size (especially with an issue with number of if-else statements for some operating machines).

Motivation: Received notice of the issue from a head developer

Type of Changes: Made changes to the CppScripts main file, which now use a lambda. Made a few comment changes but tried to keep all original comments. Overall file lines reduced drastically.

How Has This Been Tested?: Emosewamc helped write a test file which we used to verify the scripts between the old scripts and new script changes. It returned successful tests when running ctest in the /build directory

EmosewaMC commented 3 months ago

Issue #1511 Change this to Fixes #1511 so the issue is automatically marked as closed

EmosewaMC commented 3 months ago

Please also format your files before commiting with alt+shift+f in VSCode or your preferred editor

aronwk-aaron commented 3 months ago

You don't need to close this PR and open a new one, pushing to your branch will add changes to it