message: chore: Add minimum version checking for config files
  Make sure we can't try to load config files older than we have in
  the library.
diff: @@ -14,7 +14,7 @@ static DEVICE_CONFIGURATION_JSON_SCHEMA: &str =
  #[derive(Deserialize, Debug)]
  pub struct ProtocolConfiguration {
  - //pub version: u32,
  + pub version: u32,
  pub protocols: HashMap<String, ProtocolDefinition>,
  }
  @@ -33,11 +33,30 @@ impl ProtocolConfiguration {
  }
  }
  +pub fn get_internal_config_version() -> u32 {
  + let config: ProtocolConfiguration = serde_json::from_str(DEVICE_CONFIGURATION_JSON).unwrap();
  + config.version
  +}
  +
  pub fn load_protocol_config_from_json(config_str: &str) -> Result<ProtocolConfiguration, ButtplugError> {
  let config_validator = JSONValidator::new(DEVICE_CONFIGURATION_JSON_SCHEMA);
  match config_validator.validate(config_str) {
  Ok(_) => match serde_json::from_str(config_str) {
  - Ok(protocol_config) => Ok(protocol_config),
  + Ok(protocol_config) => {
  + let internal_config_version = get_internal_config_version();
  + // No idea why, but rustc can't seem to resolve protocol_config's type here?!
  + let protocol_version = (&protocol_config as &ProtocolConfiguration).version;
  + if protocol_version < internal_config_version {
  + Err(ButtplugDeviceError::DeviceConfigurationFileError(format!(
  + "Device configuration file version {} is older than internal version {}. Please use a newer file.",
  + protocol_version,
  + internal_config_version
  + )).into())
  + } else {
  + Ok(protocol_config)
  + }
  +
  + }
  Err(err) => {
  Err(ButtplugDeviceError::DeviceConfigurationFileError(format!(
  "{}",
  