Implement GetApplicationConfig
This commit is contained in:
parent
75c6e9df49
commit
3b103e12d4
2 changed files with 45 additions and 0 deletions
|
|
@ -57,4 +57,40 @@ impl DataStore for User {
|
|||
// this returns nothing
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn get_application_config(&self, appid: u32) -> Result<Vec<i32>, ErrorCode> {
|
||||
const MAX_COURSE_UPLOADS: i32 = 100;
|
||||
|
||||
let config = match appid {
|
||||
0 => vec![
|
||||
0x00000001, 0x00000032, 0x00000096, 0x0000012c, 0x000001f4,
|
||||
0x00000320, 0x00000514, 0x000007d0, 0x00000bb8, 0x00001388,
|
||||
MAX_COURSE_UPLOADS, 0x00000014, 0x0000001e, 0x00000028, 0x00000032,
|
||||
0x0000003c, 0x00000046, 0x00000050, 0x0000005a, 0x00000064,
|
||||
0x00000023, 0x0000004b, 0x00000023, 0x0000004b, 0x00000032,
|
||||
0x00000000, 0x00000003, 0x00000003, 0x00000064, 0x00000006,
|
||||
0x00000001, 0x00000060, 0x00000005, 0x00000060, 0x00000000,
|
||||
0x000007e4, 0x00000001, 0x00000001, 0x0000000c, 0x00000000,
|
||||
],
|
||||
1 => vec![
|
||||
2,
|
||||
1770179696,
|
||||
1770179664,
|
||||
1770179640,
|
||||
1770180827,
|
||||
1770180777,
|
||||
1770180745,
|
||||
1770177625,
|
||||
1770177590,
|
||||
],
|
||||
2 => vec![0x000007df, 0x0000000c, 0x00000016, 0x00000005, 0x00000000],
|
||||
10 => vec![35, 75, 96, 40, 5, 6],
|
||||
_ => {
|
||||
log::error!("unknown SMM app id: {}", appid);
|
||||
return Err(ErrorCode::DataStore_Unknown);
|
||||
}
|
||||
};
|
||||
|
||||
Ok(config)
|
||||
}
|
||||
}
|
||||
|
|
@ -145,6 +145,13 @@ pub struct RateCustomRankingParam {
|
|||
pub period: u16,
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize, Clone)]
|
||||
#[rmc_struct(0)]
|
||||
pub struct BufferQueueParam {
|
||||
pub dataid: u64,
|
||||
pub slot: u32,
|
||||
}
|
||||
|
||||
#[rmc_proto(115)]
|
||||
pub trait DataStore{
|
||||
#[method_id(8)]
|
||||
|
|
@ -155,4 +162,6 @@ pub trait DataStore{
|
|||
async fn complete_post_object(&self, completeparam: CompletePostParam) -> Result<(), ErrorCode>;
|
||||
#[method_id(48)]
|
||||
async fn rate_custom_ranking(&self, rankingparam: Vec<RateCustomRankingParam>) -> Result<(), ErrorCode>;
|
||||
#[method_id(61)]
|
||||
async fn get_application_config(&self, appid: u32) -> Result<Vec<i32>, ErrorCode>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue