mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Update to work with polariton v0.2
This commit is contained in:
1 parent
f004ca8565
commit
be37f8913a
83 files changed
+428
-1202
No files matched your search
@@ -1,51 +1,51 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use polariton::operation::{Typed, ParameterTable, OperationResponse, Dict};
|
||||
use polariton::{operation::{Dict, OperationResponse, ParameterTable, Typed}, serdes::TypePrefix};
|
||||
use polariton_server::operations::{Operation, OperationCode};
|
||||
|
||||
pub struct QualityConfigTeller;
|
||||
|
||||
impl Operation for QualityConfigTeller {
|
||||
impl <C> Operation<C> for QualityConfigTeller {
|
||||
type State = ();
|
||||
type User = crate::UserTy;
|
||||
|
||||
fn handle(&self, _: ParameterTable, _: &mut Self::State, _: &Self::User) -> OperationResponse {
|
||||
fn handle(&self, _: ParameterTable<C>, _: &mut Self::State, _: &Self::User) -> OperationResponse<C> {
|
||||
let quality_levels = Typed::HashMap(vec![
|
||||
(Typed::Str("extremLow".into()), Typed::Dict(Dict {
|
||||
key_ty: 115,
|
||||
val_ty: 42,
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("Level".into()), Typed::Long(0)),
|
||||
(Typed::Str("default".into()), Typed::Float(0.0)),
|
||||
],
|
||||
})),
|
||||
(Typed::Str("low".into()), Typed::Dict(Dict {
|
||||
key_ty: 115,
|
||||
val_ty: 42,
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("Level".into()), Typed::Long(1)),
|
||||
(Typed::Str("default".into()), Typed::Float(0.0)),
|
||||
],
|
||||
})),
|
||||
(Typed::Str("normal".into()), Typed::Dict(Dict {
|
||||
key_ty: 115,
|
||||
val_ty: 42,
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("Level".into()), Typed::Long(2)),
|
||||
(Typed::Str("default".into()), Typed::Float(0.0)),
|
||||
],
|
||||
})),
|
||||
(Typed::Str("beautiful".into()), Typed::Dict(Dict {
|
||||
key_ty: 115,
|
||||
val_ty: 42,
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("Level".into()), Typed::Long(3)),
|
||||
(Typed::Str("default".into()), Typed::Float(0.0)),
|
||||
],
|
||||
})),
|
||||
(Typed::Str("fantastic".into()), Typed::Dict(Dict {
|
||||
key_ty: 115,
|
||||
val_ty: 42,
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("Level".into()), Typed::Long(4)),
|
||||
(Typed::Str("default".into()), Typed::Float(f32::MAX)),
|
||||
@@ -59,8 +59,8 @@ impl Operation for QualityConfigTeller {
|
||||
let mut resp_params = HashMap::new();
|
||||
resp_params.insert(1 /* dict<string, hashtable> */, Typed::Dict(
|
||||
Dict {
|
||||
key_ty: 115, // str
|
||||
val_ty: 104, // hash table
|
||||
key_ty: TypePrefix::Str, // str
|
||||
val_ty: TypePrefix::HashMap, // hash table
|
||||
items: vec![
|
||||
(Typed::Str("qualityLevels".into()), quality_levels),
|
||||
(Typed::Str("systemMemoryThresholds".into()), mem_thresholds),
|
||||
|
||||
Reference in new issue
Block a user