Skip to content

Commit 2489932

Browse files
committed
refactor: replace yyjson with json extension and update related functionality
- Removed the dependency on the bundled yyjson library, replacing it with the sm-ext-json extension - Updated all references from YYJSON to JSON in the codebase, including method signatures and variable types - Adjusted HTTP request methods to utilize the new JSON handling interface - Enhanced task context management for WebSocket and HTTP operations to ensure proper cleanup and ownership - Updated documentation and README to reflect the changes in dependencies and usage instructions
1 parent f67bd9a commit 2489932

24 files changed

Lines changed: 2450 additions & 1914 deletions

AMBuildScript

Lines changed: 205 additions & 273 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ This is a [SourceMod](http://www.sourcemod.net/) extension that provides some me
1313
* Support HTTP RESTful API with JSON and form data
1414

1515
## Dependencies
16-
* [sm-ext-yyjson](https://github.com/ProjectSky/sm-ext-yyjson) - Required for JSON parsing and generation
16+
* [sm-ext-json](https://github.com/ProjectSky/sm-ext-json) - **Optional**. Required only for JSON-related features. If not installed, TEXT-based WebSocket communication and non-JSON HTTP features will still work
1717

1818
## Installation
19-
1. Download and install [sm-ext-yyjson](https://github.com/ProjectSky/sm-ext-yyjson/releases) first
19+
1. **(Optional)** If you need JSON functionality, download and install [sm-ext-json](https://github.com/ProjectSky/sm-ext-json/releases) first
2020
2. Download this extension from [sm-ext-websocket](https://github.com/ProjectSky/sm-ext-websocket/releases)
2121
3. Extract the files to your SourceMod directory
2222

@@ -42,7 +42,8 @@ ambuild
4242
- [x] WebSocket server support
4343
- [x] Windows support
4444
- [x] HTTP support
45-
- [x] Use sourcemod extension interface for JSON functionality instead of bundling yyjson library
45+
- [x] Use sourcemod extension interface for JSON functionality instead of bundling json library
46+
- [x] Allow JSON library as an optional dependency
4647

4748
## NOTES
4849
* Server will not process data during the hibernation. You can set sv_hibernate_when_empty to 0 to disable hibernation

0 commit comments

Comments
 (0)