This commit is contained in:
parent
a91d262271
commit
bf174dcdb1
@ -21,13 +21,13 @@ Example of receiving motd:
|
||||
use rust_mc_proto::{DataReader, DataWriter, MCConnTcp, Packet, ProtocolError};
|
||||
|
||||
fn main() -> Result<(), ProtocolError> {
|
||||
let mut conn = MCConnTcp::connect("mc.hypixel.net:25565")?; // connecting
|
||||
let mut conn = MCConnTcp::connect("localhost:25565")?; // connecting
|
||||
|
||||
conn.write_packet(&Packet::build(0x00, |packet| {
|
||||
packet.write_u16_varint(765)?; // protocol_version
|
||||
packet.write_string("mc.hypixel.net")?; // server_address
|
||||
packet.write_varint(765)?; // protocol_version
|
||||
packet.write_string("localhost")?; // server_address
|
||||
packet.write_unsigned_short(25565)?; // server_port
|
||||
packet.write_u8_varint(1) // next_state
|
||||
packet.write_varint(1) // next_state
|
||||
})?)?; // handshake packet
|
||||
|
||||
conn.write_packet(&Packet::empty(0x00))?; // status request packet
|
||||
|
Loading…
Reference in New Issue
Block a user