fix: detect server admin status on connect for diary controls#77
fix: detect server admin status on connect for diary controls#77
Conversation
The "connect" case in adminUIcontrol only checked the administratorList CBA setting, never querying Arma's actual admin state. When loading a mission while already logged in as server admin, OnUserAdminStateChanged doesn't fire (state didn't change) and the connect path missed the player. Now also checks `admin _owner > 0` on connect.
Summary of ChangesHello @fank, 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 resolves an issue where server administrators might not see their diary controls if they were already logged in as an admin when a mission started. It introduces a direct check for a player's server admin status upon connection, ensuring that controls are correctly assigned based on their actual administrative privileges, thereby improving the reliability of admin tool access. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request correctly identifies and fixes an issue where server admins who are already logged in when a mission starts don't receive the OCAP admin diary controls. The solution of checking admin _owner > 0 on connect is sound and has been applied to both cases: where an administratorList is defined and where it is not. I've suggested one minor improvement to ensure controls are not added redundantly, bringing it in line with similar checks elsewhere in the file.
Summary
"connect"case infnc_adminUIcontrolonly checked theadministratorListCBA setting — it never queried Arma'sadmincommand for actual server admin statusOnUserAdminStateChangedonly fires on state changes, so if you're already admin when the mission loads, it never firesadministratorListadmin _owner > 0on connect, in both the "no admin list configured" and "admin list exists" branchesTest plan
administratorList, load mission → controls appear (existing behavior preserved)administratorList→ no controls granted