Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to overwrite function compiled by CBA while using cba_cache_disable.pbo #788

Closed
JonBons opened this issue Oct 25, 2017 · 6 comments
Closed
Assignees

Comments

@JonBons
Copy link
Contributor

JonBons commented Oct 25, 2017

Arma 3 Version: stable 1.76.143187 64bit
CBA Version: dev + 62e38fb64a093d39c093b86368c0c9a4ce6fe905

Mods:

- CBA_A3

Description:

  • Unable to overwrite function compiled (PREP/CBA_fnc_compileFunction) by CBA while using cba_cache_disable.pbo. After reviewing the current version of CBA_fnc_compileFunction it appears this line should've been changed to use compile instead of compileFinal https://github.com/CBATeam/CBA_A3/blob/master/addons/xeh/fnc_compileFunction.sqf#L34 although I'm not sure is problem as I'm not too familiar with this code. I also feel that I should be able to disable the compileFinal calls without completely disabling the function caching feature, that being said I could resolve that on my own by making my own pbo that changes the CfgSettings >> CBA >> Caching >> compile value to 0 without messing with any of the other variables. What I am attempting to do is build an addon that overwrites some internal functions inside of ACE3 but due to ACE3's use of CBA_fnc_compileFunction I am unable to change the function.

Steps to reproduce:

  • Added cba_cache_disable.pbo to cba addons and verified CfgSettings >> CBA >> Caching values reflecting changes made by pbo.

  • Created a new singleplayer mission, placed Rifleman unit down and started mission preview.

  • Opened escape menu and started typing in required variables for test scenario

  • Added the following to the watch variable boxes

    • dev_fnc_testFunc
    • uiNamespace getVariable "dev_fnc_testFunc"
    • missionNamespace getVariable "dev_fnc_testFunc"
  • Ran the following code via Local exec button

    • ["A3\ui_f\scripts\IGUI\RscUnitInfo.sqf", "dev_fnc_testFunc"] call CBA_fnc_compileFunction
  • Reviewed updated watch fields and noted that all watched variables contain:

    • #line 1 "A3\ui_f\scripts\IGUI\RscUnitInfo.sqf" which is the correct script
  • Ran the following code via Local exec button

    • ["\A3\ui_f\scripts\pauseLoadinit.sqf", "dev_fnc_testFunc"] call CBA_fnc_compileFunction
  • Reviewed updated watch fields and noted that all watched variables contain:

    • #line 1 "A3\ui_f\scripts\IGUI\RscUnitInfo.sqf" which is the same as before and is not desired
  • I also attempted to do a variable overwrite and the change did not apply

    • dev_fnc_testFunc = compile preprocessFileLineNumbers "\A3\ui_f\scripts\pauseLoadinit.sqf"
  • After reviewing RPT log I see multiple entries of:

    • Attempt to override final function - dev_fnc_testfunc

Where did the issue occur?

  • Self-Hosted Multiplayer / Singleplayer / Editor (Singleplayer) / Editor (Multiplayer)

RPT log file:

@PabstMirror
Copy link
Contributor

Normal:
First run compileFinal's to uiNamespace
all further runs use uNamespace version for missionNamespace (which inheritis the compileFinal)

Cache Disabled:
compileFinal's to missionNamespace each restart

So, do we want a 3rd setting that does not compileFinal at all?

@JonBons
Copy link
Contributor Author

JonBons commented Oct 25, 2017

Yes. In the scenario that I'm in I would like to be able to overwrite functions that are created in overpressure ACE3 addon without having to remove the existing pbo and create a copy and have to maintain version numbers and such without loosing the performance gain from caching.

@PabstMirror
Copy link
Contributor

could hack in functions with something like this, define your funcs before ace runs

requiredAddons = {"ace_overpressure"};

class Extended_PreInit_EventHandlers {
    class ace_overpressure {
        init = "myInit.sqf";
               
myInit.sqf:
["myX", "ace_overpressure_fnc_x"] call CBA_fnc_compileFunction;
call compile preprocessFileLineNumbers "z\ace\addons\overpressure\XEH_PReInit.sqf";

@commy2
Copy link
Contributor

commy2 commented Oct 25, 2017

Yes. In the scenario that I'm in I would like to be able to overwrite functions that are created in overpressure ACE3 addon without having to remove the existing pbo and create a copy and have to maintain version numbers and such without loosing the performance gain from caching.

That is not what disabling the compile cache is for. It's for debugging.

@commy2
Copy link
Contributor

commy2 commented Nov 14, 2017

Close?

@JonBons
Copy link
Contributor Author

JonBons commented Nov 16, 2017

I believe PabstMirror's solution will work for what I am attempting.

@JonBons JonBons closed this as completed Nov 16, 2017
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

No branches or pull requests

3 participants