From f3d38728436a49cc4c1cb92fae0967fed60f71ce Mon Sep 17 00:00:00 2001 From: "[GNC]Lord-MDB]" Date: Sun, 13 Sep 2020 13:52:17 +0200 Subject: [PATCH 1/3] Update Sekunden genaue erfassung der Flaggen --- addons/OPT/SECTORCONTROL/fn_Punkte.sqf | 160 ++++++++++++++++--------- 1 file changed, 106 insertions(+), 54 deletions(-) diff --git a/addons/OPT/SECTORCONTROL/fn_Punkte.sqf b/addons/OPT/SECTORCONTROL/fn_Punkte.sqf index d6e42d01..222a001f 100644 --- a/addons/OPT/SECTORCONTROL/fn_Punkte.sqf +++ b/addons/OPT/SECTORCONTROL/fn_Punkte.sqf @@ -15,6 +15,12 @@ #include "macros.hpp" +//Init +GVAR(csat_points_f)=0; +GVAR(nato_points_f)=0; +GVAR(aaf_points_f)=0; +GVAR(points_logtime) =0; + GVAR(Punktecount) = [{ // Logge und übertrage Punktestand alle 60 Sekunden, solange Spiel noch läuft @@ -30,39 +36,54 @@ GVAR(Punktecount) = [{ if (GVAR(dominator) isEqualTo east) then { - - GVAR(csat_points) = GVAR(csat_points) + 1; - publicVariable QGVAR(csat_points); - private _message = format ["CSAT +1 (AAF %1 | CSAT %2)", GVAR(aaf_points), GVAR(csat_points)]; - private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; - - //Log - diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; - + GVAR(csat_points_f) = GVAR(csat_points_f) + (1 / 60); // 1 Punkt pro Minute + publicVariable QGVAR(csat_points_f); + if (round GVAR(csat_points_f) > GVAR(csat_points)) then + { + GVAR(csat_points) = round GVAR(csat_points_f); // übernahme in bisherige integer-zählweise + publicVariable QGVAR(csat_points); + GVAR(points_logtime) = serverTime; + publicVariable QGVAR(points_logtime); + private _message = format ["CSAT +1 (AAF %1 | CSAT %2)", GVAR(aaf_points), GVAR(csat_points)]; + private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; + + //Log + diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; + }; }; if (GVAR(dominator) isEqualTo independent) then { - GVAR(aaf_points) = GVAR(aaf_points) + 1; - publicVariable QGVAR(aaf_points); - private _message = format ["AAF +1 (AAF %1 | CSAT %2)", GVAR(AAF_points), GVAR(csat_points)]; - private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; - - //Log - diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; + GVAR(aaf_points_f) = GVAR(aaf_points_f) + (1 / 60); // 1 Punkt pro Minute + publicVariable QGVAR(aaf_points_f); + if (round GVAR(aaf_points_f) > GVAR(aaf_points)) then + { + GVAR(aaf_points) = round GVAR(aaf_points_f); // übernahme in bisherige integer-zählweise + publicVariable QGVAR(aaf_points); + GVAR(points_logtime) = serverTime; + publicVariable QGVAR(points_logtime); + private _message = format ["AAF +1 (AAF %1 | CSAT %2)", GVAR(AAF_points), GVAR(csat_points)]; + private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; + + //Log + diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; + }; }; } else { - + if ((serverTime - GVAR(points_logtime)) >= 60) then // letzter logeintrag 1 Minute alt? + { + GVAR(points_logtime) = serverTime; + publicVariable QGVAR(points_logtime); private _message = format ["Kein Dominator (AAF %1 | CSAT %2)", GVAR(aaf_points), GVAR(csat_points)]; private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; //Log diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; - + }; }; }; @@ -75,38 +96,54 @@ GVAR(Punktecount) = [{ if (GVAR(dominator) isEqualTo east) then { - GVAR(csat_points) = GVAR(csat_points) + 1; - publicVariable QGVAR(csat_points); - private _message = format ["CSAT +1 (NATO %1 | CSAT %2)", GVAR(nato_points), GVAR(csat_points)]; - private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; - - //Log - diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; - + GVAR(csat_points_f) = GVAR(csat_points_f) + (1 / 60); // 1 Punkt pro Minute + publicVariable QGVAR(csat_points_f); + if (round GVAR(csat_points_f) > GVAR(csat_points)) then + { + GVAR(csat_points) = round GVAR(csat_points_f); // übernahme in bisherige integer-zählweise + publicVariable QGVAR(csat_points); + GVAR(points_logtime) = serverTime; + publicVariable QGVAR(points_logtime); + private _message = format ["CSAT +1 (NATO %1 | CSAT %2)", GVAR(nato_points), GVAR(csat_points)]; + private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; + + //Log + diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; + }; }; if (GVAR(dominator) isEqualTo west) then { - GVAR(nato_points) = GVAR(nato_points) + 1; - publicVariable QGVAR(nato_points); - private _message = format ["NATO +1 (NATO %1 | CSAT %2)", GVAR(nato_points), GVAR(csat_points)]; - private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; - - //Log - diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; + GVAR(nato_points_f) = GVAR(nato_points_f) + (1 / 60); // 1 Punkt pro Minute + publicVariable QGVAR(nato_points_f); + if (round GVAR(nato_points_f) > GVAR(nato_points)) then + { + GVAR(nato_points) = round GVAR(nato_points_f); // übernahme in bisherige integer-zählweise + publicVariable QGVAR(nato_points); + GVAR(points_logtime) = serverTime; + publicVariable QGVAR(points_logtime); + private _message = format ["NATO +1 (NATO %1 | CSAT %2)", GVAR(nato_points), GVAR(csat_points)]; + private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; + + //Log + diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; + }; }; } else { - + if ((serverTime - GVAR(points_logtime)) >= 60) then // letzter logeintrag 1 Minute alt? + { + GVAR(points_logtime) = serverTime; + publicVariable QGVAR(points_logtime); private _message = format ["Kein Dominator (NATO %1 | CSAT %2)", GVAR(nato_points), GVAR(csat_points)]; private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; //Log diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; - + }; }; }; @@ -119,39 +156,54 @@ GVAR(Punktecount) = [{ if (GVAR(dominator) isEqualTo west) then { - GVAR(nato_points) = GVAR(nato_points) + 1; - publicVariable QGVAR(nato_points); - private _message = format ["NATO +1 (NATO %1 | AAF %2)", GVAR(nato_points), GVAR(aaf_points)]; - private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; - - //Log - diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; - + GVAR(nato_points_f) = GVAR(nato_points_f) + (1 / 60); // 1 Punkt pro Minute + publicVariable QGVAR(nato_points_f); + if (round GVAR(nato_points_f) > GVAR(nato_points)) then + { + GVAR(nato_points) = round GVAR(nato_points_f); // übernahme in bisherige integer-zählweise + publicVariable QGVAR(nato_points); + GVAR(points_logtime) = serverTime; + publicVariable QGVAR(points_logtime); + private _message = format ["NATO +1 (NATO %1 | AAF %2)", GVAR(nato_points), GVAR(aaf_points)]; + private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; + + //Log + diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; + }; }; if (GVAR(dominator) isEqualTo independent) then { - GVAR(aaf_points) = GVAR(aaf_points) + 1; - publicVariable QGVAR(aaf_points); - private _message = format ["AAF +1 (Nato %1 | AAF %2)", GVAR(nato_points), GVAR(aaf_points)]; - private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; - - //Log - diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; - + GVAR(aaf_points_f) = GVAR(aaf_points_f) + (1 / 60); // 1 Punkt pro Minute + publicVariable QGVAR(aaf_points_f); + if (round GVAR(aaf_points_f) > GVAR(aaf_points)) then + { + GVAR(aaf_points) = round GVAR(aaf_points_f); // übernahme in bisherige integer-zählweise + publicVariable QGVAR(aaf_points); + GVAR(points_logtime) = serverTime; + publicVariable QGVAR(points_logtime); + private _message = format ["AAF +1 (Nato %1 | AAF %2)", GVAR(nato_points), GVAR(aaf_points)]; + private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; + + //Log + diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; + }; }; } else { - + if ((serverTime - GVAR(points_logtime)) >= 60) then // letzter logeintrag 1 Minute alt? + { + GVAR(points_logtime) = serverTime; + publicVariable QGVAR(points_logtime); private _message = format ["Kein Dominator (NATO %1 | AAF %2)", GVAR(nato_points), GVAR(aaf_points)]; private _timestamp = [serverTime - OPT_GELDZEIT_startTime] call CBA_fnc_formatElapsedTime; //Log diag_log format["[%1] (%2) Log: %3 --- %4","OPT","Fahne",_timestamp,_message]; - + }; }; }; @@ -168,4 +220,4 @@ GVAR(Punktecount) = [{ }; }; -}, 60] call CFUNC(addPerFrameHandler); +}, 1] call CFUNC(addPerFrameHandler); From 0ff0f43d78dcf8774d0321bc2f0ec172deac6eae Mon Sep 17 00:00:00 2001 From: "[GNC]Lord-MDB]" Date: Sun, 13 Sep 2020 14:49:07 +0200 Subject: [PATCH 2/3] Fix Logging Abschlusspunkte --- addons/OPT/GELDZEIT/fn_serverInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/OPT/GELDZEIT/fn_serverInit.sqf b/addons/OPT/GELDZEIT/fn_serverInit.sqf index 1fc9672f..ad0ef5ca 100644 --- a/addons/OPT/GELDZEIT/fn_serverInit.sqf +++ b/addons/OPT/GELDZEIT/fn_serverInit.sqf @@ -154,7 +154,7 @@ DFUNC(Mission_Ende) = ERROR_LOG("Missionende: Fehlehalte Datenübergabe keine Fraktionauswahl erkannt"); }; }; - ["Mission", "End", [GVAR(nato_points), GVAR(csat_points), GVAR(aaf_points), missionName]] call OPT_LOGGING_fnc_writelog; + ["Mission", "End", [OPT_SECTORCONTROL_nato_points, OPT_SECTORCONTROL_csat_points, OPT_SECTORCONTROL_aaf_points, missionName]] call OPT_LOGGING_fnc_writelog; }; From 5b6bdd26b68eab5bf4c8b4a95740c69a98b61e59 Mon Sep 17 00:00:00 2001 From: "[GNC]Lord-MDB]" Date: Sun, 13 Sep 2020 15:02:06 +0200 Subject: [PATCH 3/3] Fix Flaggeziehen per Taste --- addons/OPT/SECTORCONTROL/fn_clientInit.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/OPT/SECTORCONTROL/fn_clientInit.sqf b/addons/OPT/SECTORCONTROL/fn_clientInit.sqf index 4c2613f5..13af9257 100644 --- a/addons/OPT/SECTORCONTROL/fn_clientInit.sqf +++ b/addons/OPT/SECTORCONTROL/fn_clientInit.sqf @@ -45,7 +45,6 @@ GVAR(aaf_flags) = []; { private _cursorObject = cursorObject; if ( - (_cursorObject in GVAR(nato_flags) or _cursorObject in GVAR(csat_flags) or _cursorObject in GVAR(aaf_flags)) and [_cursorObject, player] call FUNC(captureFlagCondition) ) then { [_cursorObject, player] call FUNC(captureFlag);