Basic test for SMM functionality
This commit is contained in:
parent
2f4d42d3ed
commit
7e22acda59
4 changed files with 107 additions and 0 deletions
31
rnex-core/src/nex/datastore.rs
Normal file
31
rnex-core/src/nex/datastore.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
use rnex_core::rmc::protocols::datastore::DataStore;
|
||||
// use crate::define_rmc_proto;
|
||||
// use macros::rmc_struct;
|
||||
use rnex_core::prudp::socket_addr::PRUDPSockAddr;
|
||||
use std::sync::{Weak};
|
||||
use rnex_core::PID;
|
||||
use crate::nex::remote_console::RemoteConsole;
|
||||
use rnex_core::rmc::response::ErrorCode;
|
||||
use rnex_core::rmc::protocols::datastore::{GetMetaInfo, GetMetaParam};
|
||||
|
||||
pub struct User {
|
||||
pub pid: PID,
|
||||
pub ip: PRUDPSockAddr,
|
||||
pub this: Weak<User>,
|
||||
pub remote: RemoteConsole,
|
||||
}
|
||||
|
||||
impl DataStore for User {
|
||||
async fn get_meta(&self, metaparam: GetMetaParam) -> Result<GetMetaInfo, rnex_core::rmc::response::ErrorCode> {
|
||||
// // bogus
|
||||
// let info: GetMetaInfo = GetMetaInfo {
|
||||
// dataid: 10,
|
||||
// owner: 1121,
|
||||
// size: 1024,
|
||||
// name: "idk"
|
||||
// }
|
||||
|
||||
// just trying to see what methods it tries to use
|
||||
Err(rnex_core::rmc::response::ErrorCode::DataStore_NotFound)
|
||||
}
|
||||
}
|
||||
|
|
@ -5,3 +5,4 @@ pub mod friends_handler;
|
|||
pub mod matchmake;
|
||||
pub mod remote_console;
|
||||
pub mod user;
|
||||
pub mod datastore;
|
||||
Loading…
Add table
Add a link
Reference in a new issue