diff --git a/addons/network/CfgFunctions.hpp b/addons/network/CfgFunctions.hpp index 2ba50c3be..559e6799c 100644 --- a/addons/network/CfgFunctions.hpp +++ b/addons/network/CfgFunctions.hpp @@ -9,12 +9,6 @@ class CfgFunctions { class Network { - // CBA_fnc_getMarkerPersistent - class getMarkerPersistent - { - description = "Checks if a global marker is persistent for JIP players."; - file = "\x\cba\addons\network\fnc_getMarkerPersistent.sqf"; - }; // CBA_fnc_globalExecute class globalExecute { @@ -39,12 +33,6 @@ class CfgFunctions description = "CBA_fnc_publicVariable does only broadcast the new value if it doesn't exist in missionNamespace or the new value is different to the one in missionNamespace. Checks also for different types. Nil as value gets always broadcasted."; file = "\x\cba\addons\network\fnc_publicVariable.sqf"; }; - // CBA_fnc_setMarkerPersistent - class setMarkerPersistent - { - description = "Sets or unsets JIP persistency on a global marker."; - file = "\x\cba\addons\network\fnc_setMarkerPersistent.sqf"; - }; // CBA_fnc_setVarNet class setVarNet { diff --git a/addons/network/XEH_preInit.sqf b/addons/network/XEH_preInit.sqf index b85d199bf..5cf48f000 100644 --- a/addons/network/XEH_preInit.sqf +++ b/addons/network/XEH_preInit.sqf @@ -49,25 +49,15 @@ ISNIL(weatherSync_Disabled,true); DEPRECATE(fnc_remoteExecute,fnc_globalExecute); DEPRECATE(fnc_remoteSay,fnc_globalSay); - -#define ADD_PERSISTENT_MARKER { [_this select 0, true] call (uiNamespace getVariable "CBA_fnc_setMarkerPersistent") } -OBSOLETE(fnc_addPersistentMarker,ADD_PERSISTENT_MARKER); -#define REMOVE_PERSISTENT_MARKER { [_this select 0, false] call (uiNamespace getVariable "CBA_fnc_setMarkerPersistent") } -OBSOLETE(fnc_removePersistentMarker,REMOVE_PERSISTENT_MARKER); - // TODO: Add functions that add to opc/opd, instead of direct handling? if (SLX_XEH_MACHINE select 3) then { - ISNIL(MARKERS,[]); // Sync Markers for JIP - PREP(opc); PREP(opd); PREP(sync); FUNC(id) = { "server" }; - [QUOTE(GVAR(marker_persist)), { _this call (uiNamespace getVariable "CBA_fnc_setMarkerPersistent") }] call (uiNamespace getVariable "CBA_fnc_addEventHandler"); - // [QGVAR(join), { [QGVAR(opc), _this] call CBA_fnc_localEvent }] call CBA_fnc_addEventHandler; // onPlayerConnected '[_name,_id] call FUNC(opc)'; diff --git a/addons/network/fnc_getMarkerPersistent.sqf b/addons/network/fnc_getMarkerPersistent.sqf deleted file mode 100644 index 26f02a52d..000000000 --- a/addons/network/fnc_getMarkerPersistent.sqf +++ /dev/null @@ -1,42 +0,0 @@ -/* -Function: CBA_fnc_getMarkerPersistent - -Description: - Checks if a global marker is persistent for JIP players. - - Always returns false unless called on the server. - - Set/unset persistency with . - -Parameters: - _marker - Name of a marker [String] - -Returns: - True if the marker is persistent. False if not persistent or if executed - on a dedicated client [Boolean] - -Example: - (begin example) - _isPersistent = ["TAG_fishingVillage"] call CBA_fnc_getMarkerPersistent; - (end) - -Author: - Spooner -*/ -#include "script_component.hpp" - -params ["_marker"]; -TRACE_1(_this); - -private ["_markerConsistent", "_return"]; -_markerConsistent = toLower _marker; // Ensure we use a consistent name to search for. - -_return = if (SLX_XEH_MACHINE select 3) then -{ - _markerConsistent in GVAR(MARKERS); -} else { - WARNING("Function ran on a dedicated client. Function only usable on a server for marker: " + str _marker); - false; -}; - -_return; diff --git a/addons/network/fnc_opc.sqf b/addons/network/fnc_opc.sqf index 17bd2c318..1a4ed89b1 100644 --- a/addons/network/fnc_opc.sqf +++ b/addons/network/fnc_opc.sqf @@ -12,6 +12,6 @@ if ((_name!= "__SERVER__") && {(_name!= format["%1", _plName])}) then { if (time > 0) then { - [_obj] call FUNC(sync); { _x setMarkerPos (getMarkerPos _x) } forEach GVAR(markers); + [_obj] call FUNC(sync); }; }; diff --git a/addons/network/fnc_setMarkerPersistent.sqf b/addons/network/fnc_setMarkerPersistent.sqf deleted file mode 100644 index 6fa64c2e0..000000000 --- a/addons/network/fnc_setMarkerPersistent.sqf +++ /dev/null @@ -1,66 +0,0 @@ -/* -Function: CBA_fnc_setMarkerPersistent - -Description: - Sets or unsets JIP persistency on a global marker. - - Will broadcast event to server, if function is called on a client - - Query persistency with . - - Please note, this function currently only fully works with markers created on the server, - due to client markers being deleted when the client disconnects. - -Parameters: - _marker - Name of a marker [String] - _persistent - If true, marker will be kept consistent for JIP players [Boolean] - -Returns: - True if executed on the server [Boolean] - -Example: - (begin example) - _marker = createMarker ["TAG_fishingVillage", getPos TAG_fish]; - [_marker, true] call CBA_fnc_setMarkerPersistent. - // Marker will be kept persistent for JIP players. - // later... - ["TAG_fishingVillage", false] call CBA_fnc_setMarkerPersistent. - // Marker will no longer be kept persistent for JIP players. - (end) - -Author: - Sickboy -*/ -#include "script_component.hpp" - -params ["_marker","_persistent"]; -TRACE_1(_this); - -private ["_markerConsistent", "_return"]; -_markerConsistent = toLower _marker; // Name of marker as stored internally. - -_return = if (SLX_XEH_MACHINE select 3) then -{ - if (_persistent) then - { - if (_markerConsistent in GVAR(MARKERS)) then - { - WARNING("Marker already persistent: " + str _marker); - } else { - GVAR(MARKERS) pushBack _markerConsistent; - }; - } else { - if (_markerConsistent in GVAR(MARKERS)) then - { - SUB(GVAR(MARKERS),[_markerConsistent]); - } else { - WARNING("Marker was already not persistent: " + str _marker); - }; - }; - true; -} else { - [QGVAR(marker_persist), [_marker,_persistent]] call CBA_fnc_globalEvent; - true; -}; - -_return;