- Add a dispatcher web view and layout switching - Route group role updates and dispatcher hydration through the UI bridge - Refresh top bar and hide map/side panel outside operations mode
102 lines
4.1 KiB
Plaintext
102 lines
4.1 KiB
Plaintext
#include "script_component.hpp"
|
|
|
|
PREP_RECOMPILE_START;
|
|
#include "XEH_PREP.hpp"
|
|
PREP_RECOMPILE_END;
|
|
|
|
call FUNC(initCadStore);
|
|
|
|
[QGVAR(requestHydrateCad), {
|
|
params [["_uid", "", [""]]];
|
|
|
|
if (_uid isEqualTo "") exitWith {
|
|
["WARNING", "CAD hydrate request received with empty UID."] call EFUNC(common,log);
|
|
};
|
|
|
|
private _player = [_uid] call EFUNC(common,getPlayer);
|
|
if (_player isEqualTo objNull) exitWith {};
|
|
|
|
private _payload = GVAR(CadStore) call ["buildHydratePayload", [_uid]];
|
|
[CRPC(cad,responseHydrateCad), [_payload], _player] call CFUNC(targetEvent);
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(requestAssignCadTask), {
|
|
params [
|
|
["_uid", "", [""]],
|
|
["_taskID", "", [""]],
|
|
["_groupID", "", [""]],
|
|
["_note", "", [""]]
|
|
];
|
|
|
|
if (_uid isEqualTo "" || { _taskID isEqualTo "" } || { _groupID isEqualTo "" }) exitWith {
|
|
["WARNING", "Invalid CAD task assignment payload."] call EFUNC(common,log);
|
|
};
|
|
|
|
private _player = [_uid] call EFUNC(common,getPlayer);
|
|
if (_player isEqualTo objNull) exitWith {};
|
|
|
|
private _result = GVAR(CadStore) call ["assignTaskToGroup", [_uid, _taskID, _groupID, _note]];
|
|
[CRPC(cad,responseCadAssignment), [_result], _player] call CFUNC(targetEvent);
|
|
[CRPC(cad,responseHydrateCad), [GVAR(CadStore) call ["buildHydratePayload", [_uid]]], _player] call CFUNC(targetEvent);
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(requestAcknowledgeCadTask), {
|
|
params [["_uid", "", [""]], ["_taskID", "", [""]]];
|
|
|
|
if (_uid isEqualTo "" || { _taskID isEqualTo "" }) exitWith {
|
|
["WARNING", "Invalid CAD acknowledge payload."] call EFUNC(common,log);
|
|
};
|
|
|
|
private _player = [_uid] call EFUNC(common,getPlayer);
|
|
if (_player isEqualTo objNull) exitWith {};
|
|
|
|
private _result = GVAR(CadStore) call ["acknowledgeTask", [_uid, _taskID]];
|
|
[CRPC(cad,responseCadAssignment), [_result], _player] call CFUNC(targetEvent);
|
|
[CRPC(cad,responseHydrateCad), [GVAR(CadStore) call ["buildHydratePayload", [_uid]]], _player] call CFUNC(targetEvent);
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(requestDeclineCadTask), {
|
|
params [["_uid", "", [""]], ["_taskID", "", [""]]];
|
|
|
|
if (_uid isEqualTo "" || { _taskID isEqualTo "" }) exitWith {
|
|
["WARNING", "Invalid CAD decline payload."] call EFUNC(common,log);
|
|
};
|
|
|
|
private _player = [_uid] call EFUNC(common,getPlayer);
|
|
if (_player isEqualTo objNull) exitWith {};
|
|
|
|
private _result = GVAR(CadStore) call ["declineTask", [_uid, _taskID]];
|
|
[CRPC(cad,responseCadAssignment), [_result], _player] call CFUNC(targetEvent);
|
|
[CRPC(cad,responseHydrateCad), [GVAR(CadStore) call ["buildHydratePayload", [_uid]]], _player] call CFUNC(targetEvent);
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(requestUpdateCadGroupStatus), {
|
|
params [["_uid", "", [""]], ["_groupID", "", [""]], ["_status", "", [""]]];
|
|
|
|
if (_uid isEqualTo "" || { _groupID isEqualTo "" } || { _status isEqualTo "" }) exitWith {
|
|
["WARNING", "Invalid CAD group status payload."] call EFUNC(common,log);
|
|
};
|
|
|
|
private _player = [_uid] call EFUNC(common,getPlayer);
|
|
if (_player isEqualTo objNull) exitWith {};
|
|
|
|
private _result = GVAR(CadStore) call ["updateGroupStatus", [_uid, _groupID, _status]];
|
|
[CRPC(cad,responseCadGroupUpdate), [_result], _player] call CFUNC(targetEvent);
|
|
[CRPC(cad,responseHydrateCad), [GVAR(CadStore) call ["buildHydratePayload", [_uid]]], _player] call CFUNC(targetEvent);
|
|
}] call CFUNC(addEventHandler);
|
|
|
|
[QGVAR(requestUpdateCadGroupRole), {
|
|
params [["_uid", "", [""]], ["_groupID", "", [""]], ["_role", "", [""]]];
|
|
|
|
if (_uid isEqualTo "" || { _groupID isEqualTo "" } || { _role isEqualTo "" }) exitWith {
|
|
["WARNING", "Invalid CAD group role payload."] call EFUNC(common,log);
|
|
};
|
|
|
|
private _player = [_uid] call EFUNC(common,getPlayer);
|
|
if (_player isEqualTo objNull) exitWith {};
|
|
|
|
private _result = GVAR(CadStore) call ["updateGroupRole", [_uid, _groupID, _role]];
|
|
[CRPC(cad,responseCadGroupUpdate), [_result], _player] call CFUNC(targetEvent);
|
|
[CRPC(cad,responseHydrateCad), [GVAR(CadStore) call ["buildHydratePayload", [_uid]]], _player] call CFUNC(targetEvent);
|
|
}] call CFUNC(addEventHandler);
|