fix: client_key is a string

This commit is contained in:
alban 2023-07-17 10:24:02 +02:00
parent afaa397a52
commit 60121a01c2
2 changed files with 5 additions and 5 deletions

View File

@ -101,7 +101,7 @@ impl RedisCtrl {
pub fn init_world_state( &mut self) -> LJResult<WorldState>{ pub fn init_world_state( &mut self) -> LJResult<WorldState>{
Ok(WorldState { Ok(WorldState {
client_key: self.connection.get("/clientkey")?, client_key: self.get_client_key()?,
edh: self.get_edh()?, edh: self.get_edh()?,
kpps: self.get_int("kpps")?.try_into()?, kpps: self.get_int("kpps")?.try_into()?,
intensity: self.get_int("intensity")?.try_into()?, intensity: self.get_int("intensity")?.try_into()?,
@ -118,9 +118,9 @@ impl RedisCtrl {
Ok(edh) Ok(edh)
} }
pub fn get_client_key( &mut self ) -> LJResult<u8> { pub fn get_client_key( &mut self ) -> LJResult<String> {
let key : u8 = self.connection.get("/clientkey")?; let key : String = self.connection.get("/clientkey")?;
Ok(key as u8) Ok(key)
} }
pub fn get_int(&mut self, key: &str ) -> LJResult<u32> { pub fn get_int(&mut self, key: &str ) -> LJResult<u32> {

View File

@ -40,7 +40,7 @@ impl EDH {
pub struct WorldState { pub struct WorldState {
pub edh: EDH, pub edh: EDH,
pub resampler: Vec<f32>, pub resampler: Vec<f32>,
pub client_key: u8, pub client_key: String,
pub intensity: u8, pub intensity: u8,
pub kpps: u32, pub kpps: u32,
pub color: Color, pub color: Color,