Skip to content

Commit

Permalink
replace real_date extension with CBA_fnc_weekDay
Browse files Browse the repository at this point in the history
resolves #70
  • Loading branch information
SiegeToaster committed Oct 4, 2022
1 parent 4ca246f commit 64afce5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions addons/core/XEH_serverPostInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,20 @@ if (GET_CONFIG(showSafestartHint,true)) then {
/* Mission End */

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 64afce5

Please sign in to comment.