-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #350 from y0014984/basic-zeus-support
Basic Zeus Support
- Loading branch information
Showing
102 changed files
with
5,619 additions
and
1,132 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* PUBLIC | ||
* | ||
* Adds selected games to a given computer. Currently only Snake supported. | ||
* Needs to run on server. | ||
* | ||
* Arguments: | ||
* 1: Computer <OBJECT> | ||
* 2: Snake <BOOL> | ||
* | ||
* Results: | ||
* None | ||
* | ||
* Example: | ||
* [_computer, true] call AE3_armaos_fnc_computer_addGames; | ||
* | ||
*/ | ||
|
||
params ["_computer", "_isSnake"]; | ||
|
||
if (!isServer) exitWith {}; | ||
|
||
if (_isSnake) then | ||
{ | ||
//--- add all games to all synced computers | ||
[_computer, "CfgGames", ["snake"]] call AE3_armaos_fnc_link_init; | ||
}; |
33 changes: 33 additions & 0 deletions
33
addons/armaos/functions/fnc_computer_addSecurityCommands.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* PUBLIC | ||
* | ||
* Adds selected security commands to a given computer. | ||
* Needs to run on server. | ||
* | ||
* Arguments: | ||
* 1: Computer <OBJECT> | ||
* 2: Crypto <BOOL> | ||
* 3: Crack <BOOL> | ||
* | ||
* Results: | ||
* None | ||
* | ||
* Example: | ||
* [_computer, true, true] call AE3_armaos_fnc_computer_addSecurityCommands; | ||
* | ||
*/ | ||
|
||
params ["_computer", "_isCrypto", "_isCrack"]; | ||
|
||
if (!isServer) exitWith {}; | ||
|
||
if (_isCrypto) then | ||
{ | ||
//--- add 'crypto' command to all synced computers | ||
[_computer, "CfgSecurityCommands", ["crypto"]] call AE3_armaos_fnc_link_init; | ||
}; | ||
if (_isCrack) then | ||
{ | ||
//--- add 'crack' command to all synced computers | ||
[_computer, "CfgSecurityCommands", ["crack"]] call AE3_armaos_fnc_link_init; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* 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> | ||
* 2: Username <STRING> | ||
* 3: Password <STRING> | ||
* | ||
* Results: | ||
* None | ||
* | ||
* Example: | ||
* [_computer, "admin", "admin123"] call AE3_armaos_fnc_computer_addUser; | ||
* | ||
*/ | ||
|
||
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", []]; | ||
|
||
// Add user to userlist | ||
_userlist set [_username, _password]; | ||
|
||
// Add user directory in /home/ | ||
if(!(_username isEqualTo "root")) then | ||
{ | ||
try | ||
{ | ||
[[], _filesystem, "/home/" + _username, "root", _username] call AE3_filesystem_fnc_createDir; | ||
} | ||
catch | ||
{ | ||
private _normalizedException = _exception regexReplace ["'(.+)'", "'%1'"]; | ||
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 | ||
{ | ||
throw _exception; | ||
}; | ||
}; | ||
}; | ||
|
||
// resync userlist and filesystem | ||
_computer setVariable ["AE3_filesystem", _filesystem]; | ||
_computer setVariable ["AE3_Userlist", _userlist, true]; |
Oops, something went wrong.