hole punch harder fuck you

This commit is contained in:
Aubrey 2025-01-04 02:33:12 -06:00
parent 40e8f0f7a9
commit d97a2a81c3
No known key found for this signature in database

View file

@ -146,10 +146,10 @@ impl PlayerActor {
trace!("now connected on udp at {}", SocketAddr::new(ip, port));
addr = Some(SocketAddr::new(ip, port));
let mut buf = [0; 256];
let mut writer = Cursor::new(buf.as_mut_slice());
write_packet(&mut writer, user_id, PacketData::HolePunch(HolePunch)).await.unwrap();
socket.send_to(&buf, addr.as_ref().unwrap()).await.expect("kys");
// let mut buf = [0; 256];
// let mut writer = Cursor::new(buf.as_mut_slice());
// write_packet(&mut writer, user_id, PacketData::HolePunch(HolePunch)).await.unwrap();
// socket.send_to(&buf, addr.as_ref().unwrap()).await.expect("kys");
}
}
}
@ -260,6 +260,30 @@ impl Handler<Packet> for PlayerActor {
PacketData::UdpInit(UdpInit { port }) => {
info!("got udp init {port}!");
let _ = self.write_sender.send(WriteMessage::SetUdp(port));
let _ = self
.write_sender
.send(WriteMessage::Data(Packet {
user_id: 0,
udp: false,
data: PacketData::HolePunch(HolePunch),
}))
.map_err(drop);
let _ = self
.write_sender
.send(WriteMessage::Data(Packet {
user_id: 0,
udp: false,
data: PacketData::HolePunch(HolePunch),
}))
.map_err(drop);
let _ = self
.write_sender
.send(WriteMessage::Data(Packet {
user_id: 0,
udp: false,
data: PacketData::HolePunch(HolePunch),
}))
.map_err(drop);
return;
}
PacketData::Connect(..) | PacketData::Init(..) => {