configuration protocol support draft

This commit is contained in:
Tnze
2023-11-19 02:10:15 +08:00
parent 61916db07a
commit 006f958f43
9 changed files with 184 additions and 106 deletions

View File

@ -59,15 +59,15 @@ func (s *Server) acceptListPing(conn *net.Conn, clientProtocol int32) {
return
}
switch p.ID {
case packetid.StatusResponse: // List
switch packetid.ClientboundPacketID(p.ID) {
case packetid.ClientboundStatusResponse: // List
var resp []byte
resp, err = s.listResp(clientProtocol)
if err != nil {
break
}
err = conn.WritePacket(pk.Marshal(0x00, pk.String(resp)))
case packetid.StatusPongResponse: // Ping
case packetid.ClientboundStatusPongResponse: // Ping
err = conn.WritePacket(p)
}
if err != nil {