configuration protocol support draft
This commit is contained in:
@ -96,8 +96,8 @@ func (d *MojangLoginHandler) AcceptLogin(conn *net.Conn, protocol int32) (name s
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if p.ID != packetid.LoginStart {
|
||||
err = wrongPacketErr{expect: packetid.LoginStart, get: p.ID}
|
||||
if packetid.ServerboundPacketID(p.ID) != packetid.ServerboundLoginStart {
|
||||
err = wrongPacketErr{expect: int32(packetid.ServerboundLoginStart), get: p.ID}
|
||||
return
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ func (d *MojangLoginHandler) AcceptLogin(conn *net.Conn, protocol int32) (name s
|
||||
// set compression
|
||||
if d.Threshold >= 0 {
|
||||
err = conn.WritePacket(pk.Marshal(
|
||||
packetid.LoginCompression,
|
||||
packetid.ClientboundLoginCompression,
|
||||
pk.VarInt(d.Threshold),
|
||||
))
|
||||
if err != nil {
|
||||
@ -152,7 +152,7 @@ func (d *MojangLoginHandler) AcceptLogin(conn *net.Conn, protocol int32) (name s
|
||||
}
|
||||
// send login success
|
||||
err = conn.WritePacket(pk.Marshal(
|
||||
packetid.LoginSuccess,
|
||||
packetid.ClientboundLoginSuccess,
|
||||
pk.UUID(id),
|
||||
pk.String(name),
|
||||
pk.Array(properties),
|
||||
|
Reference in New Issue
Block a user