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 {
Ok(user) => {
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) => {
log::debug!("Registration failed: {err}");
@ -425,7 +425,6 @@ async fn handle_registered_socket<'a>(
reader: &mut BufReader<ReadHalf<'a>>,
writer: &mut BufWriter<WriteHalf<'a>>,
user: RegisteredUser,
storage: &mut Storage,
) -> Result<()> {
let mut buffer = vec![];
log::info!("Handling registered user: {user:?}");
@ -505,7 +504,7 @@ async fn handle_registered_socket<'a>(
len
};
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;
}
buffer.clear();
@ -697,7 +696,6 @@ async fn handle_incoming_message(
rooms: &RoomRegistry,
user_handle: &mut PlayerConnection,
writer: &mut (impl AsyncWrite + Unpin),
mut storage: Storage,
) -> Result<HandleResult> {
log::debug!("Incoming raw IRC message: '{buffer}'");
let parsed = client_message(buffer);