This commit is contained in:
SongWei 2020-02-16 18:06:31 +11:00
parent d3eb230d4c
commit c8d6e6529e
5 changed files with 81 additions and 0 deletions

1
leoservermod/$PBOPREFIX$ Normal file
View File

@ -0,0 +1 @@
\leoservermod

32
leoservermod/config.cpp Normal file
View File

@ -0,0 +1,32 @@
class CfgPatches
{
class leoservermod
{
// Meta information for editor
name = "leoservermod";
author = "leo";
url = "https://leosongwei.github.io/";
requiredVersion = 1.69;
requiredAddons[] = {};
units[] = {};
weapons[] = {};
// init = "diag_log 'loading leoext...'; call compile preprocessFileLineNumbers '\leoservermod\init.sqf'";
};
};
class CfgFunctions
{
class leoservermod
{
class functions
{
class leoservermodInit {
file="\leoservermod\init.sqf";
postInit=1;
};
};
};
};

6
leoservermod/init.sqf Normal file
View File

@ -0,0 +1,6 @@
diag_log "leoext: try to initialize...";
_return = "libleoext" callExtension "foooo";
execVM "\leoservermod\marker.sqf";
diag_log format ["leoext: initialize complete! return: %1", _return];

42
leoservermod/marker.sqf Normal file
View File

@ -0,0 +1,42 @@
leoext_map_markers_information = {
private _info_list = [];
{
private _text = markerText _x;
private _icon_type = markerType _x; // "Empty" == not icon
private _pos = markerPos _x;
private _color = markerColor _x;
private _marker_info = [_text, _icon_type, _color, _pos];
if (_icon_type != "") then {
_info_list pushBack _marker_info;
};
} forEach allMapMarkers;
_info_list;
};
leoext_units_pos = {
private _units_pos = [];
{
private _side = str (side _x);
private _pos = position _x;
private _unit = [_side, _pos];
_units_pos pushBack _unit;
} forEach allUnits;
_units_pos;
};
leoext_stop = false;
[] spawn {
while {!leoext_stop} do {
sleep 1;
diag_log "submitting coordinates...";
private _markers = call leoext_map_markers_information;
private _units = call leoext_units_pos;
"libleoext" callExtension ["foo", [[_markers, _units]]];
};
}

View File