From cb033d83bf5b5f7e465a3646254d6d4f3df58cbc Mon Sep 17 00:00:00 2001 From: jack77213 Date: Thu, 20 Feb 2020 11:13:24 +0800 Subject: [PATCH] arma 3 addons init commit --- addons/$PBOPREFIX$ | 1 + addons/config.cpp | 27 +++++++++++++++++++++++++++ addons/fn_a3web.sqf | 25 +++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 addons/$PBOPREFIX$ create mode 100644 addons/config.cpp create mode 100644 addons/fn_a3web.sqf diff --git a/addons/$PBOPREFIX$ b/addons/$PBOPREFIX$ new file mode 100644 index 0000000..728fd6e --- /dev/null +++ b/addons/$PBOPREFIX$ @@ -0,0 +1 @@ +x\huashui\a3web \ No newline at end of file diff --git a/addons/config.cpp b/addons/config.cpp new file mode 100644 index 0000000..9820bc5 --- /dev/null +++ b/addons/config.cpp @@ -0,0 +1,27 @@ +class CfgPatches +{ + class a3web + { + name = "Arma 3 Realtime Map"; + author = "jack77213"; + url = "https://arma.huashui.cf"; + + requiredVersion = 1.92; + requiredAddons[] = {"A3_Functions_F"}; + units[] = {}; + weapons[] = {}; + }; +}; + +class CfgFunctions +{ + class huashui + { + class a3web + { + file = "x\huashui\a3web"; + class a3web { postInit=1; }; + }; + }; +}; + diff --git a/addons/fn_a3web.sqf b/addons/fn_a3web.sqf new file mode 100644 index 0000000..b06d822 --- /dev/null +++ b/addons/fn_a3web.sqf @@ -0,0 +1,25 @@ +[] spawn { + //if (!hasInterface) exitWith {}; + if (!isServer) exitWith {}; + //if (!isDedicated) exitWith {}; + + addMissionEventHandler ["ExtensionCallback", { + params ["_name", "_function", "_data"]; + if (_name isEqualTo "a3web") then + { + diag_log format ["ExtensionCallback %1, %2, %3", _name, _function, _data]; + }; + }]; + + waitUntil {time > 0}; + + a3web_interval = 1; + + while {true} do { + sleep a3web_interval; + private _units = allUnits apply { + [netid _x, isPlayer _x, name _x, str (side _x), getPos _x]; + }; + "liba3web" callExtension ["http:post:/units-info", [_units]]; + }; +};