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

FIX: CBA_fnc_deleteEntity looping over network and kill dedicated server #940

Merged
merged 3 commits into from
Jun 30, 2018
Merged

FIX: CBA_fnc_deleteEntity looping over network and kill dedicated server #940

merged 3 commits into from
Jun 30, 2018

Conversation

Vdauphin
Copy link
Contributor

@Vdauphin Vdauphin commented Jun 23, 2018

When a unit is created inside a group, the group locality isn't immediately the same as the unit. It is 0, which mean the CBA_fnc_deleteEntity is remoteExecCall to every client. So because the unit is only local to server or one client, all others clients will remeteExecCall again the CBA_fnc_deleteEntity to server because groupOwner can only be tested on it. So the remote execution is starting to loop between all client and server, until the groupOwner return a real client (not 0).

Code testing the groupOwner command (executed server side in debug console):

private _group = createGroup west;
_group createUnit ["B_officer_F", [0, 0, 0], [], 0, "CARGO"];
diag_log format ["Locality test without delay: isLocalUnit %1, groupOwner %2", local ((units _group) select 0), groupOwner _group];
//_group call CBA_fnc_deleteEntity;
[{
	params ["_args"];
	diag_log format ["Locality test with delay: isLocalUnit %1, groupOwner %2", local ((units _args) select 0), groupOwner _args];
}, _group, 2] call CBA_fnc_waitAndExecute;

Returned:

12:56:54 "Locality test without delay: isLocalUnit true, groupOwner 0"
12:56:56 "Locality test with delay: isLocalUnit true, groupOwner 2"

This loop can dramatically kill the network (>500kbits) and the dedicated server FPS.
20180617180828_1

When merged this pull request will:

- when a unit is created inside a group, the group locality isn't immediately the same as the unit. It is 0 which mean the `remoteExecCall`  to every client the execution of `CBA_fnc_deleteEntity`. So because the unit is only local  to server or one client, all others clients will `remeteExecCall` again the `CBA_fnc_deleteEntity`. So a remote execution is starting.
To prevent that the `CBA_fnc_deleteEntity` execution is waiting until the groupOwner is correct (not 0)
@dedmen
Copy link
Contributor

dedmen commented Jun 23, 2018

Worst CBA bug this decade ^^

@commy2 commy2 added the Bug Fix label Jun 25, 2018
@commy2 commy2 added this to the 3.8 milestone Jun 25, 2018
@commy2 commy2 self-assigned this Jun 25, 2018
@commy2
Copy link
Contributor

commy2 commented Jun 30, 2018

Minor fix. Quit loop should entity become null by other means instead of looping endlessly.

@commy2 commy2 merged commit befb2f6 into CBATeam:master Jun 30, 2018
@Vdauphin Vdauphin deleted the FIX-groupowner branch June 30, 2018 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants