Commit Graph

256 Commits

Author SHA1 Message Date
MSWS
dfd9b4f3c7 Use markdown for licenses 2025-08-05 05:59:12 -07:00
MSWS
066b6f9fb7 Remove absolute pathing in .envrc 2025-08-05 05:03:03 -07:00
MSWS
0ffd9e3773 Update CS# and licenses 2025-08-05 05:01:01 -07:00
Isaac
294fc9d3d7 Improve messaging / logging internals 2025-08-05 02:50:45 -07:00
MSWS
b34f91219e feat: Enhance message event handling and flexibility.
- Add handling logic for `BackgroundMsg` and `ScreenMsg` in `EventModifiedMessenger.cs`, including event dispatching for player-specific messages
- Update `PlayerBackgroundMessageEvent` to accept additional arguments with a params parameter
- Introduce generic type parameter `T` for `SimpleArgsSubstitution` to enhance flexibility in handling event types
- Modify `SimpleMessageSubstitution` to be generic with a type parameter `<T>`, ensuring `T` is a subclass of `PlayerMessageEvent`
- Add support for additional parameters in `PlayerScreenMessageEvent` constructor for flexible message formatting
- Refine message event handling in `MessageModificationTest`, parameterizing test instances with specific event types
2025-08-05 02:48:06 -07:00
MSWS
f54b1942b0 refactor: Refactor message formatting and substitution logic
- Add formatting functionality to `TestMessenger` and ensure consistency across methods
- Define `SimpleMessageSubstitution` class to modify player messages, with event handling and setup for unregistration
- Refactor `MessageModificationTest` to use new substitution classes, enhance test coverage and readability
- Create `SimpleArgsSubstitution` class for modifying message arguments, and improve event handling clarity
- Enhance `EventModifiedMessenger` with new methods and helper function, improve message broadcasting flexibility
2025-08-05 02:36:35 -07:00
MSWS
eb63152f61 refactor: Enhance message handling with added flexibility +semver:minor
```
Enhance Messaging and Event Handling System

- Expand GameMsgs.cs with new message types and improved structure, including methods for game state notifications and better command organization.
- Refactor PlayerJoinStarting.cs by simplifying messaging logic for cleaner code flow.
- Capitalize configuration descriptions in CS2GameConfig.cs for consistency and readability.
- Improve RoleAssigner.cs through code refactoring, optimizing argument passing for clarity.
- Add flexibility to PlayerMessageEvent.cs by introducing additional parameters for more robust event handling.

Implement Service and Localization Adjustments

- Update EventModifiedMessenger.cs to utilize IServiceProvider, adding conditional debug capabilities and preparing for future messaging enhancements.
- Transition CS2Messenger.cs from ILogger to direct console writes, supporting formatted message delivery.
- Introduce PlayerScreenMessageEvent and PlayerBackgroundMessageEvent classes to enhance player-specific event messaging.
- Leverage localization in RoundBasedGame.cs for message delivery, replacing hardcoded values and improving internationalization support.

Minor Code Enhancements and Cleanups

- Fix method signatures and imports across various files for improved consistency and readability.
- Adjust CS2Player.cs documentation for consistent terminologies.
- Clean diagram in lang/en.yml with the addition of customizable game messages for both start and cancellation scenarios.
```
2025-08-05 02:17:58 -07:00
Isaac
accd310240 Include preleases when determining versions, miscellaneous tweaks (#30) 2025-08-04 23:32:13 -07:00
MSWS
5d49a80a4a Merge branch 'main' into dev 2025-08-04 23:29:26 -07:00
MSWS
6ad656b7b2 refactor: Refactor connection handling in PlayerConnectionsHandler
- Refine settings in `TTT.sln.DotSettings` by consolidating XML tags and maintaining code style rules.
- Document missing parameter in `GiveWeapon` method of `IInventoryManager.cs`.
- Overhaul player connection logic in `PlayerConnectionsHandler.cs` by shifting focus to disconnection, replacing outdated methods, and organizing disposals.
- Note potential crash issue in `CombatHandler.cs` with a TODO, remove `OnTakeDamage` implementation, and prepare for future documentation improvements.
- Clean up `CreateGame` method in `CS2GameManager.cs` by eliminating obsolete code for better clarity.
2025-08-04 23:28:41 -07:00
MSWS
7f5cf07aae Remove unused code 2025-08-04 23:19:00 -07:00
MSWS
ef23b5dc15 Reformat and Cleanup 2025-08-04 23:15:07 -07:00
MSWS
a0c1724184 Include preleases when determining versions 2025-08-04 21:17:12 -07:00
MSWS
810150bdd5 refactor: Refactor damage handling in player events
- Modify `ArmorRemaining` property in `PlayerDamagedEvent.cs` to allow external updates and add validation for `HpLeft` to prevent invalid health values.
- Comment out old damage hooks in `CombatHandler.cs` and replace with new `OnPlayerDeath` and `OnPlayerHurt` handlers to improve event handling and consistency.
2025-08-04 21:08:49 -07:00
MSWS
17ef99bb0c Make debugs slightly more obvious 2025-08-04 20:50:23 -07:00
MSWS
2eeea9501d Remove format tests 2025-08-04 20:38:02 -07:00
MSWS
555fbfe87a Try alternative method of generating localizer 2025-08-04 20:19:13 -07:00
MSWS
0934dc86e0 Reformat 2025-08-04 20:04:03 -07:00
MSWS
aee181e352 Add more format tests 2025-08-04 19:52:23 -07:00
MSWS
740a8c14d1 refactor: Enhance extensibility and integrate CS2 system updates
Enhance Extensibility and Update API Integrations

- Make `Roles` property and `StartRound` method virtual in `RoundBasedGame.cs` to support subclass customization.
- Add logging and improve readability in `CCPlayerConverter.cs` for player conversion processes.
- Update method parameters and usage of `Server.NextWorldUpdateAsync()` in `CS2CommandManager.cs` for API adjustments.
- Add event listener registration and enhance logging in `PlayerConnectionsHandler.cs` for better handling of player connections.
- Integrate new roles and override method logic in `CS2Game.cs` for role management enhancement.

Additional changes:
- Update `CounterStrikeSharp.API` to version `1.0.331`.
- Improve `PlayerDeathEvent.cs` by removing unnecessary dead checks and making the `Victim` property non-nullable.
- Enhance event handling and logging in `Plugin/TTT.cs` for improved module loading and listener support.
- Refactor and enhance exception handling in `CombatHandler.cs` for robustness.
- Minor updates for consistency and readability across multiple files.
2025-08-04 19:07:12 -07:00
MSWS
0a68a0f060 Merge branch 'dev' 2025-08-03 04:34:15 -07:00
Isaac
882e6e70b6 test: Add validation for event listener methods +semver:patch (#29)
```
- Introduce InvalidListeners.cs to define and test invalid event listener scenarios.
- Add validation in EventBus to ensure listeners have valid event handler methods, throwing `InvalidOperationException` if invalid.
- Extend EventBusTest with new test cases for invalid listener registration, covering cases with no methods, no parameters, and incorrect parameters.
```
2025-08-03 04:31:23 -07:00
MSWS
51a95864e1 test: Add validation for event listener methods +semver:patch
```
- Introduce InvalidListeners.cs to define and test invalid event listener scenarios.
- Add validation in EventBus to ensure listeners have valid event handler methods, throwing `InvalidOperationException` if invalid.
- Extend EventBusTest with new test cases for invalid listener registration, covering cases with no methods, no parameters, and incorrect parameters.
```
2025-08-03 04:29:32 -07:00
MSWS
15b4e1c076 ci: Add label pattern extraction to changelog config
- Add new `label_extractor` configuration in `.github/changelogConfig.json` for enhanced label categorization based on title patterns, improving automation and organization in changelog generation.
2025-08-03 04:21:21 -07:00
MSWS
47bb7c3871 ci: Revamp changelog config; update workflows +semver:minor
- Delete `changelogConfig.json` to phase out or relocate changelog configurations.
- Update `.github/workflows/release.yml` to modify the `Generate Changelog` path and introduce a new "HYBRID" mode, improving changelog generation.
- Adjust `.github/workflows/release.yml` to limit the `Create GitHub Release` step to specific branches for a more efficient release process.
- Add `.github/changelogConfig.json` to include new templates and change categorization, refining the changelog structure.
2025-08-03 04:16:46 -07:00
MSWS
77a91c72f9 Fix mv command 2025-08-03 04:02:21 -07:00
MSWS
e2f9e3cd99 ci: Configure changelog generator with json file
- Add configuration for changelog generator in release workflow
2025-08-03 03:57:59 -07:00
MSWS
5c93690ab1 ci: Update release workflow and add changelog config
- Modify the artifact download step in `.github/workflows/release.yml` to skip unpacking and change the path.
- Add a new step in `.github/workflows/release.yml` to rename the artifact by appending the GitVersion output to its name.
- Update the changelog builder action to version 5 in `.github/workflows/release.yml`.
- Adjust the file reference in the release creation step in `.github/workflows/release.yml` to use the newly renamed artifact.
- Add `changelogConfig.json` configuration file with templates and defined categories for changelog items.
- Include logic in `changelogConfig.json` to ignore labels like "wip" and "ignore" and configure sorting order and template for entries.
2025-08-03 03:57:26 -07:00
MSWS
4d7e109ccf ci: Refactor release workflow permissions configuration
- Update release workflow to allow read access to pull requests.
- Modify changelog generation step to use `with:` for token input configuration.
2025-08-03 03:44:38 -07:00
Isaac
950cfa12c8 ci: Use ACTIONS_GET_PR for changelog token retrieval (#28)
- Update token retrieval in release workflow to use `ACTIONS_GET_PR`
secret instead of `GITHUB_TOKEN`.
2025-08-03 03:41:41 -07:00
MSWS
fff14f170c ci: Use ACTIONS_GET_PR for changelog token retrieval
- Update token retrieval in release workflow to use `ACTIONS_GET_PR` secret instead of `GITHUB_TOKEN`.
2025-08-03 03:38:54 -07:00
Isaac
4f3159d9c0 Include github token into changelog generator (#27) 2025-08-03 03:26:36 -07:00
MSWS
f26096c165 Merge branch 'main' into dev 2025-08-03 03:23:35 -07:00
MSWS
4b3fc19a8c Merge branch 'main' of github.com:MSWS/TTT 2025-08-03 03:23:27 -07:00
MSWS
9aa0b13e23 ci: Update release workflow for consistency and clarity
- Adjust workflow trigger condition in `.github/workflows/release.yml` to require a successful previous run.
- Update syntax for branch extraction using GitHub Actions expression in the release workflow.
- Bump `actions/checkout` to version v4.
- Modify GitVersion setup and execution to use version v4.0.1.
- Introduce conditions for creating a GitHub release only from the 'main' or 'dev' branch.
- Enhance the `Create GitHub Release` step with dynamic attributes.
- Apply formatting changes for improved clarity.
2025-08-03 03:22:36 -07:00
Isaac
f1088e458f CI Fixes (#26) 2025-08-03 03:19:43 -07:00
MSWS
3c77d5fdc1 ci: Simplify release workflow and quote names
- Remove .NET setup step in release workflow to reflect changes in dependencies or build process
- Quote workflow name in "Download artifact" step for consistency and to prevent YAML parsing issues
2025-08-03 03:15:54 -07:00
MSWS
685b3c3e61 ci: Correct artifact name in release workflow
- Update artifact download step in release workflow to use 'nightly.yml' for consistency and reference correction
2025-08-03 03:13:59 -07:00
Isaac
dcb7e82796 More CI fixes 2025-08-03 03:10:44 -07:00
MSWS
43f9a81783 ci: Update workflow trigger to 'dev' branch pushes
- Update GitHub Actions workflow to trigger on pushes to 'dev' branch instead of specific path patterns
2025-08-03 03:09:15 -07:00
Isaac
d1fe0ac606 Merge branch 'main' into dev 2025-08-03 03:08:20 -07:00
MSWS
64fceac34f ci: Update release workflow for branch flexibility
- Remove branch specification in 'Download artifact' step in release workflow to allow applicability to any branch
- Update conditional logic for creating GitHub Release to check for 'main' or 'dev' branches only
2025-08-03 03:07:34 -07:00
MSWS
7d5d7d48c3 Update artifact name 2025-08-03 03:05:56 -07:00
Isaac
21dcbf0e5a Merge pull request #24 from MSWS/dev
Fix artifact downloading
2025-08-03 03:02:33 -07:00
MSWS
6eafcb8a8c ci: Trigger nightly on release.yml file changes
- Update nightly workflow to trigger on changes to release.yml file
2025-08-03 02:57:36 -07:00
MSWS
464bad701b Merge branch 'dev' of github.com:MSWS/TTT into dev 2025-08-03 02:56:25 -07:00
MSWS
defb67b2d6 ci: Update artifact download action in release workflow
- Consolidate artifact download step in release workflow by removing duplicate actions and updating to `dawidd6/action-download-artifact`
- Add parameters for branch and workflow in artifact download step for more precise fetching
- Maintain conditional branching for GitHub release creation based on the triggering branch within the workflow
2025-08-03 02:56:07 -07:00
MSWS
7101acbdbc ci: Refine artifact handling in release workflow
- Update `.github/workflows/release.yml` to add new action permissions and refine artifact handling
- Introduce step to download 'ttt-nightly' artifact using `dawidd6/action-download-artifact@v11`
- Modify execution approach in existing build artifact download step
2025-08-03 02:55:30 -07:00
MSWS
47e81268f1 ci: Update artifact download step and permissions
- Update release workflow to improve artifact download process
  - Change artifact download action to `dawidd6/action-download-artifact@v11` and configure additional settings
  - Adjust permissions to include read access for actions
  - Rename download step ID to `download-artifact` for consistency
2025-08-03 02:45:54 -07:00
Isaac
86eab269f7 Add Credit-Based Shop System and Refactor Core TTT APIs
> ## Pull Request Overview
> 
> This is a large development pull request that adds a comprehensive shop system to the TTT plugin and refactors several core components. The changes include implementing a credit-based shop system with purchasable items, updating APIs to be more flexible with nullable types, and improving the command system architecture.
> 
> Key changes:
> 
>     * Added complete shop system with credits, items, and purchase mechanics
> 
>     * Refactored storage interfaces to support nullable return types
> 
>     * Updated messaging and command systems with improved architecture
> 
>     * Enhanced weapon system with ammo management capabilities
> 
> 
> ### Reviewed Changes
> 
> Copilot reviewed 91 out of 91 changed files in this pull request and generated 5 comments.
> Show a summary per file
> File 	Description
> TTT/Shop/* 	New shop module with credit system, purchasable items, and commands
> TTT/API/Storage/* 	Updated storage interfaces to support nullable return types
> TTT/API/Messages/* 	Simplified messenger interface by removing IOnlineMessenger
> TTT/Game/Commands/* 	Added TTT command and refactored CommandManager architecture
> TTT/CS2/* 	Updated CS2-specific implementations for new APIs
> TTT/Test/* 	Updated test infrastructure for new command and storage patterns
2025-08-03 02:40:45 -07:00