velocity forwarded address port default to 0

This commit is contained in:
Alvsch committed 2024-10-17 00:06:52 +02:00
1 parent d35461eea1
commit 6c9862cce8
1 file changed
+3 -4
+3 -4
View File
@@ -1,4 +1,4 @@
use std::net::SocketAddr; use std::net::{IpAddr, SocketAddr};
use bytes::{BufMut, BytesMut}; use bytes::{BufMut, BytesMut};
use hmac::{Hmac, Mac}; use hmac::{Hmac, Mac};
@@ -60,9 +60,8 @@ pub fn receive_plugin_response(
)); ));
return; return;
} }
// TODO: dont default to localhost // TODO: no unwrap
let addr: SocketAddr = buf.get_string().unwrap().parse() let addr: SocketAddr = SocketAddr::new(buf.get_string().unwrap().parse::<IpAddr>().unwrap(), 0);
.unwrap_or_else(|_| ([127, 0, 0, 1], 25565).into());
*client.address.lock() = addr; *client.address.lock() = addr;