feat(secure): add get_playing_session and start working on auto_matchmake_with_param_postpone with RmcSerialize macro
This commit is contained in:
parent
d8c184171d
commit
d01acbb931
16 changed files with 338 additions and 23 deletions
17
src/main.rs
17
src/main.rs
|
|
@ -6,14 +6,17 @@ use std::net::{Ipv4Addr, SocketAddrV4};
|
|||
use std::sync::Arc;
|
||||
use chrono::Local;
|
||||
use log::info;
|
||||
use macros::RmcSerialize;
|
||||
use once_cell::sync::Lazy;
|
||||
use rc4::{KeyInit, Rc4, StreamCipher};
|
||||
use rc4::consts::U5;
|
||||
use simplelog::{ColorChoice, CombinedLogger, Config, LevelFilter, TerminalMode, TermLogger, WriteLogger};
|
||||
use tokio::sync::Mutex;
|
||||
use tokio::task::JoinHandle;
|
||||
use crate::nex::account::Account;
|
||||
use crate::protocols::auth;
|
||||
use crate::protocols::auth::AuthProtocolConfig;
|
||||
use crate::protocols::matchmake_common::MatchmakeData;
|
||||
use crate::protocols::server::RMCProtocolServer;
|
||||
use crate::prudp::socket::{ActiveSecureConnectionData, EncryptionPair, Socket};
|
||||
use crate::prudp::packet::{PRUDPPacket, VirtualPort};
|
||||
|
|
@ -21,6 +24,7 @@ use crate::prudp::router::Router;
|
|||
use crate::prudp::secure::{generate_secure_encryption_pairs, read_secure_connection_data};
|
||||
use crate::rmc::message::RMCMessage;
|
||||
use crate::rmc::structures::RmcSerialize;
|
||||
use crate::rmc::structures::variant::Variant;
|
||||
|
||||
mod endianness;
|
||||
mod prudp;
|
||||
|
|
@ -166,8 +170,13 @@ async fn start_secure_server() -> SecureServer{
|
|||
|
||||
info!("setting up endpoints");
|
||||
|
||||
let matchmake_data = Arc::new(Mutex::new(
|
||||
MatchmakeData{}
|
||||
));
|
||||
|
||||
let rmcserver = RMCProtocolServer::new(Box::new([
|
||||
Box::new(protocols::secure::bound_protocol())
|
||||
Box::new(protocols::secure::bound_protocol()),
|
||||
Box::new(protocols::matchmake_extension::bound_protocol(matchmake_data))
|
||||
]));
|
||||
|
||||
let mut socket =
|
||||
|
|
@ -274,4 +283,10 @@ mod test{
|
|||
|
||||
println!("packet: {:?}", packet);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(RmcSerialize)]
|
||||
#[rmc_struct(0)]
|
||||
struct MatchmakeParam{
|
||||
params: Vec<(String, Variant)>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue