forked from lavina/lavina
1
0
Fork 0

mr comments fix

This commit is contained in:
homycdev 2024-05-05 19:30:47 +03:00
parent 5eb0385012
commit 942546d579
1 changed files with 2 additions and 4 deletions

View File

@ -81,7 +81,7 @@ async fn handle_socket(
match registered_user { match registered_user {
Ok(user) => { Ok(user) => {
log::debug!("User registered"); log::debug!("User registered");
handle_registered_socket(config, core.players, core.rooms, &mut reader, &mut writer, user, &mut storage).await?; handle_registered_socket(config, core.players, core.rooms, &mut reader, &mut writer, user).await?;
} }
Err(err) => { Err(err) => {
log::debug!("Registration failed: {err}"); log::debug!("Registration failed: {err}");
@ -425,7 +425,6 @@ async fn handle_registered_socket<'a>(
reader: &mut BufReader<ReadHalf<'a>>, reader: &mut BufReader<ReadHalf<'a>>,
writer: &mut BufWriter<WriteHalf<'a>>, writer: &mut BufWriter<WriteHalf<'a>>,
user: RegisteredUser, user: RegisteredUser,
storage: &mut Storage,
) -> Result<()> { ) -> Result<()> {
let mut buffer = vec![]; let mut buffer = vec![];
log::info!("Handling registered user: {user:?}"); log::info!("Handling registered user: {user:?}");
@ -505,7 +504,7 @@ async fn handle_registered_socket<'a>(
len len
}; };
let incoming = std::str::from_utf8(&buffer[0..len-2])?; let incoming = std::str::from_utf8(&buffer[0..len-2])?;
if let HandleResult::Leave = handle_incoming_message(incoming, &config, &user, &rooms, &mut connection, writer, storage.clone()).await? { if let HandleResult::Leave = handle_incoming_message(incoming, &config, &user, &rooms, &mut connection, writer).await? {
break; break;
} }
buffer.clear(); buffer.clear();
@ -697,7 +696,6 @@ async fn handle_incoming_message(
rooms: &RoomRegistry, rooms: &RoomRegistry,
user_handle: &mut PlayerConnection, user_handle: &mut PlayerConnection,
writer: &mut (impl AsyncWrite + Unpin), writer: &mut (impl AsyncWrite + Unpin),
mut storage: Storage,
) -> Result<HandleResult> { ) -> Result<HandleResult> {
log::debug!("Incoming raw IRC message: '{buffer}'"); log::debug!("Incoming raw IRC message: '{buffer}'");
let parsed = client_message(buffer); let parsed = client_message(buffer);