valheimPlus / ValheimPlus

A HarmonyX Mod aimed at improving the gameplay and quality of life of the game Valheim.
http://valheim.plus
GNU Affero General Public License v3.0
967 stars 237 forks source link

[BUG] custom hotkeys get reset to deafults when connecting to a server #677

Open dudeofawesome opened 2 years ago

dudeofawesome commented 2 years ago

Describe the bug

Custom keybinds like 1st person toggle and rolling work fine in single player, but when connecting to a multiplayer server, they seem reset to defaults. If I choose to sync the server's keybinds, then they work according to the server's settings, but I can't find a way to get my client's keybinds to be used.

To Reproduce

Steps for the devs to reproduce the behavior:

  1. Set custom V+ client keybinds
  2. Set serverSyncsConfig = true on client and server
  3. Set serverSyncHotkeys = false on client and server
  4. Play singleplayer, custom hotkeys work
  5. Play multiplayer, hotkeys reset to default

Expected behavior

Being able to set custom hotkeys per client in multiplayer

Troubleshooting

See the description above.

Additional context

cougarten commented 2 years ago

Isn't the server overriding the local settings the documented behavior? In that case this would rather be a feature request than a bug.

I also have trouble with the AdvancedEditingMode keybindings though :)

crsmithdev commented 2 years ago

I'm seeing a possibly related issue: any keybind I change from default on the server seems to fail to get loaded properly on the client even when hotkey syncing is on.

Example: I changed the key for entering advanced build mode from F1 to F6, however when connecting to the server:

[Info   : Unity Log] Loading config section AdvancedBuildingMode
[Info   : Unity Log]  Loading key enterAdvancedBuildingMode
[Warning: Unity Log]  Could not load data of type UnityEngine.KeyCode for key enterAdvancedBuildingMode

May file a separate issue, but not yet sure the issue isn't on my end.

dudeofawesome commented 2 years ago

My understanding is that serverSyncHotkeys = false would allow each client to set their own custom hotkeys for each enabled section. Am I misunderstanding this option?

ryderstorm commented 2 years ago

I'm experiencing the same issue with serverSyncHotkeys = false not working. I have the setting set to false on both my server and my local config, but am seeing the same behavior as @dudeofawesome .

carolluparu commented 1 year ago

The issue still seems to reproduce. While "serverSyncHotkeys = true", on both server and client, the server's hotkeys are enforced in multi-player; after setting "serverSyncHotkeys = false" on both client and server, the server's hotkeys are still enforced.

Tested with hotkeys: ; Roll forwards on hot key pressed. rollForwards = Mouse4 ; Roll backwards on hot key pressed. rollBackwards = Mouse3