Skip to content

Commit

Permalink
Fixed Custom Build Step not properly detecting changes in DLLs - the …
Browse files Browse the repository at this point in the history
…bin-vc14 folder should now always have up-to-date files after a build. Moved LoadSettings call to earlier than it previously was so that it precedes Startup plugin calls. Modified IniGetB to recognize both "true"/"false" and "yes"/"no".
  • Loading branch information
friendlyfire committed Jan 18, 2016
1 parent 6888891 commit 8ccae87
Show file tree
Hide file tree
Showing 37 changed files with 33 additions and 10 deletions.
Binary file modified bin-vc14/FLHook.dll
Binary file not shown.
Binary file modified bin-vc14/FLHook.pdb
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/ahookext.dll
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/ahookext.pdb
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/base.dll
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/base.pdb
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/cloak.dll
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/cloak.pdb
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/condata.dll
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/condata.pdb
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/conn.dll
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/conn.pdb
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/event.dll
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/event.pdb
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/minecontrol.dll
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/minecontrol.pdb
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/mobiledock.dll
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/mobiledock.pdb
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/playercntl.dll
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/playercntl.pdb
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/tempban.dll
Binary file not shown.
Binary file modified bin-vc14/flhook_plugins/tempban.pdb
Binary file not shown.
2 changes: 2 additions & 0 deletions plugins/base_plugin/Base Plugin.vc14.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins\$(TargetName).dll
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
Expand Down Expand Up @@ -101,6 +102,7 @@ copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;..\..\bin-vc14\flhook_plugins\$(TargetName).pdb;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand Down
2 changes: 2 additions & 0 deletions plugins/cloak_plugin/Cloak Plugin.vc14.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ copy /Y C:\Development\flhookplugin\trunk\plugins\flhookplugin_sdk\headers\*.h h
copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins\$(TargetName).dll
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
Expand Down Expand Up @@ -106,6 +107,7 @@ copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;..\..\bin-vc14\flhook_plugins\$(TargetName).pdb;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand Down
2 changes: 2 additions & 0 deletions plugins/condata/FLHook Example Plugin.vc14.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
copy /Y $(OutDir)$(TargetName).dll "C:\Program Files\Microsoft Games\Freelancer\EXE\flhook_plugins\$(TargetName).dll"
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
Expand Down Expand Up @@ -95,6 +96,7 @@ copy /Y $(OutDir)$(TargetName).dll "C:\Program Files\Microsoft Games\Freelancer
copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;..\..\bin-vc14\flhook_plugins\$(TargetName).pdb;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand Down
2 changes: 2 additions & 0 deletions plugins/conn_plugin/Conn Plugin.vc14.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
</Command>
<Outputs>C:\Development\flhookplugin\trunk\bin-vc14\flhook_plugins\$(TargetName).dll;C:\Discovery\FreelancerSDK\EXE\flhook_plugins\$(TargetName).dll;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
Expand Down Expand Up @@ -104,6 +105,7 @@ copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;..\..\bin-vc14\flhook_plugins\$(TargetName).pdb;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand Down
2 changes: 2 additions & 0 deletions plugins/event_plugin/Event Plugin.vc14.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;C:\Discovery\FreelancerSDK\EXE\flhook_plugins\$(TargetName).dll;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
Expand Down Expand Up @@ -101,6 +102,7 @@ copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;..\..\bin-vc14\flhook_plugins\$(TargetName).pdb;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand Down
Binary file modified plugins/flhookplugin_sdk/libs/FLHook-vc14.lib
Binary file not shown.
2 changes: 2 additions & 0 deletions plugins/hookext_plugin/HookExt Plugin.vc14.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ copy /Y C:\Development\flhookplugin\trunk\plugins\flhookplugin_sdk\headers\*.h h
copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
</Command>
<Outputs>C:\Development\flhookplugin\trunk\bin-vc14\flhook_plugins\$(TargetName).dll;C:\Discovery\FreelancerSDK\EXE\flhook_plugins\$(TargetName).dll;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
Expand Down Expand Up @@ -106,6 +107,7 @@ copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;..\..\bin-vc14\flhook_plugins\$(TargetName).pdb;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand Down
2 changes: 2 additions & 0 deletions plugins/minecontrol_plugin/MineControl Plugin.vc14.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;C:\Discovery\FreelancerSDK\EXE\flhook_plugins\$(TargetName).dll;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
Expand Down Expand Up @@ -103,6 +104,7 @@ copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;..\..\bin-vc14\flhook_plugins\$(TargetName).pdb;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;C:\Discovery\FreelancerSDK\EXE\flhook_plugins\$(TargetName).dll;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
Expand Down Expand Up @@ -104,6 +105,7 @@ copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;..\..\bin-vc14\flhook_plugins\$(TargetName).pdb;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins\$(TargetName).dll
</Command>
<Outputs>..\..\..\bin-vc14\flhook_plugins\$(TargetName).dll;C:\Discovery\FreelancerSDK\EXE\flhook_plugins\$(TargetName).dll;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
Expand Down Expand Up @@ -102,6 +103,7 @@ copy /Y $(OutDir)$(TargetName).dll C:\Discovery\FreelancerSDK\EXE\flhook_plugins
copy /Y $(OutDir)$(TargetName).pdb ..\..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\..\bin-vc14\flhook_plugins\$(TargetName).dll;..\..\..\bin-vc14\flhook_plugins\$(TargetName).pdb;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;__NOINCFLHOOKLIBS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
2 changes: 2 additions & 0 deletions plugins/tempban/Tempban Plugin.vc14.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
Expand Down Expand Up @@ -94,6 +95,7 @@ copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
copy /Y $(OutDir)$(TargetName).pdb ..\..\bin-vc14\flhook_plugins\
</Command>
<Outputs>..\..\bin-vc14\flhook_plugins\$(TargetName).dll;..\..\bin-vc14\flhook_plugins\$(TargetName).pdb;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<ExceptionHandling>Async</ExceptionHandling>
Expand Down
2 changes: 2 additions & 0 deletions project-vc14/FLHook.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ copy /Y $(OutDir)$(TargetName).lib ..\plugins\flhookplugin_sdk\libs\

</Command>
<Outputs>..\bin-vc14\$(TargetName).dll;..\plugins\flhookplugin_sdk\libs\$(TargetName).lib;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<AdditionalOptions>-D_SCL_SECURE_NO_WARNINGS %(AdditionalOptions)</AdditionalOptions>
Expand Down Expand Up @@ -98,6 +99,7 @@ copy /Y $(OutDir)$(TargetName).pdb ..\bin-vc14\
copy /Y $(OutDir)$(TargetName).lib ..\plugins\flhookplugin_sdk\libs\$(TargetName)-vc14.lib
</Command>
<Outputs>..\bin-vc14\$(TargetName).dll;..\plugins\flhookplugin_sdk\libs\$(TargetName).lib;%(Outputs)</Outputs>
<Inputs>$(OutDir)$(TargetName).dll</Inputs>
</CustomBuildStep>
<ClCompile>
<AdditionalOptions>-D_SCL_SECURE_NO_WARNINGS %(AdditionalOptions)</AdditionalOptions>
Expand Down
2 changes: 1 addition & 1 deletion project-vc14/FLHook.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,6 @@
</Text>
</ItemGroup>
<ItemGroup>
<None Include="..\bin-vc12\FLHook.ini" />
<None Include="..\bin-vc14\FLHook.ini" />
</ItemGroup>
</Project>
16 changes: 8 additions & 8 deletions source/FLHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ void FLHookInit_Pre()
}
#endif

// load settings
LoadSettings();

if (set_bDebug && !fLogDebug)
fLogDebug = fopen(sDebugLog.c_str(), "at");

CALL_PLUGINS_NORET(PLUGIN_LoadSettings, , (), ());

} catch(char *szError) {
ConPrint(L"CRITICAL ERROR: %s\n", stows(szError).c_str());
exit(EXIT_FAILURE);
Expand Down Expand Up @@ -312,14 +320,6 @@ bool FLHookInit()
throw "content.dll not loaded";
if(!(hMe = GetModuleHandle("FLHook")))
throw "FLHook.dll not loaded";

// load settings
LoadSettings();

if (set_bDebug && !fLogDebug)
fLogDebug = fopen(sDebugLog.c_str(), "at");

CALL_PLUGINS_NORET(PLUGIN_LoadSettings, , (), ());

// init hooks
if(!InitHookExports())
Expand Down
3 changes: 2 additions & 1 deletion source/Tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ float IniGetF(const string &scFile, const string &scApp, const string &scKey, fl

bool IniGetB(const string &scFile, const string &scApp, const string &scKey, bool bDefault)
{
return ToLower(IniGetS(scFile, scApp, scKey, bDefault ? "yes" : "no")).compare("yes") == 0 ? true : false;
string val = ToLower(IniGetS(scFile, scApp, scKey, bDefault ? "true" : "false"));
return val.compare("yes") == 0 || val.compare("true") == 0 ? true : false;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 8ccae87

Please sign in to comment.