-
-
Save Meister1593/b574b399d85770abc2368f4d5af9df42 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
echo "Latest known working version for patching: 2.3.5" | |
if [[ -z "$1" ]]; then | |
echo 'Enter absolute path to SteamVR (for example, /home/user/.local/share/Steam/steamapps/common/SteamVR)' | |
read STEAMVR_PATH | |
else | |
STEAMVR_PATH="$1" | |
fi | |
PATH_TO_PATCHING_FILE="$STEAMVR_PATH/resources/webinterface/dashboard/vrwebui_shared.js" | |
if [[ ! -f $PATH_TO_PATCHING_FILE ]]; then | |
echo "Couldn't find required file for patch, aborting" | |
exit 1 | |
fi | |
echo 'In case of failed patching, please re-validate SteamVR files to make sure they stay unchanged' | |
echo Deleting SteamVR html cache | |
rm -r ~/.cache/SteamVR | |
CHANGED_OUT=$(sed -i 's/m=n(1380),g=n(9809);/m=n(1380),g=n(9809),refresh_counter=0,refresh_counter_max=75;/g w /dev/stdout' $PATH_TO_PATCHING_FILE) | |
if [[ -z $CHANGED_OUT ]]; then | |
echo "Couldn't patch, exiting" | |
exit 1 | |
else | |
echo "patched 1" | |
fi | |
CHANGED_OUT=$(sed -i 's/case"action_bindings_reloaded":this.OnActionBindingsReloaded(n);break;/case"action_bindings_reloaded":if(refresh_counter%refresh_counter_max==0){this.OnActionBindingsReloaded(n);}refresh_counter++;break;/g w /dev/stdout' $PATH_TO_PATCHING_FILE) | |
if [[ -z $CHANGED_OUT ]]; then | |
echo "Couldn't patch, exiting" | |
exit 1 | |
else | |
echo "patched 2" | |
fi | |
CHANGED_OUT=$(sed -i 's/l=n(3568),c=n(1569);/l=n(3568),c=n(1569),refresh_counter_v2=0,refresh_counter_max_v2=75;/g w /dev/stdout' $PATH_TO_PATCHING_FILE) | |
if [[ -z $CHANGED_OUT ]]; then | |
echo "Couldn't patch, exiting" | |
exit 1 | |
else | |
echo "patched 3" | |
fi | |
CHANGED_OUT=$(sed -i 's/OnActionBindingsReloaded(){this.GetInputState()}/OnActionBindingsReloaded(){if(refresh_counter_v2%refresh_counter_max_v2==0){this.GetInputState();}refresh_counter_v2++;}/g w /dev/stdout' $PATH_TO_PATCHING_FILE) | |
if [[ -z $CHANGED_OUT ]]; then | |
echo "Couldn't patch, exiting" | |
exit 1 | |
else | |
echo "patched 4" | |
fi | |
echo Successfully patched web file. |
Updated, one variable on patch 3 was changed and needed to be updated.
If anyone wants patching later manually, just try to look for second part of patches with actual code, and see what lines has been changed - those variables are used only as anchors, to place own variables.
Format minified code and look around patching area.
I am sure you are busy, and I am happy to contribute code changes if pointed in the correct direction. As of 2024/04/04 | 2.4.4 (I think) the script doesn't seem to fix the problem? It previously worked for me in an older steamVR version. My issues were always around VRChat. Anyway, The script patches everything properly, I've done a manual modify before to fix some pathing problems. Now the patching just doesn't seem to affect any behavior in game, I still get the controller binding spam and the resultant late start frames in game. I am happy to pay for advice or an update, thanks.
I just checked and it is not spamming, not causing major cpu usage.
I don't think vrchat issue is related to this...
Verify integrity of files on latest stable and try re-patching it
Check in F9 of SteamVR settings - Network if getstates are spammed every frame (and not each 2 seconds)
This is the type of logspam I'm getting, after verifying integrity and re-patching. Checking the getstate.json requests, it seems to be happening every few seconds, not every frame for sure, but this log spamming is happening much faster than every few seconds, seems detached from the cadence of the getstate, if they were supposed to be related.
Sat Apr 06 2024 10:46:56.885661 [Info] - Unable to find input 'z' in filter click_button_actions_legacy_17_user_hand_left_input_thumbstick Sat Apr 06 2024 10:46:56.885693 [Info] - Unable to find input 'z' in filter click_button_actions_legacy_18_user_hand_right_input_thumbstick Sat Apr 06 2024 10:46:56.934814 [Info] - Determined this is a legacy app. Sat Apr 06 2024 10:46:56.935793 [Info] - Determined this is a legacy app. Sat Apr 06 2024 10:46:56.935916 [Info] - Unable to find input 'z' in filter click_button_actions_legacy_17_user_hand_left_input_thumbstick Sat Apr 06 2024 10:46:56.935966 [Info] - Unable to find input 'z' in filter click_button_actions_legacy_18_user_hand_right_input_thumbstick Sat Apr 06 2024 10:46:56.984074 [Info] - Determined this is a legacy app. Sat Apr 06 2024 10:46:56.984921 [Info] - Determined this is a legacy app. Sat Apr 06 2024 10:46:56.985033 [Info] - Unable to find input 'z' in filter click_button_actions_legacy_17_user_hand_left_input_thumbstick Sat Apr 06 2024 10:46:56.985069 [Info] - Unable to find input 'z' in filter click_button_actions_legacy_18_user_hand_right_input_thumbstick Sat Apr 06 2024 10:46:57.034032 [Info] - Determined this is a legacy app.
Pretty sure it's unrelated/different issue... issue that this patch fixes is just binding reload spam
Actually, as it turns out, its definitely not VRChat related. The log spam happens even in VR Home which is being seen as a legacy application. It is checking for legacy bindings every frame, and once I turn on controllers, it adds in that message about the left and right thumbs
2.3.5 Patch 3 fails
Though just having patch 1 and 2 applied allows one to open the controller binding UI. Thank you for providing this script!