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

Add support for sending events to client IDs #340

Merged
merged 3 commits into from
Jun 2, 2016
Merged

Conversation

PabstMirror
Copy link
Contributor

No description provided.

@jonpas
Copy link
Member

jonpas commented May 26, 2016

Would this be better if incorporated into targetEvent rather?

@commy2
Copy link
Contributor

commy2 commented May 26, 2016

This has one problem. clientOwner reports totally wrong IDs in reloaded multiplayer games.

To solve this, I suggest the server publicVariableClient'ing the actual client id from a PlayerConnected mission event.

@PabstMirror
Copy link
Contributor Author

Now syncs clientID, probably needed to do anyway because clientOwner is 1.56.
We could merge this into targetEvent, but the way they work is quite different and I think it would get messy.
OwnerEvent can do client->client with no sqf running on server.

if (_owner != 2) then {
GVAR(clientID) = _owner;
_owner publicVariableClient QGVAR(clientID);
GVAR(clientID) = [0, 2] select isMultiplayer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable seems useful. Maybe name it "CBA_clientID" thereby make it "official" API, just like CBA_missionTime ?

TRACE_5("PlayerConnected eh",_id,_uid,_name,_jip,_owner);

if (_owner != 2) then {
CBA_clientID = _owner;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are PlayerConnected handlers executed in scheduled or unscheduled space? (If scheduled, I see a race condition with the CBA_clientID variable here)

@Killswitch00 Killswitch00 merged commit 3ceb602 into master Jun 2, 2016
@jonpas
Copy link
Member

jonpas commented Jun 2, 2016

I am still wondering why that's not incorporated into CBA_fnc_targetEvent. A simple type check, would make it much simpler to use.

@Killswitch00
Copy link
Contributor

Merge reverted - discussion on this PR had not finished yet. PabstMirror, please re-submit the function for further discussion.

@commy2 commy2 modified the milestone: 2.4.2 Jun 19, 2016
@commy2 commy2 modified the milestone: 2.4.2 Jul 10, 2016
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.

4 participants