Skip to content

Commit

Permalink
replace real_date extension with CBA_fnc_weekDay
Browse files Browse the repository at this point in the history
closes #70
  • Loading branch information
SiegeToaster committed Oct 4, 2022
1 parent a4b8c9b commit d936f1f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions addons/core/XEH_serverPostInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,18 @@ addMissionEventHandler ["MPEnded", {

// OCAP2 Replay check and export.
if !(isNil "ocap_fnc_exportData") then {
private _realDate = "real_date" callExtension "EST+";
private _weekday = [systemTime] call CBA_fnc_weekDay;
private _outcome = "Mission Completed"; // To do: Add functionality to determine if mission failed.
if (_realDate != "") then {
if (_weekday >= 0) then {
private _opType = "MISC";
private _weekday = (parseSimpleArray _realDate) # 6;
switch (_weekday) do {
case 0: { _opType = "MAIN OP"; }; // sunday
case 5: { _opType = "SIDE OP"; }; // friday
};
[_side, _outcome, _opType] call ocap_fnc_exportData;
} else {
[_side, _outcome, "unk"] call ocap_fnc_exportData;
ERROR("real_date extension not found");
ERROR("Failed to fetch weekday");
};
} else {
ERROR("ocap_fnc_exportData function not found");
Expand Down

0 comments on commit d936f1f

Please sign in to comment.