Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Zeus Support #350

Merged
merged 62 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6abc184
fixed category typo
y0014984 May 2, 2023
30b3e0d
basic-zeus-support-wip
y0014984 Jun 6, 2023
e2031f9
added silent/curator mode for generator turn on/off
y0014984 Jun 6, 2023
85eb96c
added setFuelLevel function
y0014984 Jun 6, 2023
e0c931c
added zeus interface for generators
y0014984 Jun 6, 2023
f7437cd
added conditional functions for all assets
y0014984 Jun 6, 2023
ccf68ac
beautified zeus interface
y0014984 Jun 10, 2023
d8d20fc
added interface for zeus addFile module
y0014984 Jun 10, 2023
27ca2f9
changed all generator names to original ones
y0014984 Jun 10, 2023
a702021
changed module addUser program flow
y0014984 Jun 11, 2023
05b4809
added zeus support for addSecurityCommands module
y0014984 Jun 11, 2023
2f467ad
added zeus support for addGames module
y0014984 Jun 11, 2023
19a2ed1
added zeus support for addFile module
y0014984 Jun 11, 2023
9c79607
added zeus support for addDir module
y0014984 Jun 11, 2023
94793a2
Added asset infos to zeus dialog
y0014984 Jun 11, 2023
933457c
fixed termination of status update script
y0014984 Jun 12, 2023
24df0ba
added deletion of eden editor modules after processing
y0014984 Jun 12, 2023
b506d68
added support for connections to zeus
y0014984 Jun 12, 2023
916bcb5
Merge branch 'dev' into basic-zeus-support
y0014984 Jun 12, 2023
9f85a99
added code from merge conflict
y0014984 Jun 12, 2023
b9998c7
added turning off devices when deleted
y0014984 Jun 12, 2023
4f5ef2e
added removal of power connections on deleted devices
y0014984 Jun 13, 2023
541d1fe
added removal of network connections on deleted devices
y0014984 Jun 13, 2023
8025af2
added curator inface to routers
y0014984 Jun 13, 2023
3e5fcba
fixed an if statement
y0014984 Jun 13, 2023
3a0bbc6
fixed module processing in zeus
y0014984 Jun 14, 2023
589b09e
changed display id's
y0014984 Jun 14, 2023
59b26fb
changed user feedback functions
y0014984 Jun 14, 2023
52920b9
added function headers
y0014984 Jun 14, 2023
496251e
fixed generator soundhandle handling
y0014984 Jun 14, 2023
938020b
fixed power capacity value after provider turn off
y0014984 Jun 14, 2023
1ea5da9
removed unnecessary code
y0014984 Jun 14, 2023
9dfc7cc
fixed reset of ip address if network connection removed
y0014984 Jun 14, 2023
eb59f56
fixed initAttributes for zeus to rounded values
y0014984 Jun 14, 2023
5e4a1d8
added localization strings to zeus UI
y0014984 Jun 15, 2023
e1fafa7
fixed localization string
y0014984 Jun 16, 2023
38f8df2
added checks for valid connections in zeus
y0014984 Jun 16, 2023
2b2a772
added hiding addConnection UI in Zeus on first start
y0014984 Jun 16, 2023
24efbe2
fixed missing Zeus UI headline for desk
y0014984 Jun 16, 2023
ecd07e3
added encryption support to addFile Zeus module
y0014984 Jun 18, 2023
b942b9d
changed function priorities of addFile/addDir modules
y0014984 Jul 4, 2023
15e096b
added ui error messages to addUser/addFile/addDir exceptions
y0014984 Jul 4, 2023
24a4b32
changed deletion of modules
y0014984 Jul 4, 2023
5fb4111
fixed some module related bugs
y0014984 Jul 4, 2023
339ff2a
added server check
y0014984 Jul 7, 2023
811184a
changed zeus module functions to trigger server
y0014984 Jul 7, 2023
05d232b
added checks for spaces in paths and usernames
y0014984 Jul 7, 2023
1eefe88
removed unnecessary event handler calls
y0014984 Jul 7, 2023
3e089a2
changed "Init" to "InitPost"
y0014984 Jul 7, 2023
3d0015e
added new power var "initDone" for related checks
y0014984 Jul 8, 2023
aac89a3
changed setBatteryLevel to serverside execution
y0014984 Jul 8, 2023
c890e1b
added missing localization strings
y0014984 Jul 8, 2023
cfbab4e
changed eden attribute updates for zeus mode
y0014984 Jul 8, 2023
fa78071
added power device check to terminateDevice func
y0014984 Jul 8, 2023
1aeba7c
fixed eden editor module addGames
y0014984 Jul 8, 2023
968416f
added ACE3 cargo name to Zeus UI title bar
y0014984 Jul 8, 2023
df6d915
added back again workaround eh on rugged lamps
y0014984 Jul 9, 2023
85b251f
fixed not working network disconnect condition
y0014984 Jul 9, 2023
1362bac
changed getBatteryLevel function to allow suspend modes
y0014984 Jul 9, 2023
e8571d9
added new var isDevice to check if it's a power device
y0014984 Jul 9, 2023
b537146
fixed some network related bugs and harmonized code
y0014984 Jul 9, 2023
b6f4b37
changed conditional blocks in getBatteryLevel function
y0014984 Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions addons/armaos/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ class CfgVehicles
};
};

