-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
private _markerHash = [[], ""] call CBA_fnc_hashCreate; | ||
private _currentMarkers = []; | ||
|
||
private _reportMarker = { | ||
params ["_event", "_marker"]; | ||
|
||
private _serializedMarker = _marker call anrop_aar_fnc_serializeMarker; | ||
|
||
private _obj = ["object", | ||
["type", ["string", _event]], | ||
["marker", _serializedMarker] | ||
]; | ||
|
||
private _cached = [_markerHash, _marker] call CBA_fnc_hashGet; | ||
|
||
private _serialized = _obj call anrop_aar_fnc_serializeJson; | ||
if (_serialized != _cached) then { | ||
[_markerHash, _marker, _serialized] call CBA_fnc_hashSet; | ||
_serialized call anrop_aar_fnc_sendJson; | ||
}; | ||
}; | ||
|
||
while { true } do { | ||
private _allMarkers = allMapMarkers; | ||
private _newMarkers = _allMarkers - _currentMarkers; | ||
private _updatedMarkers = _allMarkers - _newMarkers; | ||
private _removedMarkers = _currentMarkers - _allMarkers; | ||
|
||
{ | ||
["MarkerCreated", _x] call _reportMarker; | ||
} forEach _newMarkers; | ||
|
||
{ | ||
["MarkerPosition", _x] call _reportMarker; | ||
} forEach _updatedMarkers; | ||
|
||
{ | ||
["MarkerDeleted", _x] call _reportMarker; | ||
} forEach _removedMarkers; | ||
|
||
sleep _this; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
params ["_marker"]; | ||
|
||
private _id = _marker; | ||
private _alpha = markerAlpha _marker; | ||
private _brush = markerBrush _marker; | ||
private _color = markerColor _marker; | ||
private _position = ([markerPos _marker, markerDir _marker] call anrop_aar_fnc_serializePosition); | ||
private _shape = markerShape _marker; | ||
private _size = markerSize _marker; | ||
private _text = markerText _marker; | ||
private _type = markerType _marker; | ||
|
||
["object", | ||
["id", ["string", _id]], | ||
["alpha", ["number", _alpha]], | ||
["brush", ["string", _brush]], | ||
["color", ["string", _color]], | ||
["position", _position], | ||
["shape", ["string", _shape]], | ||
["size", ["object", | ||
["width", ["number", _size select 0]], | ||
["height", ["number", _size select 1]] | ||
]], | ||
["text", ["string", _text]], | ||
["type", ["string", _type]] | ||
]; |