Skip to content

Commit

Permalink
Fix Twitch dashboard showing cooldowns even when not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
gottagofaster236 committed May 10, 2024
1 parent cb3f491 commit 019d7ac
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
print "CODESIGN_IDENT_INSTALLER=${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}" >> $GITHUB_ENV
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
uses: lukka/run-vcpkg@6fe69898af670ac05f4a8427cc5cff4fb361cee5
env:
VCPKG_DEFAULT_TRIPLET: ${{ (matrix.arch == 'arm64' && 'arm64-osx') || 'x64-osx' }}
with:
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
run: sudo apt-get install gcc-12 g++-12

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
uses: lukka/run-vcpkg@6fe69898af670ac05f4a8427cc5cff4fb361cee5
with:
vcpkgDirectory: '${{ github.workspace }}/plugin/vcpkg'
doNotUpdateVcpkg: true
Expand Down Expand Up @@ -336,7 +336,7 @@ jobs:
"found=$(([string]${LabelFound}).ToLower())" >> $env:GITHUB_OUTPUT
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
uses: lukka/run-vcpkg@6fe69898af670ac05f4a8427cc5cff4fb361cee5
env:
VCPKG_DEFAULT_TRIPLET: ${{ format('{0}-windows-static-md', matrix.arch) }}
with:
Expand Down
4 changes: 2 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ These steps are a continuation of the previous section on building.

1. Install [pre-commit](https://pre-commit.com/) and run `pre-commit install` in the root of the repository in order to format code automatically before a commit. (This uses [.pre-commit-config.yaml](.pre-commit-config.yaml) and [.cmake-format.json](.cmake-format.json)).
2. Navigate to `../obs-studio`. OBS Studio should be cloned already by the build script. Then build it according to the instructions on the [OBS website](https://obsproject.com/wiki/Building-OBS-Studio).
2. Open the `RewardsTheater/build64` directory. Open `CMakeCache.txt` and add the following line: ```OBS_BUILD_DIR:FILEPATH=../../obs-studio/build64```
2. Open the `RewardsTheater/build_x64` directory. Open `CMakeCache.txt` and add the following line: ```OBS_BUILD_DIR:FILEPATH=../../obs-studio/build64```

Then build RewardsTheater again via the build script.
3. Open the project in Visual Studio. Right-click the `ALL_BUILD` project and set the debugging target to the OBS binary at `your_obs_clone_path\obs-studio\build64\rundir\Debug\bin\64bit\obs64.exe`, and the working directory to `your_obs_clone_path\obs-studio\build64\rundir\Debug\bin\64bit`. Now when you hit "Run" inside Visual Studio, the plugin is copied automatically to the rundir and then VS launches OBS for debugging.
3. Open the project in Visual Studio. Right-click the `ALL_BUILD` project. Select "Debug" in the "Configuration:" dropdown. Set the "Command:" to the OBS binary at `your_user_dir\source\repos\obs-studio\build64\rundir\Debug\bin\64bit\obs64.exe`, and the working directory to `your_user_dir\source\repos\obs-studio\build64\rundir\Debug\bin\64bit`. Now when you hit "Run" inside Visual Studio, the plugin is copied automatically to the rundir and then VS launches OBS for debugging.

## Building locally on Linux
1. Install GCC 12 (or later) via `sudo apt install gcc-12 g++-12` (use your favorite package manager).
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.20)
cmake_policy(SET CMP0111 OLD)

project(RewardsTheater VERSION 1.0.5)
project(RewardsTheater VERSION 1.0.6)
add_library(${CMAKE_PROJECT_NAME} MODULE)

# Replace `Your Name Here` with the name (yours or your organization's) you want to see as the
Expand Down
24 changes: 9 additions & 15 deletions buildspec.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
{
"dependencies": {
"obs-studio": {
"version": "29.1.2",
"version": "30.0.0",
"repository": "https://github.com/obsproject/obs-studio.git",
"branch": "master",
"hash": "e15a92e16fc3827027a956f6d6a1223b41aced61"
"hash": "34ef67e212f24a085a63705a0ab81e3401c8eca4"
},
"prebuilt": {
"version": "2023-04-12",
"version": "2023-10-09",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-Built obs-deps",
"hashes": {
"macos-x86_64": "81120ffa33bb050c6c5fcd236e5cedfd7b80f7053fdba271fead5af20be0b5f5",
"macos-arm64": "b9bab79611774c4651d084e14259abe889d2b8d1653787a843d08cf3f0db881c",
"macos-universal": "9535c6e1ad96f7d49960251e85a245774088d48da1d602bb82f734b10219125a",
"windows-x64": "c13a14a1acc4224b21304d97b63da4121de1ed6981297e50496fbc474abc0503",
"linux-x86_64": "056425a8a7a4a0c242ed5ab9c1eba4dd6b004386877de4304524e7bea11c0ee2"
"windows-x64": "7585ba9cc470c1f668af6d51efe6da211b16822b884382817750d9e8b502a81c",
"linux-x86_64": "856a51a53981b1bd3f5e5b9670a0924f70473353e669fce52e64d5d730209564"
}
},
"qt6": {
"version": "2023-04-12",
"version": "2023-10-09",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-Built Qt6",
"hashes": {
"macos-x86_64": "2622d6ecd484a596da12b6a45b709fe563821eda558d0bbb27335c8c2f63945c",
"macos-arm64": "4f72aa1103d88a00d90c01bb3650276ffa1408e16ef40579177605483b986dc9",
"macos-universal": "eb7614544ab4f3d2c6052c797635602280ca5b028a6b987523d8484222ce45d1",
"windows-x64": "4d39364b8a8dee5aa24fcebd8440d5c22bb4551c6b440ffeacce7d61f2ed1add"
"windows-x64": "feadb745e622fb81aa1cdcdc1179baef4c4442d15cb8f0212cb7ceda0f1911df"
},
"debugSymbols": {
"windows-x64": "f34ee5067be19ed370268b15c53684b7b8aaa867dc800b68931df905d679e31f"
"windows-x64": "3c43ae5293051958bc024af3083b3a60c4c4fac2629f88446dbc671d22d9f997"
}
}
},
Expand Down Expand Up @@ -64,7 +58,7 @@
}
},
"name": "RewardsTheater",
"version": "1.0.5",
"version": "1.0.6",
"author": "gottagofaster",
"email": "[email protected]"
}
5 changes: 5 additions & 0 deletions src/RewardsTheaterPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ void RewardsTheaterPlugin::checkMinObsVersion() {
}

