Skip to content

feat: script-side focus range commands#94

Merged
fank merged 4 commits intomainfrom
feat/script-side-focus
Mar 6, 2026
Merged

feat: script-side focus range commands#94
fank merged 4 commits intomainfrom
feat/script-side-focus

Conversation

@fank
Copy link
Copy Markdown
Member

@fank fank commented Mar 6, 2026

Summary

Adds OCAP_setFocusStart and OCAP_setFocusEnd CBA server events for mission makers to define a playback focus range from SQF.

  • Optional explicit frame number parameter, defaults to current capture frame
  • Sends :MISSION:FOCUS_START: / :MISSION:FOCUS_END: to the extension

Usage

// Trim prep phase (end auto-filled at save time)
["OCAP_setFocusStart"] call CBA_fnc_serverEvent;

// Explicit frame numbers
["OCAP_setFocusStart", [120]] call CBA_fnc_serverEvent;
["OCAP_setFocusEnd", [850]] call CBA_fnc_serverEvent;

// Mark end of action (start defaults to 0)
["OCAP_setFocusEnd"] call CBA_fnc_serverEvent;

Companion PR

fank added 3 commits March 6, 2026 19:28
Add fnc_setFocusStart and fnc_setFocusEnd which send
:MISSION:FOCUS_START: and :MISSION:FOCUS_END: to the extension.
Register both as PREP functions and CBA server events
(OCAP_setFocusStart, OCAP_setFocusEnd) with listener handles.
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement to the OCAP2 recording system by empowering mission makers to programmatically control the playback focus range. By exposing OCAP_setFocusStart and OCAP_setFocusEnd as CBA server events, users can now precisely define the most relevant segments of their recorded missions directly within their SQF scripts. This eliminates the need for manual post-upload adjustments in the web UI, streamlining the workflow and ensuring that recordings highlight critical moments as intended by the mission creator.

Highlights

  • New Script-Side Focus Range Commands: Introduced OCAP_setFocusStart and OCAP_setFocusEnd CBA server events, enabling mission makers to define a playback focus range directly from SQF scripts.
  • Optional Frame Number Parameter: The new focus commands accept an optional explicit frame number, defaulting to the current capture frame if not provided.
  • Extension Communication: The addon now sends :MISSION:FOCUS_START: and :MISSION:FOCUS_END: commands to the OCAP2 extension, facilitating dynamic control over recording highlights.
Changelog
  • addons/recorder/XEH_prep.sqf
    • Registered setFocusStart and setFocusEnd functions for global access.
  • addons/recorder/fnc_addEventMission.sqf
    • Updated documentation to include new focus listener handles.
    • Implemented event handlers for OCAP_setFocusStart and OCAP_setFocusEnd CBA events, which call the respective focus functions.
  • addons/recorder/fnc_setFocusEnd.sqf
    • Created a new function OCAP_recorder_fnc_setFocusEnd to set the playback focus end frame and send the corresponding command to the extension.
  • addons/recorder/fnc_setFocusStart.sqf
    • Created a new function OCAP_recorder_fnc_setFocusStart to set the playback focus start frame and send the corresponding command to the extension.
  • docs/plans/2026-03-06-script-side-focus-design.md
    • Added a new design document outlining the problem, proposed solution, and data flow for script-side focus range functionality.
  • docs/plans/2026-03-06-script-side-focus-plan.md
    • Added a new implementation plan document detailing the step-by-step tasks for both the extension and addon to implement script-side focus range.
Activity
  • No specific activity (comments, reviews, progress) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new feature to set a playback focus range from SQF scripts, which is a valuable addition for mission makers. However, a critical security vulnerability exists as the newly added CBA server events lack proper access control, potentially allowing any player to manipulate the recording's focus range; implementing admin authorization checks for these event handlers is recommended. Furthermore, there is a critical issue in the argument parsing within fnc_setFocusStart.sqf and fnc_setFocusEnd.sqf, where the event name is incorrectly used as the frame number, which will cause errors.

Comment thread addons/recorder/fnc_setFocusEnd.sqf
Comment thread addons/recorder/fnc_setFocusStart.sqf
Comment thread addons/recorder/fnc_addEventMission.sqf
Comment thread addons/recorder/fnc_addEventMission.sqf
Design and plan docs served their purpose during implementation.
@fank fank merged commit 350260b into main Mar 6, 2026
1 check passed
@fank fank deleted the feat/script-side-focus branch March 6, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant