```
Refactor and optimize multiple components
- Remove obsolete attributes and unused dependencies in `IEventBus.cs`, `KarmaListener.cs`, `KarmaSyncer.cs`, and `ICommandManager.cs` to clean up code and improve maintainability.
- Enhance asynchronous event handling in `EventModifiedMessenger.cs` by integrating `await` for dispatch operations, improving consistency in message processing.
- Refine `CombatHandler.cs` logic with improved null-checking and better statistics handling, enhancing robustness during player events.
- Enable caching by default in `KarmaStorage.cs`, and update karmas asynchronously to boost performance.
- Simplify `Game/RoundBasedGame.cs` by removing unnecessary dependencies and improving state management and role assignment logic, enhancing game flow control.
```
Refactor and Simplify Codebase with Improved Readability and Efficiency
- **OneShotDeagle.cs:**
- Remove event-related dependencies and streamline class to focus on core functionality.
- **PlayerKillListener.cs:**
- Simplify `OnKill` method, preparing for future enhancements, and clean up unused code.
- **IListener.cs and IEventBus.cs:**
- Remove `IDisposable` dependency from `IListener`. Add obsolescence message for `RegisterListener` in `IEventBus`.
- **LogsCommand.cs and TTTCommand.cs:**
- Consolidate logic for game checking and logging, enhancing error handling and readability.
- **RoundTimerListener.cs and CombatHandler.cs:**
- Refactor event handlers for clear separation of responsibilities and process optimization.
- **Various CS2 Handlers and Commands:**
- Streamline and modularize event handling and role management with newly introduced helper methods across handlers.
- Refactor command logic for improved organization and maintenance.
- **Locale/StringLocalizer.cs and EventBus.cs:**
- Refactor string handling and listener registration for enhanced clarity and performance.
```
- Simplify and enhance `PlayerActionsLogger.cs` by using pattern matching for game status checks and improve logging calls with a `Provider` parameter.
- Update `DeathAction.cs` to support dependency injection and role management by modifying constructors and formatting methods.
- Add role management in `FakeAction.cs` by introducing `PlayerRole` and `OtherRole` properties.
- Mark `IsGameActive` in `IGameManager.cs` as obsolete to guide towards direct game state checks.
- Modify logging in `BodyIdentifyLogger.cs` to use a `Provider` parameter for better context.
- Improve role management in `IdentifyBodyAction.cs` with new properties and constructor overloads supporting dependency injection.
- Refactor `ActionTest.cs` to accommodate constructor changes in `FakeAction`, ensuring backward compatibility.
- Expand `IAction` interface with role properties and enhance `Format` method.
- Add footer text in `en.yml` and `GameMsgs.cs` for clearer game log outputs.
- Enhance `DamagedAction.cs` with dependency injection and role properties, improving role management.
- Adjust `CombatHandler.cs` to refine player event handling and platform checks.
- Clear up documentation comments in `StringLocalizer.cs`.
- Enhance `SimpleLogger.cs` with role management and improved log formatting.
- Deprecate `IsInProgress()` in `IGame` for more explicit game state checks.
```
- Reformat debug messages in `CS2Messenger.cs` for improved readability and structure.
- Update color for `ColoredRole` name in `ColoredRoleTest.cs` from red to dark blue.
- Enhance efficiency and clarity in `StringLocalizer.cs` by refining placeholder handling and vowel sound logic.
- Add color-coding to role identification in `GameMsgs.cs` to improve visual feedback during player identification.
- Adjust interaction distance and improve state management in `PropMover.cs` for better control and performance.
```
Enhance Game Functionality and Logging Capabilities
- Update `GameMsgs.cs` to utilize explicit `Name` properties for data retrieval and introduce a new dependency on `CounterStrikeSharp.API.Modules.Utils`.
- Modify `PropMover.cs` to adjust minimum look accuracy, improving precision requirements.
- Extend `SimpleLogger.cs` with new logging methods for individual and all players, enhancing overall logging functionality.
- Revise `CS2CommandManager.cs` to improve code base structure by removing redundancy and ensuring correct method order.
- Update `CommandManager.cs` by implementing `ITerrorModule`, adding modularity and logging command capabilities.
- Enhance `IActionLogger.cs` with new logging methods integrating player functionalities.
- Introduce `LogsCommand.cs` to manage and display active game logs with error handling for inactive games.
- Adjust `StringLocalizer.cs` to refine character evaluation in text handling.
- Revise `en.yml` color schemes for consistency in message display.
- Simplify `GameEndLogsListener.cs` for better efficiency by using `PrintLogs()` method.
- Introduce a new 'MONITOR' priority level in `EventHandlerAttribute.cs` for more granular event handling priorities.
```
Refactor role management and simplify codebase
- **RoleAssignerTest.cs**: Update tests to use `assigner.GetRoles(p)` for role retrieval, ensuring consistency across tests.
- **Program.cs**: Remove error handling for YAML parsing, maintaining functionality in argument parsing and JSON conversion.
- **RoundBasedGameTest.cs**: Integrate `IRoleAssigner`, modifying role checks and simplifying test assertions.
- **IGame.cs**: Add `RoleAssigner` property and refactor role retrieval methods to streamline role management.
- **Multiple Files**: Implement `IRoleAssigner` across various components, enhancing role management consistency and simplifying code by removing direct role access.
```
Implement Various Enhancements and Refactoring Across Multiple Modules
- Update RoleAssignListener.cs: Remove unused imports, add module metadata with new public properties, and reorganize method structure for clarity. Implement new Start method and improve efficiency in onTransmit logic.
- Optimize SimpleLogger.cs by utilizing full date and time for dictionary keys, enhancing logging precision.
- Adjust role assignment process in BaseRole.cs, TraitorRole.cs, DetectiveRole.cs, and InnocentRole.cs to conditionally strip weapons based on new GameConfig.cs setting, StripWeaponsPriorToEquipping.
- Refine SetRoleCommand.cs by reorganizing imports and enhancing role assignment logic, ensuring dynamic role selection and clear messaging.
- Enhance RoundBasedGame.cs with new inventory management component to standardize player inventories at the start of each round and leverage dependency injection for external services.
- Conduct miscellaneous refactorings and performance improvements, including test updates, import optimizations, and enhanced logging across multiple files.
```
```
Refactor codebase for improved readability, maintainability, and performance
- TTT/CS2/GameHandlers/CombatHandler.cs: Remove unused directives, reorder methods, and apply minor formatting changes.
- TTT/Game/RoundBasedGame.cs: Optimize `Start` method logic, improve game state transitions, enhance messaging logic, and ensure proper resource cleanup.
- TTT/CS2/CS2InventoryManager.cs: Refine `RemoveWeapon` function by cleaning up parameters and improving weapon removal handling.
- TTT/API/Game/IGame.cs: Rename `GetRole` to `GetOfRole` and enhance `GetAlive` method flexibility with new parameters.
- TTT/Plugin/TTT.cs: Eliminate unused library references for cleaner code.
- Various Files: Remove unused directives, reorder methods for better readability, and improve file organization across multiple files.
```
- Modify `GAME_STATE_STARTED` message in `GameMsgs.cs` for grammatical accuracy and clarity regarding the number of traitors.
- Add new translation entries for "AN_RED_ELEPHANT" and "AN_RED_BALL" in `Test/lang/en.yml`.
- Update `Game/lang/en.yml` to use variable placeholders for role messages.
- Expand locale message templates by adding new constants in `Test/Locale/TestMsgs.cs`.
- Implement additional localization and formatting tests in `LocaleTest.cs`.
- Enhance `RoundBasedGameTest.cs` with tests for role messages, game start scenarios, and end conditions.
- Improve string handling in `StringLocalizer.cs` with utility functions and updated trimming methods.
- Enhance `RoundTimerListener` by making `TerminateRoundFunc` a `readonly` static field and using `Server.NextWorldUpdate` for deferred execution.
- Update `OnRoundStart` and `OnRoundEnd` for improved timer functionality and team balance in `RoundTimerListener`.
- Change service lifecycles in `Startup` from transient to scoped for `IScheduler` and `IMsgLocalizer`.
- Simplify vowel sound logic in `StringLocalizer` using switch expressions for article determination.
- Refactor `CombatHandler` to focus on event-driven architecture and simplify damage handling.
- Remove console logging from `IGame`'s `GetAlive` method to streamline and enhance performance.
```
- Add new localization strings and variations in `TTT/Test/lang/en.yml` for testing scenarios.
- Remove debug-only command and enhance error logging in `TTT/CS2/CS2CommandManager.cs` for better debugging support.
- Implement player respawn and improve round ending behavior in `TTT/CS2/Listeners/RoundTimerListener.cs`.
- Add article handling support and update methods for `%an%` placeholders in `Locale/StringLocalizer.cs`.
- Expand test message capabilities with new constants and methods in `TTT/Test/Locale/TestMsgs.cs`.
- Simplify role assignment logic by removing event instantiation in `TTT/CS2/Listeners/RoleAssignListener.cs`.
- Enhance access control and fix game state transition logic in `TTT/Game/RoundBasedGame.cs`.
- Update round management with new static method and using directives in `TTT/CS2/RoundUtil.cs`.
- Modify role assignment messages for grammatical accuracy in `TTT/Game/lang/en.yml`.
- Improve round-end logic and add necessary checks in `TTT/CS2/GameHandlers/RoundEndHandler.cs`.
- Clarify role name usage in message creation in `TTT/Game/GameMsgs.cs`.
- Introduce new event handling and state checks in `TTT/CS2/CS2Game.cs`.
- Add comprehensive tests for article localization and substitution in `TTT/Test/Locale/LocaleTest.cs`.
```
```
- Remove unused namespace imports across multiple files to clean up code.
- Reorganize constructors, fields, and method orders for improved readability and consistency in various classes, including `RoundBasedGame`, `PlayerActionsTest`, and `GameTest`.
- Change expression-bodied methods to block-bodied methods in `EndReason`, `IGameManager`, and other API classes for consistency.
- Add, remove, or adjust newlines and braces to improve code structure and maintainability.
- Refactor `CombatHandler` to introduce memory module imports, update event dispatch logic, and improve damage-handling workflows.
```
* Add Admin Data
* Create Command Result Enum
* Prep For Tests
* add TODO
* implement commandinfo
* create command interface
* gAdd Admin Data
# Conflicts:
# TTT/CS2/CS2Player.cs
* Create Command Result Enum
* Prep For Tests
* add TODO
* implement commandinfo
* create command interface
* Refactor out inventory and permission to their own interfaces
* Resolve reverse group perm check
---------
Co-authored-by: ShookEagle <shookeagle@gmail.com>
* Overhaul locale structure
* Reformat & Cleanup
* refactor: Refactor roles to use dependency injection.
```
Introduce dependency injection and refactor role architecture
- Refactor `RoleAssignerTest` to use `IServiceProvider` for dependency injection, update role initialization, and align test cases accordingly.
- Update `IOnlinePlayer` and `IGame` interfaces to use the fully qualified namespace for roles and modify method signatures to reflect new role architecture.
- Add `BaseRole` abstract class and refactor role classes (e.g., `InnocentRole`, `DetectiveRole`, `TraitorRole`, `RatioBasedRole`) to inherit from it, implementing dependency injection and overriding key properties and methods.
- Introduce new storage interfaces (`IStorage<T>`, `IWriteable<T>`, `IKeyedStorage<T>`) for improved configuration management and add related test implementations (e.g., `FakeConfig`, `MemoryStorage`).
- Add `GameConfig` class for configurable game and round settings, implement `CS2GameConfig` class to manage configuration storage and plugin module lifecycle, and refactor `RoundBasedGame` to leverage the new configuration structure.
```
* Fix lang copying
* Rename step
* Add debug
* Fix path
```
Introduce IMsgLocalizer interface and improve localization functionality
- Extend `StringLocalizer` to support `IMsg` object localization and implement the new `IMsgLocalizer` interface.
- Update `.github/workflows/dotnet.yml` to use newer Actions versions, enable coverage tracking, and generate dynamic coverage badges.
- Add `IMsgLocalizer` interface and implement localization indexer in `IMsgLocalizer.cs`.
- Update dependency injection in `Startup.cs` to register `IMsgLocalizer` and refine localization services.
- Improve tests in `LocaleTest.cs` to validate `IMsgLocalizer` usage, placeholder substitution, and remove redundant assertions.
Minor: Adjust `en.yml` formatting by removing unnecessary quotes.
```