Skip to content

Commit 2bc1b7f

Browse files
authored
feat: use dedicated :EVENT:SECTOR: and :EVENT:ENDMISSION: commands (#98)
Route sector events (captured/contested/capturedFlag) through :EVENT:SECTOR: and endMission through :EVENT:ENDMISSION: instead of piggybacking on :EVENT:GENERAL:. This matches the new typed event commands in the extension. - fnc_handleCustomEvent: sector → :EVENT:SECTOR:, endMission → :EVENT:ENDMISSION: - fnc_exportData: endMission → :EVENT:ENDMISSION: with [frame, side, message]
1 parent 308f16b commit 2bc1b7f

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

addons/recorder/fnc_exportData.sqf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ if (!isNil QGVAR(PFHObject)) then {
114114
private _winSide = if (isNil "_side") then {""} else {if (_side isEqualTo sideUnknown) then {""} else {str _side}};
115115
private _endMessage = if (isNil "_message") then {if (_winSide == "") then {"Mission ended"} else {""}} else {_message};
116116

117-
[":EVENT:GENERAL:", [
117+
[":EVENT:ENDMISSION:", [
118118
_endFrameNumber,
119-
"endMission",
120119
_winSide,
121120
_endMessage
122121
]] call EFUNC(extension,sendData);

addons/recorder/fnc_handleCustomEvent.sqf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
66
Description:
77
Routes custom events to the extension with typed positional args based on
8-
event type. Sector events (captured/contested/capturedFlag) send structured
9-
fields; endMission sends side and message; all other events use the legacy
10-
format with JSON-encoded extraData.
8+
event type. Sector events (captured/contested/capturedFlag) use :EVENT:SECTOR:
9+
with structured fields; endMission uses :EVENT:ENDMISSION: with side and
10+
message; all other events use :EVENT:GENERAL: with JSON-encoded extraData.
1111
1212
Applied during initialization of OCAP in <OCAP_recorder_fnc_init>.
1313
@@ -67,7 +67,7 @@ switch (_eventName) do {
6767
_args pushBack _eventMessage;
6868
};
6969

70-
[":EVENT:GENERAL:", _args] call EFUNC(extension,sendData);
70+
[":EVENT:SECTOR:", _args] call EFUNC(extension,sendData);
7171
};
7272

7373
case "endMission": {
@@ -79,7 +79,7 @@ switch (_eventName) do {
7979
} else {
8080
_message = _eventMessage;
8181
};
82-
[":EVENT:GENERAL:", [GVAR(captureFrameNo), _eventName, _side, _message]] call EFUNC(extension,sendData);
82+
[":EVENT:ENDMISSION:", [GVAR(captureFrameNo), _side, _message]] call EFUNC(extension,sendData);
8383
};
8484

8585
default {

0 commit comments

Comments
 (0)