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

Remove XEH eventhandlers #186

Open
dedmen opened this issue Dec 1, 2017 · 3 comments
Open

Remove XEH eventhandlers #186

dedmen opened this issue Dec 1, 2017 · 3 comments

Comments

@dedmen
Copy link
Member

dedmen commented Dec 1, 2017

If we remove the XEH eventhandlers:
https://github.com/intercept/intercept/blob/master/rv/addons/core/config.cpp#L904-L939
https://github.com/intercept/intercept/blob/master/src/client/headers/intercept.hpp#L28-L71
We can move pre/postInit/preStart (https://github.com/intercept/intercept/blob/master/rv/addons/core/config.cpp#L961-L978) to cfgFunctions.

That way we can get rid of the CBA dependency.
The only problem is https://github.com/intercept/intercept/blob/master/rv/addons/core/config.cpp#L980-L984
I don't see a alternative to that without CBA.

The problem is that you can't use Intercept only on the Server backend. Because you require CBA. Which enforces itself to be installed on all clients.

This would also remove most of the global event functions in Intercept. Which is a good thing because right now we are hooking every event even though no-one wants it and create a potential perf problem.
You can use the new eventhandler system and dynamically add the eventhandlers at preInit. Which is also easier to use because you can add eventhandlers to a specific object instead of using the XEH on all objects and then filtering on the right object.

Ofcause XEH is nice to have in some situations. We can also make a optional addon that adds the XEH eh's and leave the functions in Intercept. But that might confuse people why these functions never fire...

for the versioning check I can just disable the postInitServer with a config patch. That removes the warnings.
https://github.com/CBATeam/CBA_A3/blob/master/addons/versioning/CfgEventHandlers.hpp#L16

Commy: The setting thing uses create simple object, and that class would be unknown to the clients.
That might be a problem. We could overwrite createNamespace to always create local thingies

If we can just make CBA server-side only we wouldn't have any problem.. and could keep the XEH's.
The real problem is only that clients are forced to have CBA if the server runs it.

@dedmen
Copy link
Member Author

dedmen commented Dec 1, 2017

We can push this back till we have a official Intercept CBA plugin. Then we can just move the XEH's into the Plugin. But we need some solution for the mission_ended EH. We are waiting for unload of the mission display. We can't modify it's displayUnload because that could cause problems.
Can we just add a invisible UI element to the mission display and use it's onUnload?

Commy says that should work. Add a control with onUnload and have it be invisible. That will replace our mission_ended so the last hurdle is solved.

@commy2
Copy link

commy2 commented Dec 2, 2017

// reqAdd: "A3_Ui_F"
class RscText;

class RscDisplayEmpty {
    class controls;
};

class RscDisplayMission: RscDisplayEmpty {
    class controls: controls {
        class Intercept_MissionEnded: RscText {
            onUnload = "['mission_ended', []] call (uiNamespace getVariable 'intercept_fnc_event');";
        };
    };
};

@dedmen
Copy link
Member Author

dedmen commented Dec 31, 2017

The real problem is only that clients are forced to have CBA if the server runs it.

CBATeam/CBA_A3#866

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

2 participants