Conversation
…d default settings
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a comprehensive refactor of the GM commands configuration system, adding per-account overrides and default settings. The changes enable more granular control over GM command permissions by allowing custom GM levels and command lists for individual accounts while providing default fallback settings.
Key changes:
- Replace simple account ID and command lists with a flexible configuration system supporting per-account overrides
- Add default GM level and command list configuration options that apply to all managed accounts unless specifically overridden
- Implement automatic security level management during player login to ensure configured GM levels are applied
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/GmCommands.h | Refactored class interface with new account configuration structures and methods for handling per-account settings |
| src/GmCommands.cpp | Complete implementation rewrite with configuration file parsing, account management, and command permission logic |
| conf/mod_gm_commands.conf.dist | Updated configuration file with new default settings and per-account override options |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…nd usage instructions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR: Introduce per-account configurations for GM commands, allowing custom GM levels and command lists, along with default settings for accounts without specific overrides. Setting a GM Level (at least 1) is important to make some features to work - such as the keeping the player extra flags permanent after the relog (e.g. gm on/visible flags)
This pull request introduces a major refactor and extension of the GM commands configuration system. The changes provide more granular control over which accounts can use GM commands, their permission levels, and the commands available to them. The configuration file now supports per-account overrides, default levels, and command lists, while the codebase is updated to support these new features with a more robust and flexible structure.
Configuration enhancements:
GmCommandsModule.DefaultLevel) and a default allowed command list (GmCommandsModule.DefaultCommands) inconf/mod_gm_commands.conf.dist. These apply to all managed accounts unless overridden per account. Per-account overrides for both level and allowed commands are now supported.Codebase refactor and feature additions:
LoadAccountIdsandLoadAllowedCommandsmethods with a singleReloadmethod inGMCommands, reflecting the new configuration structure.AccountConfigurationstruct, supporting optional GM level and allowed command set for each account.IsCommandAllowednow considers both the account ID and the specific command, supporting per-account and default command lists.