void RewardsTheaterPlugin::checkRestrictedRegion() {
if (std::getenv("container")) {
// Inside Flatpak
return;
}

if (std::strcmp(obs_get_locale(), "ru-RU") != 0) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/TwitchRewardsApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,11 @@ json::value TwitchRewardsApi::rewardDataToJson(const RewardData& rewardData) {
{"is_enabled", rewardData.isEnabled},
{"background_color", rewardData.backgroundColor.toHex()},
{"is_max_per_stream_enabled", rewardData.maxRedemptionsPerStream.has_value()},
{"max_per_stream", rewardData.maxRedemptionsPerStream.value_or(1)},
{"max_per_stream", rewardData.maxRedemptionsPerStream.value_or(0)},
{"is_max_per_user_per_stream_enabled", rewardData.maxRedemptionsPerUserPerStream.has_value()},
{"max_per_user_per_stream", rewardData.maxRedemptionsPerUserPerStream.value_or(1)},
{"max_per_user_per_stream", rewardData.maxRedemptionsPerUserPerStream.value_or(0)},
{"is_global_cooldown_enabled", rewardData.globalCooldownSeconds.has_value()},
{"global_cooldown_seconds", rewardData.globalCooldownSeconds.value_or(1)},
{"global_cooldown_seconds", rewardData.globalCooldownSeconds.value_or(0)},
{"should_redemptions_skip_request_queue", false},
};
}
Expand Down
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 5659 files

0 comments on commit 019d7ac

Please sign in to comment.