// Event Handlers
class EventHandlers
{
//init = "params ['_entity']; call compile preprocessFileLineNumbers '\z\ae3\addons\main\init\initLaptop.sqf';";
};

class AE3_Equipment
{
displayName = "$STR_AE3_ArmaOS_Config_LaptopDisplayName";
Expand Down Expand Up @@ -169,12 +163,6 @@ class CfgVehicles
};
};

// Event Handlers
class EventHandlers
{
//init = "params ['_entity']; call compile preprocessFileLineNumbers '\z\ae3\addons\main\init\initLaptop.sqf';";
};

class AE3_Equipment
{
displayName = "$STR_AE3_ArmaOS_Config_LaptopDisplayName";
Expand Down Expand Up @@ -303,12 +291,6 @@ class CfgVehicles
};
};

// Event Handlers
class EventHandlers
{
//init = "params ['_entity']; call compile preprocessFileLineNumbers '\z\ae3\addons\main\init\initLaptop.sqf';";
};

class AE3_Equipment
{
displayName = "$STR_AE3_ArmaOS_Config_LaptopDisplayName";
Expand Down
3 changes: 3 additions & 0 deletions addons/armaos/functions/fnc_computer_addGames.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* PUBLIC
*
* Adds selected games to a given computer. Currently only Snake supported.
* Needs to run on server.
*
* Arguments:
* 1: Computer <OBJECT>
Expand All @@ -17,6 +18,8 @@

params ["_computer", "_isSnake"];

if (!isServer) exitWith {};

if (_isSnake) then
{
//--- add all games to all synced computers
Expand Down
3 changes: 3 additions & 0 deletions addons/armaos/functions/fnc_computer_addSecurityCommands.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* PUBLIC
*
* Adds selected security commands to a given computer.
* Needs to run on server.
*
* Arguments:
* 1: Computer <OBJECT>
Expand All @@ -18,6 +19,8 @@

params ["_computer", "_isCrypto", "_isCrack"];

if (!isServer) exitWith {};

if (_isCrypto) then
{
//--- add 'crypto' command to all synced computers
Expand Down
4 changes: 4 additions & 0 deletions addons/armaos/functions/fnc_computer_addUser.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* PUBLIC
*
* Adds a user to a given computer by providing username and password. Also a user directory will be created.
* Needs to run on server.
*
* Arguments:
* 1: Computer <OBJECT>
Expand All @@ -18,6 +19,8 @@

params ["_computer", "_username", "_password"];

if (!isServer) exitWith {};

// Get userlist and filesystem from computer
private _userlist = _computer getVariable ["AE3_Userlist", createHashMap];
private _filesystem = _computer getVariable ["AE3_filesystem", []];
Expand All @@ -38,6 +41,7 @@ if(!(_username isEqualTo "root")) then
if (_normalizedException isEqualTo (localize "STR_AE3_Filesystem_Exception_AlreadyExists")) then
{
diag_log format ["AE3 exception: %1", _exception];
y0014984 marked this conversation as resolved.
Show resolved Hide resolved
["AE3 exception: %1", _exception] call BIS_fnc_error;
}
else
{
Expand Down
27 changes: 15 additions & 12 deletions addons/armaos/functions/fnc_module_addGames.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,28 @@

params["_module", "_syncedUnits", "_activated"];

// if triggered in zeus/curator mode, don't run; Could happen in hosted multiplayer
if (!isNull curatorCamera) exitWith {};
// ignore this function if module is placed by curator/zeus
if (_module getvariable ["BIS_fnc_moduleInit_isCuratorPlaced", false]) exitWith {};

if(!isServer) exitWith {};

[_module, _syncedUnits] spawn
if (_activated) then
{
params["_module", "_syncedUnits"];
[_module, _syncedUnits] spawn
{
params["_module", "_syncedUnits"];

waitUntil { !isNil "BIS_fnc_init" };
waitUntil { !isNil "BIS_fnc_init" };

//--- Extract the user defined module arguments
private _isSnake = _module getVariable ["AE3_ModuleAddSecurityCommands_IsSnake", ""];
//--- Extract the user defined module arguments
private _isSnake = _module getVariable ["AE3_ModuleAddGames_IsSnake", ""];

{
[_x, _isSnake] call AE3_armaos_fnc_computer_addGames;
} foreach _syncedUnits;
};
{
[_x, _isSnake] call AE3_armaos_fnc_computer_addGames;
} foreach _syncedUnits;

deleteVehicle _module;
deleteVehicle _module;
};
};

true;
31 changes: 17 additions & 14 deletions addons/armaos/functions/fnc_module_addSecurityCommands.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,29 @@

params["_module", "_syncedUnits", "_activated"];

// if triggered in zeus/curator mode, don't run; Could happen in hosted multiplayer
if (!isNull curatorCamera) exitWith {};
// ignore this function if module is placed by curator/zeus
if (_module getvariable ["BIS_fnc_moduleInit_isCuratorPlaced", false]) exitWith {};

if(!isServer) exitWith {};

[_module, _syncedUnits] spawn
if (_activated) then
{
params["_module", "_syncedUnits"];
[_module, _syncedUnits] spawn
{
params["_module", "_syncedUnits"];

waitUntil { !isNil "BIS_fnc_init" };

//--- Extract the user defined module arguments
private _isCrypto = _module getVariable ["AE3_ModuleAddSecurityCommands_IsCrypto", ""];
private _isCrack = _module getVariable ["AE3_ModuleAddSecurityCommands_IsCrack", ""];
waitUntil { !isNil "BIS_fnc_init" };
//--- Extract the user defined module arguments
private _isCrypto = _module getVariable ["AE3_ModuleAddSecurityCommands_IsCrypto", ""];
private _isCrack = _module getVariable ["AE3_ModuleAddSecurityCommands_IsCrack", ""];

{
[_x, _isCrypto, _isCrack] call AE3_armaos_fnc_computer_addSecurityCommands;
} foreach _syncedUnits;
};
{
[_x, _isCrypto, _isCrack] call AE3_armaos_fnc_computer_addSecurityCommands;
} foreach _syncedUnits;

deleteVehicle _module;
deleteVehicle _module;
};
};

true;
41 changes: 24 additions & 17 deletions addons/armaos/functions/fnc_module_addUser.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,43 @@
* 3: Activated <BOOL> currently unused in this function
*
* Results:
* None
* 1: Success <BOOL> true = success and false = error
*
*/

params["_module", "_syncedUnits", "_activated"];

// if triggered in zeus/curator mode, don't run; Could happen in hosted multiplayer
if (!isNull curatorCamera) exitWith {};
// ignore this function if module is placed by curator/zeus
if (_module getvariable ["BIS_fnc_moduleInit_isCuratorPlaced", false]) exitWith { false; };

if (!isServer) exitWith {};

[_module, _syncedUnits] spawn
if (_activated) then
{
params["_module", "_syncedUnits"];
[_module, _syncedUnits] spawn
{
params["_module", "_syncedUnits"];

waitUntil { !isNil "BIS_fnc_init" };
waitUntil { !isNil "BIS_fnc_init" };

//--- Extract the user defined module arguments
private _username = _module getVariable ["AE3_ModuleUserlist_User", ""];
private _password = _module getVariable ["AE3_ModuleUserlist_Password", ""];
//--- Extract the user defined module arguments
private _username = _module getVariable ["AE3_ModuleUserlist_User", ""];
private _password = _module getVariable ["AE3_ModuleUserlist_Password", ""];

if ("_username" isEqualTo "") exitWith {};
if ("_password" isEqualTo "") exitWith {};
// check for empty username or password
if (_username isEqualTo "") exitWith { deleteVehicle _module; false; };
if (_password isEqualTo "") exitWith { deleteVehicle _module; false; };

{
//--- Add user to every synced computer
[_x, _username, _password] call AE3_armaos_fnc_computer_addUser;
} foreach _syncedUnits;
};
// check for not allowed spaces in username
if((_username find " ") != -1) exitWith { deleteVehicle _module; false; };

deleteVehicle _module;
{
//--- Add user to every synced computer
[_x, _username, _password] call AE3_armaos_fnc_computer_addUser;
} foreach _syncedUnits;

deleteVehicle _module;
};
};

true;
4 changes: 2 additions & 2 deletions addons/filesystem/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CfgVehicles
// Name of function triggered once conditions are met
function = "AE3_filesystem_fnc_module_addFile";
// Execution priority, modules with lower number are executed first. 0 is used when the attribute is undefined
functionPriority = 1;
functionPriority = 3;
// 0 for server only execution, 1 for global execution, 2 for persistent global execution
isGlobal = 1;
// 1 for module waiting until all synced triggers are activated
Expand Down Expand Up @@ -236,7 +236,7 @@ class CfgVehicles
// Name of function triggered once conditions are met
function = "AE3_filesystem_fnc_module_addDir";
// Execution priority, modules with lower number are executed first. 0 is used when the attribute is undefined
functionPriority = 1;
functionPriority = 2;
// 0 for server only execution, 1 for global execution, 2 for persistent global execution
isGlobal = 1;
// 1 for module waiting until all synced triggers are activated
Expand Down
7 changes: 6 additions & 1 deletion addons/filesystem/functions/fnc_device_addDir.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* PUBLIC
*
* Adds a directory to a given Device. Device could be a comupter or a flash drive.
* Logs and displays an error message if dir already exists; On other errors it throws an exception.
* Needs to run on server.
*
* Arguments:
* 1: Device <OBJECT>
Expand All @@ -10,7 +12,7 @@
* 4: Permissions <[ARRAY]>
*
* Results:
* Logs if dir already exists; On other errors it throws an exception
* none
*
* Example:
* [_device, "/tmp/new", "root", [[true, true, true], [true, true, true]]] call AE3_filesystem_fnc_device_addDir;
Expand All @@ -22,6 +24,8 @@

params ["_device", "_path", "_owner", "_permissions"];

if (!isServer) exitWith {};

private _filesystem = _device getVariable "AE3_filesystem";
y0014984 marked this conversation as resolved.
Show resolved Hide resolved

// throws exception if directory already exists
Expand All @@ -42,6 +46,7 @@ catch
if (_normalizedException isEqualTo (localize "STR_AE3_Filesystem_Exception_AlreadyExists")) then
{
diag_log format ["AE3 exception: %1", _exception];
["AE3 exception: %1", _exception] call BIS_fnc_error;
}
else
{
Expand Down
7 changes: 6 additions & 1 deletion addons/filesystem/functions/fnc_device_addFile.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* PUBLIC
*
* Adds a file to a given Device. Device could be a comupter or a flash drive.
* Logs and displays an error message if file already exists; On other errors it throws an exception.
* Needs to run on server.
*
* Arguments:
* 1: Device <OBJECT>
Expand All @@ -15,7 +17,7 @@
* 9: encryptionKey <STRING> Optional
*
* Results:
* Logs if file already exists; On other errors it throws an exception
* none
*
* Examples:
* [_device, "/tmp/new/example.txt", "Lorem ipsum dolor sit amet", false, "root", [[false, true, true], [false, true, true]]] call AE3_filesystem_fnc_device_addFile;
Expand All @@ -28,6 +30,8 @@

params ["_computer", "_path", "_content", "_isCode", "_owner", "_permissions", ["_isEncrypted", false], ["_encryptionAlgorithm", nil], ["_encryptionKey", nil]];

if (!isServer) exitWith {};

private _filesystem = _computer getVariable "AE3_filesystem";

if(_isCode) then
Expand Down Expand Up @@ -104,6 +108,7 @@ catch
if (_normalizedException isEqualTo (localize "STR_AE3_Filesystem_Exception_AlreadyExists")) then
{
diag_log format ["AE3 exception: %1", _exception];
["AE3 exception: %1", _exception] call BIS_fnc_error;
}
else
{
Expand Down
Loading