Skip to content

Commit

Permalink
Merge branch 'dj-development' into daccong-ctf-again
Browse files Browse the repository at this point in the history
  • Loading branch information
dijksterhuis committed Aug 15, 2024
2 parents 79aab5f + 1b77025 commit ac79bb8
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 38 deletions.
1 change: 1 addition & 0 deletions mission/config/functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ class CfgFunctions
class mod_support
{
class init_comms {};
class check_zeus_pack {};
};

class paradigm_interop
Expand Down
Binary file modified mission/custom/billboards/BN_Welcome_20240621.paa
Binary file not shown.
Binary file modified mission/custom/billboards/BN_welcome_1.paa
Binary file not shown.
Binary file modified mission/custom/billboards/Supporter_SIgn.paa
Binary file not shown.
Binary file modified mission/custom/billboards/johnthegiPromo_bb.paa
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion mission/eventhandlers/mission/eh_EntityRespawned.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ if (isPlayer _entity) then
}, [_entity], 1] call CBA_fnc_waitAndExecute;
};

[_entity] call vn_mf_fnc_curator_init;
// wipe out unused data
_corpse setVariable ["vn_mf_dyn_weaponholders",nil,true];
};
2 changes: 2 additions & 0 deletions mission/eventhandlers/mission/eh_HandleDisconnect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ private _prefix = "vn_mf_db_";
private _config = (missionConfigFile >> "gamemode" >> "vars" >> "players");
private _blacklisted = getArray(_config >> "blacklisted");

["CuratorDisconnect", [_unit, _id, _uid, _name]] call CBA_fnc_serverEvent;

private _vardata = [];
if !(isNull _unit) then
{
Expand Down
2 changes: 2 additions & 0 deletions mission/eventhandlers/player/eh_Respawn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ _unit setVariable ["vn_mf_side", side player, true];

// re-add hold/add actions onto the newly respawned player
call vn_mf_fnc_action_init;

[player] call vn_mf_fnc_curator_init;
68 changes: 36 additions & 32 deletions mission/functions/core/init/fn_curator_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,44 @@ private _playerIsCurator = _curators findIf { _x == getPlayerUID _player} > -1;

private _myCurObject = objNull;

if(_playerIsCurator == true) then
{
[_player] call {
[0, {
params ["_thePlayer"];
private _playerUID = getPlayerUID _thePlayer;
private _curVarName = _playerUID+"_Cur";
_myCurObject = missionNamespace getVariable [_curVarName, objNull];
if(_playerIsCurator == false) exitWith {};

// call vn_mf_fnc_check_zeus_pack with remoteExec to check if the player has the required mods
private _hasZeusPack = call vn_mf_fnc_check_zeus_pack;
if (_hasZeusPack == false) exitWith {};

[_player] call {
[0, {
params ["_thePlayer"];
private _playerUID = getPlayerUID _thePlayer;
private _curVarName = _playerUID+"_Cur";
_myCurObject = missionNamespace getVariable [_curVarName, objNull];

if (isNull _myCurObject) then {
if (isNil "MikeFrcCur_group") then {MikeFrcCur_group = creategroup sideLogic;};
_myCurObject = MikeFrcCur_group createunit["ModuleCurator_F", [0, 90, 90], [], 0.5, "NONE"]; //Logic Server
_myCurObject setVariable ["showNotification",false];

if (isNull _myCurObject) then {
if (isNil "MikeFrcCur_group") then {MikeFrcCur_group = creategroup sideLogic;};
_myCurObject = MikeFrcCur_group createunit["ModuleCurator_F", [0, 90, 90], [], 0.5, "NONE"]; //Logic Server
_myCurObject setVariable ["showNotification",false];

missionNamespace setVariable [_curVarName, _myCurObject, true];
publicVariable "MikeFrcCur_group";
unassignCurator _myCurObject;
_cfg = (configFile >> "CfgPatches");
_newAddons = [];
for "_i" from 0 to((count _cfg) - 1) do {
_name = configName(_cfg select _i);
_newAddons pushBack _name;
};

if (count _newAddons > 0) then {_myCurObject addCuratorAddons _newAddons};

diag_log format ["[+] Curator object created %1.", _myCurObject];
missionNamespace setVariable [_curVarName, _myCurObject, true];
publicVariable "MikeFrcCur_group";
unassignCurator _myCurObject;
_cfg = (configFile >> "CfgPatches");
_newAddons = [];

for "_i" from 0 to((count _cfg) - 1) do {
_name = configName(_cfg select _i);
_newAddons pushBack _name;
};

unassignCurator _myCurObject;
sleep 0.4;
_thePlayer assignCurator _myCurObject;
if (count _newAddons > 0) then {_myCurObject addCuratorAddons _newAddons};
diag_log format ["[+] Curator object created %1.", _myCurObject];
};

unassignCurator _myCurObject;
sleep 0.4;
_thePlayer assignCurator _myCurObject;
diag_log format ["[+] Player %1 added to %2.", _thePlayer, _myCurObject];

diag_log format ["[+] Player %1 added to %2.", _thePlayer, _myCurObject];
}, _this] call CBA_fnc_globalExecute;
};
}, _this] call CBA_fnc_globalExecute;
};

17 changes: 17 additions & 0 deletions mission/functions/mod_support/fn_check_zeus_pack.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
private _result = false;

if (!(isClass (configFile >> "CfgPatches" >> "zen_main")) || !(isClass (configFile >> "CfgPatches" >> "cba_main"))) exitWith {
// Bro-Nation Zeus Pack is not loaded so we can't use the curator system
_imag = "<img size='6' image='custom\patches\duty_officer.paa' align='center'/>";
_text = "<br/><t color='#ff0000' size='3' shadow='1' shadowColor='#000000' align='center'>Warning!</t><br/>You must have the Bro-Nation Zeus Pack and CBA_A3 enabled to have curation access.<br/>";
hint parseText (_imag + _text);

player setVariable ["hasZeusPack", false];

_result
};

player setVariable ["hasZeusPack", true];

_result = true;
_result
2 changes: 2 additions & 0 deletions mission/para_player_loaded_client.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ player addEventHandler ["Respawn", _fnc_respawnEventHandler];
//This way they can still exit if they want.
player enableSimulation false;

[player] call vn_mf_fnc_curator_init;

// Start loading screen, so we wait while server init completes.
startLoadingScreen ["Welcome to Mike Force!", "MikeForce_loadingScreen"];
[getText(missionConfigFile >> "gamemode" >> "loadingScreens" >> "mainWelcome"),5002] call vn_mf_fnc_update_loading_screen;
2 changes: 0 additions & 2 deletions mission/para_player_postinit_server.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@

params ["_player", "_didJIP"];

[_player] call vn_mf_fnc_curator_init;

diag_log format ["Mike Force: Player postinit server - %1", _player];
8 changes: 5 additions & 3 deletions mission/para_server_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@
use_paradigm_init = 1;
*/

call para_s_fnc_curator_init_eh;

call vn_mf_fnc_server_init_backend;
["restart_messages", vn_mf_fnc_server_process_restart, [], 60] call para_g_fnc_scheduler_add_job;

call para_s_fnc_init_whitelist;
["update_whitelist", para_s_fnc_init_whitelist, [], 120] call para_g_fnc_scheduler_add_job;

// update curator whitelist, every 5 minutes
call para_s_fnc_init_curators;
["update_curators", para_s_fnc_init_curators, [], 300] call para_g_fnc_scheduler_add_job;
call para_s_fnc_curator_populate;
["update_curators", para_s_fnc_curator_populate, [], 300] call para_g_fnc_scheduler_add_job;

// update objects curators can edit, every 10 seconds
[10] call para_s_fnc_init_curators_update_objects_job;
[10] call para_s_fnc_curator_update_objects;

call para_s_fnc_init_dopamine;
["dopamine_hit", para_s_fnc_init_dopemine, [], 300] call para_g_fnc_scheduler_add_job;
Expand Down

0 comments on commit ac79bb8

Please sign in to comment.