Skip to content

Commit

Permalink
fix(api): return proper json objects
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Jan 17, 2025
1 parent bc22cca commit 1fc5888
Show file tree
Hide file tree
Showing 12 changed files with 144 additions and 168 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,6 @@ jobs:
mingw-w64-ucrt-x86_64-graphviz
mingw-w64-ucrt-x86_64-MinHook
mingw-w64-ucrt-x86_64-miniupnpc
mingw-w64-ucrt-x86_64-nlohmann-json
mingw-w64-ucrt-x86_64-nodejs
mingw-w64-ucrt-x86_64-nsis
mingw-w64-ucrt-x86_64-onevpl
Expand Down
1 change: 1 addition & 0 deletions cmake/compile_definitions/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
${CMAKE_THREAD_LIBS_INIT}
enet
libdisplaydevice::display_device
nlohmann_json::nlohmann_json
opus
${FFMPEG_LIBRARIES}
${Boost_LIBRARIES}
Expand Down
1 change: 0 additions & 1 deletion cmake/compile_definitions/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ list(PREPEND PLATFORM_LIBRARIES
libstdc++.a
libwinpthread.a
minhook::minhook
nlohmann_json::nlohmann_json
ntdll
setupapi
shlwapi
Expand Down
1 change: 1 addition & 0 deletions cmake/dependencies/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/Simple-Web-Server")
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/libdisplaydevice")

# common dependencies
include("${CMAKE_MODULE_PATH}/dependencies/nlohmann_json.cmake")
find_package(OpenSSL REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
Expand Down
18 changes: 18 additions & 0 deletions cmake/dependencies/nlohmann_json.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Loads the nlohmann_json library giving the priority to the system package first, with a fallback to FetchContent.
#
include_guard(GLOBAL)

find_package(nlohmann_json 3.11 QUIET GLOBAL)
if(NOT nlohmann_json_FOUND)
message(STATUS "nlohmann_json v3.11.x package not found in the system. Falling back to FetchContent.")
include(FetchContent)

FetchContent_Declare(
json
URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
URL_HASH MD5=c23a33f04786d85c29fda8d16b5f0efd
DOWNLOAD_EXTRACT_TIMESTAMP
)
FetchContent_MakeAvailable(json)
endif()
3 changes: 0 additions & 3 deletions cmake/dependencies/windows.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# windows specific dependencies

# nlohmann_json
find_package(nlohmann_json CONFIG 3.11 REQUIRED)

# Make sure MinHook is installed
find_library(MINHOOK_LIBRARY libMinHook.a REQUIRED)
find_path(MINHOOK_INCLUDE_DIR MinHook.h PATH_SUFFIXES include REQUIRED)
Expand Down
9 changes: 3 additions & 6 deletions docs/app_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,22 +301,19 @@ administrative privileges. Simply enable the elevated option in the WEB UI, or a
This is an option for both prep-cmd and regular commands and will launch the process with the current user without a
UAC prompt.

@note{It is important to write the values "true" and "false" as string values, not as the typical true/false
values in most JSON.}

**Example**
```json
{
"name": "Game With AntiCheat that Requires Admin",
"output": "",
"cmd": "ping 127.0.0.1",
"exclude-global-prep-cmd": "false",
"elevated": "true",
"exclude-global-prep-cmd": false,
"elevated": true,
"prep-cmd": [
{
"do": "powershell.exe -command \"Start-Streaming\"",
"undo": "powershell.exe -command \"Stop-Streaming\"",
"elevated": "false"
"elevated": false
}
],
"image-path": ""
Expand Down
1 change: 0 additions & 1 deletion docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ dependencies=(
"mingw-w64-ucrt-x86_64-graphviz" # Optional, for docs
"mingw-w64-ucrt-x86_64-MinHook"
"mingw-w64-ucrt-x86_64-miniupnpc"
"mingw-w64-ucrt-x86_64-nlohmann-json"
"mingw-w64-ucrt-x86_64-nodejs"
"mingw-w64-ucrt-x86_64-nsis"
"mingw-w64-ucrt-x86_64-onevpl"
Expand Down
Loading

0 comments on commit 1fc5888

Please sign in to comment.