Update packetid name
This commit is contained in:
@ -89,7 +89,7 @@ func encryptionRequest(conn *net.Conn, publicKey []byte) ([]byte, error) {
|
||||
return nil, err
|
||||
}
|
||||
err = conn.WritePacket(pk.Marshal(
|
||||
packetid.EncryptionBeginClientbound,
|
||||
packetid.LoginEncryptionRequest,
|
||||
pk.String(""),
|
||||
pk.ByteArray(publicKey),
|
||||
pk.ByteArray(verifyToken[:]),
|
||||
@ -103,7 +103,7 @@ func encryptionResponse(conn *net.Conn) ([]byte, []byte, error) {
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if p.ID != packetid.EncryptionBeginServerbound {
|
||||
if p.ID != packetid.LoginEncryptionResponse {
|
||||
return nil, nil, fmt.Errorf("0x%02X is not Encryption Response", p.ID)
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ func (d *MojangLoginHandler) AcceptLogin(conn *net.Conn, protocol int32) (name s
|
||||
//set compression
|
||||
if d.Threshold >= 0 {
|
||||
err = conn.WritePacket(pk.Marshal(
|
||||
packetid.Compress, pk.VarInt(d.Threshold),
|
||||
packetid.SetCompression, pk.VarInt(d.Threshold),
|
||||
))
|
||||
if err != nil {
|
||||
return
|
||||
@ -64,7 +64,7 @@ func (d *MojangLoginHandler) AcceptLogin(conn *net.Conn, protocol int32) (name s
|
||||
}
|
||||
|
||||
// send login success
|
||||
err = conn.WritePacket(pk.Marshal(packetid.Success,
|
||||
err = conn.WritePacket(pk.Marshal(packetid.LoginSuccess,
|
||||
pk.UUID(id),
|
||||
pk.String(name),
|
||||
))
|
||||
|
@ -33,14 +33,14 @@ func (s *Server) acceptListPing(conn *net.Conn) {
|
||||
}
|
||||
|
||||
switch p.ID {
|
||||
case packetid.ServerInfo: //List
|
||||
case packetid.StatusResponse: //List
|
||||
var resp []byte
|
||||
resp, err = s.listResp()
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
err = conn.WritePacket(pk.Marshal(0x00, pk.String(resp)))
|
||||
case packetid.PingClientbound: //Ping
|
||||
case packetid.StatusPong: //Ping
|
||||
err = conn.WritePacket(p)
|
||||
}
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user