Jump to content
Sign in to follow this  
brainslush

BIS_FNC_MP with receiver == sender question

Recommended Posts

I assume that the bis_fnc_mp function doesn't have any client to client functionality and always is broadcasted to the server and then distributed to the respective receiver. Does by any chance someone know what happens when the sender is also the receiver? Does it get broadcasted to the server and then back to the client or does it cause the function to get executed immediately on the sender's machine?

Thanks

Share this post


Link to post
Share on other sites
Description:

Send function for remote execution (and executes locally if conditions are met)

Hope that helps! :)

Share this post


Link to post
Share on other sites

Yea, it's always send to the server first, to decide. (publicVariableServer)

BIS_fnc_MP_packet = [0,_params,_functionName,_target,_isPersistent,_isCall];
publicvariableserver "BIS_fnc_MP_packet";

If server is receiver, nothing is send across the network.

If one specific client is receiver it's redistributed via publicVariableClient.

If all clients are receiver it's redistributed via publicVariable.

if (_ownerID < 0) then {
//--- Everyone
publicvariable "BIS_fnc_MP_packet";
} else {
if (_ownerID != _serverID) then {
	//--- Client
	_ownerID publicvariableclient "BIS_fnc_MP_packet";
};
};

Edited by sxp2high

Share this post


Link to post
Share on other sites

Oh wow...I just read the header, you're right. That's a little deceptive.

//--- Local execution
if !(ismultiplayer) then {
	["BIS_fnc_MP_packet",BIS_fnc_MP_packet] spawn BIS_fnc_MPexec;
};

I guess that's the extent of "executes locally if conditions are met".

Share this post


Link to post
Share on other sites
Oh wow...I just read the header, you're right. That's a little deceptive.

//--- Local execution
if !(ismultiplayer) then {
	["BIS_fnc_MP_packet",BIS_fnc_MP_packet] spawn BIS_fnc_MPexec;
};

I guess that's the extent of "executes locally if conditions are met".

You could probably just copy the code out of the function then put it inside a script, change what you want, then use cfgFunctions to add it back into the game inside a mission. Then you'd just call what you named the function instead of BI's version.

Share this post


Link to post
Share on other sites

I found the answer a bit later by my self in the function viewer and came to the same conclusion. Forgot to look it up there b/c I didn't expect bis_fnc_mp to be in there. But thanks for confirming my findings.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×