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

Various Bugfixes and Minor Enhancements #391

Merged
merged 13 commits into from
Aug 22, 2023
Merged
Next Next commit
added function to clone computers (filesystem, users, commands)
y0014984 committed Aug 15, 2023
commit 09c1ab47e4a9deaddb0848bf2fa80a824c4e8d29
2 changes: 2 additions & 0 deletions addons/armaos/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -49,6 +49,8 @@ PREP(computer_addGames);

PREP(computer_getLocality);

PREP(computer_clone);

/* OS Link Functions */
PREP(link_add);
PREP(link_init);
29 changes: 29 additions & 0 deletions addons/armaos/functions/fnc_computer_clone.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* PUBLIC - Execution on server only
*
* This function clones filesystem, links (commands) and the userlist from computer1 to computer2.
*
* Arguments:
* 0: Computer 1 <OBJECT>
* 0: Computer 2 <OBJECT>
*
* Results:
* None
*
*/

params ["_computer1", "_computer2"];

if (!isServer) exitWith { false; };

// read variables from source computer
private _filesystem = _computer1 getVariable ["AE3_filesystem", []];
private _links = _computer1 getVariable ["AE3_links", createHashMap];
private _userlist = _computer1 getVariable ["AE3_userlist", createHashMap];

// write variables to destination computer
_computer2 setVariable ["AE3_filesystem", _filesystem];
_computer2 setVariable ["AE3_links", _links];
_computer2 setVariable ["AE3_userlist", _userlist, true];

true;