-
Notifications
You must be signed in to change notification settings - Fork 58
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
Comments
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. 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. |
// 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');";
};
};
}; |
|
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
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.
The text was updated successfully, but these errors were encountered: