feat: refactor prudp code and start working on refactoring rmc

This commit is contained in:
DJMrTV 2025-02-18 22:55:33 +01:00
commit 3ea7c7e671
37 changed files with 2029 additions and 456 deletions

View file

@ -0,0 +1,29 @@
use std::io::Cursor;
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::{Mutex, RwLock};
use tokio::time::sleep;
use crate::protocols::matchmake_common::MatchmakeData;
use crate::rmc::message::RMCMessage;
use crate::rmc::response::{ErrorCode, RMCResponseResult};
use crate::rmc::structures::matchmake::CreateMatchmakeSessionParam;
pub async fn report_nat_properties(
rmcmessage: &RMCMessage,
socket: &Arc<SocketData>,
connection_data: &Arc<Mutex<ConnectionData>>,
) -> RMCResponseResult{
sleep(Duration::from_millis(50)).await;
rmcmessage.success_with_data(Vec::new())
}
pub async fn report_nat_properties_raw_params(
rmcmessage: &RMCMessage,
socket: &Arc<SocketData>,
connection_data: &Arc<Mutex<ConnectionData>>,
_: ()
) -> RMCResponseResult{
let mut reader = Cursor::new(&rmcmessage.rest_of_data);
report_nat_properties(rmcmessage, socket, connection_data).await
}