diff --git a/addons/server/Cfgvehicles.hpp b/addons/server/Cfgvehicles.hpp new file mode 100644 index 0000000..ad868fc --- /dev/null +++ b/addons/server/Cfgvehicles.hpp @@ -0,0 +1,128 @@ +class CfgVehicles { + class Logic; + class Module_F : Logic + { + class AttributesBase + { + class Default; + class Edit; + class Combo; + class Checkbox; + class CheckboxNumber; + class ModuleDescription; + class Units; + }; + + class ModuleDescription + { + class AnyBrain; + }; + }; + + class GVAR(coreModule): Module_F { + scope = 2; + scopeCurator = 0; + displayname = "CoT Router"; + icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa"; + category = QEGVAR(main,moduleCategory); + function = QFUNC(3denCoreModuleConfig); + functionPriority = 1; + isGlobal = 0; + isTriggerActivated = 1; + isDisposable = 1; + is3den = 0; + curatorCanAttach = 0; + curatorInfoType = "RscDisplayAttributeModuleNuke"; + + canSetArea = 0; + canSetAreaShape = 0; + canSetAreaHeight = 0; + + class AttributesValues { + size3[] = { 1, 1, -1 }; + isRectangle = 0; + }; + + class Attributes: AttributesBase { + class GVAR(moduleInstanceAddress): Edit { + property = QGVAR(moduleInstanceAddress); + displayname = "TAK Server Address"; + tooltip = "TAK Server Instance Address"; + typeName = "STRING"; + defaultValue = "localhost"; + }; + class GVAR(moduleInstancePort): Edit { + property = QGVAR(moduleInstancePort); + displayname = "TAK Server TCP Port"; + tooltip = "TAK Server instance Port for TCP connection"; + typeName = "NUMBER"; + defaultValue = "8088"; + }; + class ModuleDescription: ModuleDescription {}; + }; + + class ModuleDescription: ModuleDescription { + description = "Generate the initial ARMATAK configuration, syncronizing all players to the TAK server instance"; + sync[] = {"LocationArea_F"}; + + class LocationArea_F { + description[] = { + "This module will synchronize all", + "players to the TAK server instance" + }; + position = 1; + direction = 1; + optional = 1; + duplicate = 1; + synced[] = { "BluforUnit", "AnyBrain" }; + }; + class BluforUnit + { + description = "Short description"; + displayName = "Any BLUFOR unit"; + icon = "iconMan"; + side = 1; + }; + }; + }; + + class GVAR(coreModuleCurator): GVAR(coreModule) { + scope = 1; + scopeCurator = 2; + function = ""; + curatorInfoType = "armatak_zeus_core_module_dialog"; + + class AttributesValues { + size3[] = { 1, 1, -1 }; + isRectangle = 0; + }; + + class Attributes: AttributesBase { + class ModuleDescription: ModuleDescription {}; + }; + + class ModuleDescription: ModuleDescription { + description = "Generate the initial ARMATAK configuration, syncronizing all players to the TAK server instance"; + sync[] = {"LocationArea_F"}; + + class LocationArea_F { + description[] = { + "This module will synchronize all", + "players to the TAK server instance" + }; + position = 1; + direction = 1; + optional = 1; + duplicate = 1; + synced[] = { "BluforUnit", "AnyBrain" }; + }; + class BluforUnit + { + description = "Short description"; + displayName = "Any BLUFOR unit"; + icon = "iconMan"; + side = 1; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/server/functions/fnc_3denCoreModuleConfig.sqf b/addons/server/functions/fnc_3denCoreModuleConfig.sqf index 8849831..35f4d85 100644 --- a/addons/server/functions/fnc_3denCoreModuleConfig.sqf +++ b/addons/server/functions/fnc_3denCoreModuleConfig.sqf @@ -9,8 +9,8 @@ params [ if (isServer) exitWith { ["Connecting to TCP Socket", "success", "TCP Socket"] call EFUNC(main,notify); - _tak_server_instance_address = _logic getVariable "armatak_module_tak_server_instance_address"; - _tak_server_instance_port = _logic getVariable "armatak_module_tak_server_instance_port"; + _tak_server_instance_address = _logic getVariable QGVAR(moduleInstanceAddress); + _tak_server_instance_port = _logic getVariable QGVAR(moduleInstancePort); _tak_server_fulladdress = _tak_server_instance_address + ":" + (str _tak_server_instance_port); diff --git a/addons/server/functions/fnc_ZeusCoreModuleConfig.sqf b/addons/server/functions/fnc_ZeusCoreModuleConfig.sqf index 4382845..9e21242 100644 --- a/addons/server/functions/fnc_ZeusCoreModuleConfig.sqf +++ b/addons/server/functions/fnc_ZeusCoreModuleConfig.sqf @@ -1,16 +1,20 @@ #include "..\script_component.hpp" +_socket_is_running = missionNamespace getVariable ["armatak_tcp_socket_is_running", false]; + +if (_socket_is_running) exitWith { + ["Socket was called twice","error", "TCP Socket"] call EFUNC(main,notify); + closeDialog 1; +}; + disableSerialization; -_warning = format ["ARMATAK
%1", "Connecting to TAK Server TCP Socket..."]; -[[_warning, 1.5]] call CBA_fnc_notify; - -call armatak_fnc_handleCallbacks; +["Connecting to TCP Socket", "success", "TCP Socket"] call EFUNC(main,notify); _tak_server_instance_address = ctrlText 14000; _tak_server_instance_port = ctrlText 14001; -_tak_server_fulladdress = ((_tak_server_instance_address) + ":" + (str _tak_server_instance_port)); +_tak_server_fulladdress = ((_tak_server_instance_address) + ":" + (_tak_server_instance_port)); missionNamespace setVariable ["armatak_server_instance", _tak_server_fulladdress]; missionNamespace setVariable ["armatak_tcp_socket_is_running", true]; @@ -23,7 +27,7 @@ _syncUnits = []; missionNamespace setVariable ["armatak_marked_units", _syncUnits]; _syncedUnits = missionNamespace getVariable "armatak_marked_units"; - +/* [{ _syncedUnits = missionNamespace getVariable "armatak_marked_units"; @@ -49,5 +53,6 @@ _syncedUnits = missionNamespace getVariable "armatak_marked_units"; }; } forEach _syncedUnits; }, 2, []] call CBA_fnc_addPerFrameHandler; + */ closeDialog 1; \ No newline at end of file