Refactored server addon Cfgvehicle to allow core module to work on zeus

This commit is contained in:
Valmo Trindade
2025-05-19 23:35:12 -03:00
parent f04c0141ef
commit 1d65705aa8
3 changed files with 141 additions and 8 deletions

View File

@@ -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;
};
};
};
};

View File

@@ -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);

View File

@@ -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 ["<t color='#FF8021'>ARMATAK</t><br/> %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;