Skip to content

Conversation

@skuzzis
Copy link
Member

@skuzzis skuzzis commented Oct 24, 2025

This pull request introduces several important changes across the codebase, focusing on improved safety when accessing schema fields, enhancements to the command line and schema extension modules, and updates to menu and engine services. The most significant update is the addition of a mechanism to block access to "dangerous" schema fields when a particular server guideline option is enabled, helping to ensure compliance and prevent misuse.

Schema Safety and Dangerous Field Handling

  • Automatic detection and blocking of dangerous schema fields:
    A list of "dangerous" fields is now maintained in both the schema generator and the runtime schema access layer. When the FollowCS2ServerGuidelines option is enabled, attempts to access or modify these fields will throw an exception, preventing unsafe operations. The generator now also prints out hashes of detected dangerous fields for developers. [1] [2] [3] [4]

Command Line Integration

  • New CommandLineService and interface registration:
    The CommandLineService class is introduced, implementing the ICommandLine interface and providing access to command line parameters. It is registered with the dependency injection container and exposed via the ISwiftlyCore interface, making command line operations available throughout the application. [1] [2] [3] [4] [5] [6] [7]

Schema Extension and Entity Enhancements

  • New schema extension methods and interfaces:
    Added the SetOrAddAttribute method to the CAttributeList interface and its implementation, allowing attributes to be set or added dynamically. The CBaseModelEntity interface and its implementation now support setting bodygroups by name and adjusting entity scale, expanding entity manipulation capabilities. [1] [2] [3] [4]

Engine and Event Improvements

  • Engine service property updates:
    The EngineService now retrieves several properties (such as map name, max players, tick count, and current time) directly from GlobalVars, improving accuracy and reducing reliance on native helpers. [1] [2]

  • Event parameter enhancement:
    The OnCommandExecuteHookEvent now includes the original command arguments, providing more context for event handlers.

Menu System Updates

  • Centralized menu management:
    Menu closing and opening operations are now routed through the MenuManager, ensuring consistent menu state handling across the application. [1] [2] [3] [4]

These changes collectively improve safety, extensibility, and maintainability, particularly by enforcing server guidelines and expanding the core API for plugins and modules.

@skuzzis skuzzis merged commit 029cb50 into master Oct 24, 2025
18 checks passed
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.

3 participants