Skip to content

Instantly share code, notes, and snippets.

@Meister1593
Last active April 7, 2024 17:07
Show Gist options
  • Save Meister1593/b574b399d85770abc2368f4d5af9df42 to your computer and use it in GitHub Desktop.
Save Meister1593/b574b399d85770abc2368f4d5af9df42 to your computer and use it in GitHub Desktop.
Updated for steamvr 2.3.5
#!/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.
@soybeansavior
Copy link

soybeansavior commented Apr 6, 2024

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.

@Meister1593
Copy link
Author

Pretty sure it's unrelated/different issue... issue that this patch fixes is just binding reload spam

@soybeansavior
Copy link

soybeansavior commented Apr 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment