diff --git a/src/redis_ctrl.rs b/src/redis_ctrl.rs index 363fdc1..9c245f5 100644 --- a/src/redis_ctrl.rs +++ b/src/redis_ctrl.rs @@ -101,7 +101,7 @@ impl RedisCtrl { pub fn init_world_state( &mut self) -> LJResult{ Ok(WorldState { - client_key: self.connection.get("/clientkey")?, + client_key: self.get_client_key()?, edh: self.get_edh()?, kpps: self.get_int("kpps")?.try_into()?, intensity: self.get_int("intensity")?.try_into()?, @@ -118,9 +118,9 @@ impl RedisCtrl { Ok(edh) } - pub fn get_client_key( &mut self ) -> LJResult { - let key : u8 = self.connection.get("/clientkey")?; - Ok(key as u8) + pub fn get_client_key( &mut self ) -> LJResult { + let key : String = self.connection.get("/clientkey")?; + Ok(key) } pub fn get_int(&mut self, key: &str ) -> LJResult { diff --git a/src/worldstate.rs b/src/worldstate.rs index 1f6bea2..e03edb1 100644 --- a/src/worldstate.rs +++ b/src/worldstate.rs @@ -40,7 +40,7 @@ impl EDH { pub struct WorldState { pub edh: EDH, pub resampler: Vec, - pub client_key: u8, + pub client_key: String, pub intensity: u8, pub kpps: u32, pub color: Color,