harshavb / piously-old-ver

Welcome to Piously! This is a hexagonal 1v1 board game.
2 stars 0 forks source link

Create a storage system for KeyBindingStore #41

Closed harshavb closed 3 years ago

harshavb commented 3 years ago

We need to implement a method to store KeyBindings contained in the KeyBindingStore.

harshavb commented 3 years ago

Current idea is to go ahead and make a PiouslyKeyBinding : KeyBinding, IComparable that can then be sorted whenever used by KeyBindingStore, and then use SortedListJsonConverter from osu-framework to setup the storage of the keybindings.

harshavb commented 3 years ago

SortedListJsonConverter simply exists for internal usage, not actually containing code to serialize a sorted list. We will have to make our own using a JsonWriter.

harshavb commented 3 years ago

A TypedListConverter might be of use.

ben9583 commented 3 years ago

I think I have some ideas for this, but I'm worried that any method could theoretically be tampered with to allow users to open whatever file is saved and change the action to some that may be potential harmful. Any ideas how to circumvent this? I was thinking about using base64 but that can be easily reversed; could be a good deterrent though.

harshavb commented 3 years ago

The keybinding file should be editable, as it acts as a configuration file. Piously should just fail to load or load default keybindings if the config file is tampered with in an unexpected way.

ben9583 commented 3 years ago

Redundant; moving from KeyBindingStore to PiouslyConfigManager: closing issue