Skip to content

add support for relative config.yaml path#37

Open
RedMetalizer wants to merge 3 commits intointercept:masterfrom
RedMetalizer:master
Open

add support for relative config.yaml path#37
RedMetalizer wants to merge 3 commits intointercept:masterfrom
RedMetalizer:master

Conversation

@RedMetalizer
Copy link
Copy Markdown

Added support for a relative config.yaml file in relation to the intercept-database_x64.dll. Now, you can rename the @InterceptDB folder, and the config.yaml file will still be loaded.

@RedMetalizer
Copy link
Copy Markdown
Author

I've enhanced the system by implementing improved log file management. With this update, a new log file is created each time the server starts, and any logs older than 10 days are automatically deleted.

@dedmen
Copy link
Copy Markdown
Member

dedmen commented May 6, 2026

Dude 😢
My GitHub notifications are spammed full of garbage, only way I notice is if someone pings me about a PR or I discover it by accident :/

@dedmen
Copy link
Copy Markdown
Member

dedmen commented May 6, 2026

GitHub is having an outage. Here have my review


Needs changes:
https://github.com/intercept/intercept-database/pull/37/changes/BASE..e884fc2a624c103074e2fe5e26603ccbdbeef26d#diff-6b2f0a449fdefd8930e23ef0dcd752beec69242e1303d77653f047c5e0766385R5
Blocker. The rest of the code is linux-compatible. This would break that.
Other places in code wrapped windows-specific code in #ifdef _MSVC_LANG which is not really the proper macro to check for, but works.


Needs Changes:
https://github.com/intercept/intercept-database/pull/37/changes#diff-6b2f0a449fdefd8930e23ef0dcd752beec69242e1303d77653f047c5e0766385R57
This fails to handle when the path is longer than MAX_PATH.
if return value == sizeof(path), we failed and the string was truncated, which is invalid result too.
In that case we should either retry with a bigger buffer until its okey, or just error out, which would be fine by me too.

But returning success when we failed is wrong.

I found the StackOverflow post
https://stackoverflow.com/questions/6924195/get-dll-path-at-runtime
I also looked at how I did it in my other projects, and I failed there too

https://github.com/dedmen/PboExplorer/blob/master/src/Util.ixx#L320
https://github.com/dedmen/ArmaWebControl/blob/6897fee28fe9015d539a6ab1f5e4278a09b0d511/src/websocket.cpp#L190
https://github.com/dedmen/WolfCorpsToast/blob/ae8deefe468e1a93ab5dedda5ef0ec3d43ccc58e/src/toast.cpp#L114
https://github.com/dedmen/WolfCorpsToast/blob/ae8deefe468e1a93ab5dedda5ef0ec3d43ccc58e/src/main.cpp#L66
https://github.com/dedmen/PboExplorer/blob/44b9179e67829b053b1a6467834c293030475a0c/src/util/DebugLogger.ixx#L659

I did it wrong in all my projects too... I have some fixing to be done :/

Here is an example of it done right
https://github.com/dedmen/interceptTest/blob/abfda3b1b7b2aa04735728b07a06083de8a24b4c/interceptTest/lua/loadlib.c#L172
https://github.com/wolfpld/tracy/blob/8c2a970222529417871c15791c0d5acb22faf946/public/client/TracyCallstack.cpp#L659


Comment:
https://github.com/intercept/intercept-database/pull/37/changes/BASE..e884fc2a624c103074e2fe5e26603ccbdbeef26d#diff-2c46dd80094c3ffd00cd309628cb1d6e5c695f69f8dafb5c40747369a5d6ded0R58
std::format would probably be preferred, it should do this in one allocation instead of two.
Doesn't matter though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants